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: geometries
test_class.modifier: private
test_class.original_string: private List<Geometry> geometries;
test_class.type: List<Geometry>
test_class.var_name: geometries
test_class.declarator: DELTA = 1E-5
test_class.modifier: private
test_class.original_string: private double DELTA = 1E-5;
test_class.type: double
test_class.var_name: DELTA
test_class.file: command/src/test/java/org/geomajas/command/geometry/GeometryAreaCommandTest.java
test_class.identifier: GeometryAreaCommandTest
test_case.body: @Test
  	public void areaTestCrs() throws GeomajasException {
  		GeometryAreaRequest request = new GeometryAreaRequest();
  		request.setGeometries(geometries);
  		request.setGeometries(geometries);
  		request.setCrs("EPSG:4326");
  		GeometryAreaResponse response = (GeometryAreaResponse) dispatcher.execute(GeometryAreaRequest.COMMAND, request,
  				null, "en");
  		List<Double> areas = response.getAreas();
  		Assert.assertEquals(4, areas.size());
  		Assert.assertEquals(3.05094E11, areas.get(0), DELTA * 3.05094E11);
  		Assert.assertEquals(0, areas.get(1), DELTA);
  		Assert.assertEquals(0, areas.get(2), DELTA);
  		Assert.assertEquals(1.278E14, areas.get(3), DELTA * 1.278E14);
  	}
test_case.class_method_signature: GeometryAreaCommandTest.areaTestCrs()
test_case.full_signature: @Test public void areaTestCrs()
test_case.identifier: areaTestCrs
test_case.invocations: setGeometries setGeometries setCrs execute getAreas assertEquals size assertEquals get assertEquals get assertEquals get assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void areaTestCrs()
focal_class.declarator: EPSG_4326 = "EPSG:4326"
focal_class.modifier: private static final
focal_class.original_string: private static final String EPSG_4326 = "EPSG:4326";
focal_class.type: String
focal_class.var_name: EPSG_4326
focal_class.declarator: RADIUS = 6378137
focal_class.modifier: private static final
focal_class.original_string: private static final double RADIUS = 6378137;
focal_class.type: double
focal_class.var_name: RADIUS
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/GeometryAreaCommand.java
focal_class.identifier: GeometryAreaCommand
focal_class.interfaces: implements CommandHasRequest<GeometryAreaRequest, GeometryAreaResponse>
focal_class.class_method_signature: GeometryAreaCommand.getEmptyCommandRequest()
focal_class.full_signature: @Override public GeometryAreaRequest getEmptyCommandRequest()
focal_class.identifier: getEmptyCommandRequest
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: GeometryAreaRequest
focal_class.signature: GeometryAreaRequest getEmptyCommandRequest()
focal_class.class_method_signature: GeometryAreaCommand.getEmptyCommandResponse()
focal_class.full_signature: @Override public GeometryAreaResponse getEmptyCommandResponse()
focal_class.identifier: getEmptyCommandResponse
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: GeometryAreaResponse
focal_class.signature: GeometryAreaResponse getEmptyCommandResponse()
focal_class.class_method_signature: GeometryAreaCommand.execute(GeometryAreaRequest request, GeometryAreaResponse response)
focal_class.full_signature: @Override public void execute(GeometryAreaRequest request, GeometryAreaResponse response)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (GeometryAreaRequest request, GeometryAreaResponse response)
focal_class.return: void
focal_class.signature: void execute(GeometryAreaRequest request, GeometryAreaResponse response)
focal_method.body: @Override
  	public void execute(GeometryAreaRequest request, GeometryAreaResponse response) throws Exception {
  		List<Double> areas = new ArrayList<Double>(request.getGeometries().size());
  		for (org.geomajas.geometry.Geometry g : request.getGeometries()) {
  			Geometry geometry = converter.toInternal(g);
  			double area = 0;
  			if (geometry instanceof Polygonal) {
  				if (request.getCrs() != null) {
  					if (!EPSG_4326.equals(request.getCrs())) {
  						geometry = geoService.transform(geometry, request.getCrs(), EPSG_4326);
  					}
  					// applying global sinusoidal projection (equal-area)
  					geometry.apply(new CoordinateFilter() {
  
  						public void filter(Coordinate coord) {
  							double newX = coord.x * Math.PI / 180.0 * Math.cos(coord.y * Math.PI / 180.0);
  							double newY = coord.y * Math.PI / 180.0;
  							coord.x = newX;
  							coord.y = newY;
  
  						}
  					});
  					area = geometry.getArea() * RADIUS * RADIUS;
  				} else {
  					area = geometry.getArea();
  				}
  			}
  			areas.add(area);
  		}
  		response.setAreas(areas);
  	}
focal_method.class_method_signature: GeometryAreaCommand.execute(GeometryAreaRequest request, GeometryAreaResponse response)
focal_method.full_signature: @Override public void execute(GeometryAreaRequest request, GeometryAreaResponse response)
focal_method.identifier: execute
focal_method.invocations: size getGeometries getGeometries toInternal getCrs equals getCrs transform getCrs apply cos getArea getArea add setAreas
focal_method.modifiers: @Override public
focal_method.parameters: (GeometryAreaRequest request, GeometryAreaResponse response)
focal_method.return: void
focal_method.signature: void execute(GeometryAreaRequest request, GeometryAreaResponse response)