test_class.declarator: DELTA = 1e-6
test_class.modifier: private static final
test_class.original_string: private static final double DELTA = 1e-6;
test_class.type: double
test_class.var_name: DELTA
test_class.declarator: geocoder
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private TypeCoordinateService geocoder;
test_class.type: TypeCoordinateService
test_class.var_name: geocoder
test_class.file: plugin/geocoder/geocoder/src/test/java/org/geomajas/plugin/geocoder/service/TypeCoordinateServiceTest.java
test_class.identifier: TypeCoordinateServiceTest
test_case.body: @Test
  	public void testGeocoderInvalidTransform() {
  		List<String> list = new ArrayList<String>();
  		GetLocationResult[] result;
  
  		list.clear();
  		list.add("4.77397  51.05125  crs:bla");
  		result = geocoder.getLocation(list, 50, null);
  		Assert.assertNotNull(result);
  		Assert.assertEquals(1,result.length);
  		Assert.assertNotNull(result[0].getCoordinate());
  		Assert.assertEquals(4.77397, result[0].getCoordinate().x, DELTA);
  		Assert.assertEquals(51.05125, result[0].getCoordinate().y, DELTA);
  		Assert.assertEquals(1, result[0].getCanonicalStrings().size());
  		Assert.assertEquals("4.77397 51.05125", result[0].getCanonicalStrings().get(0));
  		Assert.assertNull(result[0].getEnvelope());
  	}
test_case.class_method_signature: TypeCoordinateServiceTest.testGeocoderInvalidTransform()
test_case.full_signature: @Test public void testGeocoderInvalidTransform()
test_case.identifier: testGeocoderInvalidTransform
test_case.invocations: clear add getLocation assertNotNull assertEquals assertNotNull getCoordinate assertEquals getCoordinate assertEquals getCoordinate assertEquals size getCanonicalStrings assertEquals get getCanonicalStrings assertNull getEnvelope
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGeocoderInvalidTransform()
focal_class.declarator: CRS_PREFIX = "crs:"
focal_class.modifier: private static final
focal_class.original_string: private static final String CRS_PREFIX = "crs:";
focal_class.type: String
focal_class.var_name: CRS_PREFIX
focal_class.declarator: log = LoggerFactory.getLogger(TypeCoordinateService.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger log = LoggerFactory.getLogger(TypeCoordinateService.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: geoService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private GeoService geoService;
focal_class.type: GeoService
focal_class.var_name: geoService
focal_class.declarator: defaultCrs = "EPSG:4326"
focal_class.modifier: private
focal_class.original_string: private String defaultCrs = "EPSG:4326";
focal_class.type: String
focal_class.var_name: defaultCrs
focal_class.declarator: crs
focal_class.modifier: private
focal_class.original_string: private Crs crs;
focal_class.type: Crs
focal_class.var_name: crs
focal_class.declarator: name = "TypeCoordinate"
focal_class.modifier: private
focal_class.original_string: private String name = "TypeCoordinate";
focal_class.type: String
focal_class.var_name: name
focal_class.file: plugin/geocoder/geocoder/src/main/java/org/geomajas/plugin/geocoder/service/TypeCoordinateService.java
focal_class.identifier: TypeCoordinateService
focal_class.interfaces: implements GeocoderService
focal_class.class_method_signature: TypeCoordinateService.postConstruct()
focal_class.full_signature: @PostConstruct protected void postConstruct()
focal_class.identifier: postConstruct
focal_class.modifiers: @PostConstruct protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void postConstruct()
focal_class.class_method_signature: TypeCoordinateService.setDefaultCrs(String defaultCrs)
focal_class.full_signature: public void setDefaultCrs(String defaultCrs)
focal_class.identifier: setDefaultCrs
focal_class.modifiers: public
focal_class.parameters: (String defaultCrs)
focal_class.return: void
focal_class.signature: void setDefaultCrs(String defaultCrs)
focal_class.class_method_signature: TypeCoordinateService.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: TypeCoordinateService.setName(String name)
focal_class.full_signature: @Api public void setName(String name)
focal_class.identifier: setName
focal_class.modifiers: @Api public
focal_class.parameters: (String name)
focal_class.return: void
focal_class.signature: void setName(String name)
focal_class.class_method_signature: TypeCoordinateService.getCrs()
focal_class.full_signature: @Override public CoordinateReferenceSystem getCrs()
focal_class.identifier: getCrs
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: CoordinateReferenceSystem
focal_class.signature: CoordinateReferenceSystem getCrs()
focal_class.class_method_signature: TypeCoordinateService.getLocation(List<String> location, int maxAlternatives, Locale locale)
focal_class.full_signature: @Override public GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale locale)
focal_class.identifier: getLocation
focal_class.modifiers: @Override public
focal_class.parameters: (List<String> location, int maxAlternatives, Locale locale)
focal_class.return: GetLocationResult[]
focal_class.signature: GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale locale)
focal_method.body: @Override
  	public GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale locale) {
  		if (null == locale) {
  			locale = Locale.US;
  		}
  		GetLocationResult result = new GetLocationResult();
  		if (location.size() > 0) {
  			String[] parts = location.get(0).split("\\s+");
  			if (parts.length >= 2) {
  				NumberFormat format = NumberFormat.getInstance(locale);
  				try {
  					Double x = format.parse(parts[0]).doubleValue();
  					Double y = format.parse(parts[1]).doubleValue();
  					Coordinate coordinate = new Coordinate(x, y);
  
  					String canonicalCrs = "";
  					if (parts.length > 2) {
  						String crsPart = parts[2];
  						if (crsPart.startsWith(CRS_PREFIX)) {
  							crsPart = crsPart.substring(CRS_PREFIX.length());
  							try {
  								coordinate = geoService.transform(coordinate, crsPart, defaultCrs);
  								canonicalCrs = " " + CRS_PREFIX + crsPart;
  							} catch (GeomajasException le) {
  								log.debug("Crs conversion from " + crsPart + " tot " + defaultCrs + " failed, " +
  										le.getMessage());
  							}
  						}
  					}
  					result.setCoordinate(coordinate);
  					List<String> canonical = new ArrayList<String>();
  					canonical.add(parts[0] + " " + parts[1] + canonicalCrs);
  					result.setCanonicalStrings(canonical);
  					return new GetLocationResult[] { result };
  				} catch (ParseException pe) {
  					log.debug("Could not parse " + location.get(0) + ", " + pe.getMessage());
  				}
  			}
  		}
  		return new GetLocationResult[0];
  	}
focal_method.class_method_signature: TypeCoordinateService.getLocation(List<String> location, int maxAlternatives, Locale locale)
focal_method.full_signature: @Override public GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale locale)
focal_method.identifier: getLocation
focal_method.invocations: size split get getInstance doubleValue parse doubleValue parse startsWith substring length transform debug getMessage setCoordinate add setCanonicalStrings debug get getMessage
focal_method.modifiers: @Override public
focal_method.parameters: (List<String> location, int maxAlternatives, Locale locale)
focal_method.return: GetLocationResult[]
focal_method.signature: GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale locale)