test_class.declarator: dispatcher
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private CommandDispatcher dispatcher;
test_class.type: CommandDispatcher
test_class.var_name: dispatcher
test_class.declarator: converterService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private DtoConverterService converterService;
test_class.type: DtoConverterService
test_class.var_name: converterService
test_class.declarator: MERCATOR = "EPSG:900913"
test_class.modifier: private static final
test_class.original_string: private static final String MERCATOR = "EPSG:900913";
test_class.type: String
test_class.var_name: MERCATOR
test_class.declarator: LONLAT = "EPSG:4326"
test_class.modifier: private static final
test_class.original_string: private static final String LONLAT = "EPSG:4326";
test_class.type: String
test_class.var_name: LONLAT
test_class.declarator: DELTA = 1e-20
test_class.modifier: private static final
test_class.original_string: private static final double DELTA = 1e-20;
test_class.type: double
test_class.var_name: DELTA
test_class.file: command/src/test/java/org/geomajas/command/geometry/TransformGeometryCommandTest.java
test_class.identifier: TransformGeometryCommandTest
test_case.body: @Test
  	public void testTransformGeometryCollection() throws Exception {
  		TransformGeometryRequest request = new TransformGeometryRequest();
  		WKTReader reader = new WKTReader();
  		Geometry origin = converterService.toDto(reader.read("POLYGON((10 30, 20 30,20 40,10 40,10 30))"));
  		List<Geometry> geometries = request.getGeometryCollection(); // assure not-null
  		geometries.add(origin);
  		request.setGeometryCollection(geometries); // assure setter is called/tested
  		request.setSourceCrs(MERCATOR);
  		request.setTargetCrs(LONLAT);
  		// execute
  		TransformGeometryResponse response = (TransformGeometryResponse) dispatcher.execute(
  				TransformGeometryRequest.COMMAND, request, null, "en");
  		List<Geometry> transformed = response.getGeometryCollection();
  		Assert.assertEquals(1, transformed.size());
  		Envelope bounds = converterService.toInternal(transformed.get(0)).getEnvelopeInternal();
  		Assert.assertEquals(8.983152841195215E-5, bounds.getMinX(), DELTA);
  		Assert.assertEquals(2.6949458522981454E-4, bounds.getMinY(), DELTA);
  		Assert.assertEquals(1.796630568239043E-4, bounds.getMaxX(), DELTA);
  		Assert.assertEquals(3.593261136397527E-4, bounds.getMaxY(), DELTA);
  	}
test_case.class_method_signature: TransformGeometryCommandTest.testTransformGeometryCollection()
test_case.full_signature: @Test public void testTransformGeometryCollection()
test_case.identifier: testTransformGeometryCollection
test_case.invocations: toDto read getGeometryCollection add setGeometryCollection setSourceCrs setTargetCrs execute getGeometryCollection assertEquals size getEnvelopeInternal toInternal get assertEquals getMinX assertEquals getMinY assertEquals getMaxX assertEquals getMaxY
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testTransformGeometryCollection()
focal_class.declarator: converter
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private DtoConverterService converter;
focal_class.type: DtoConverterService
focal_class.var_name: converter
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.file: command/src/main/java/org/geomajas/command/geometry/TransformGeometryCommand.java
focal_class.identifier: TransformGeometryCommand
focal_class.interfaces: implements CommandHasRequest<TransformGeometryRequest, TransformGeometryResponse>
focal_class.class_method_signature: TransformGeometryCommand.getEmptyCommandRequest()
focal_class.full_signature: @Override public TransformGeometryRequest getEmptyCommandRequest()
focal_class.identifier: getEmptyCommandRequest
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: TransformGeometryRequest
focal_class.signature: TransformGeometryRequest getEmptyCommandRequest()
focal_class.class_method_signature: TransformGeometryCommand.getEmptyCommandResponse()
focal_class.full_signature: @Override public TransformGeometryResponse getEmptyCommandResponse()
focal_class.identifier: getEmptyCommandResponse
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: TransformGeometryResponse
focal_class.signature: TransformGeometryResponse getEmptyCommandResponse()
focal_class.class_method_signature: TransformGeometryCommand.execute(TransformGeometryRequest request, TransformGeometryResponse response)
focal_class.full_signature: @Override public void execute(TransformGeometryRequest request, TransformGeometryResponse response)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (TransformGeometryRequest request, TransformGeometryResponse response)
focal_class.return: void
focal_class.signature: void execute(TransformGeometryRequest request, TransformGeometryResponse response)
focal_method.body: @Override
  	public void execute(TransformGeometryRequest request, TransformGeometryResponse response) throws Exception {
  		Crs sourceCrs = geoService.getCrs2(request.getSourceCrs());
  		Crs targetCrs = geoService.getCrs2(request.getTargetCrs());
  		CrsTransform transform = geoService.getCrsTransform(sourceCrs, targetCrs);
  
  		if (request.getBounds() != null) {
  			Envelope source = converter.toInternal(request.getBounds());
  			Envelope target = geoService.transform(source, transform);
  			response.setBounds(converter.toDto(target));
  		}
  
  		if (request.getGeometry() != null) {
  			Geometry source = converter.toInternal(request.getGeometry());
  			Geometry target = geoService.transform(source, transform);
  			response.setGeometry(converter.toDto(target));
  		}
  
  		if (request.getGeometryCollection() != null) {
  			for (org.geomajas.geometry.Geometry geometry : request.getGeometryCollection()) {
  				Geometry source = converter.toInternal(geometry);
  				Geometry target = geoService.transform(source, transform);
  				response.getGeometryCollection().add(converter.toDto(target));
  			}
  		}
  	}
focal_method.class_method_signature: TransformGeometryCommand.execute(TransformGeometryRequest request, TransformGeometryResponse response)
focal_method.full_signature: @Override public void execute(TransformGeometryRequest request, TransformGeometryResponse response)
focal_method.identifier: execute
focal_method.invocations: getCrs2 getSourceCrs getCrs2 getTargetCrs getCrsTransform getBounds toInternal getBounds transform setBounds toDto getGeometry toInternal getGeometry transform setGeometry toDto getGeometryCollection getGeometryCollection toInternal transform add getGeometryCollection toDto
focal_method.modifiers: @Override public
focal_method.parameters: (TransformGeometryRequest request, TransformGeometryResponse response)
focal_method.return: void
focal_method.signature: void execute(TransformGeometryRequest request, TransformGeometryResponse response)