Issue Type: Bug Bug
Affects Versions: 10.1
Assignee: Andrea Aime
Attachments: 100kmaroundzurich.png, GeodeticCalculatorTest.java
Components: referencing
Created: 25/Oct/13 8:09 AM
Description:

When trying to calculate a new Geographic point based on a given one, an azimut and a distance using GeodeticCalculator, the results are only correct, when calculating a point on azimut +/-90 (north/south-axis). For all other directions, an error is introduced that increases while moving towards the east/west-axis. The attached image shows the results generated by GeodeticCalculator for points in steps by 5 degrees with a distance of 100000 meters (100km) around Zurich.

At first, I thought it is a projection problem, but changing the CRS did not change the wrong results. I have checked the results with the distance calculator of wolframalpha.

Exemplary wrong result (like in code below):
Startpoint Coordinates: 47.38,8.54
Azimut: 0 Distance: 100000
Endpoint Coordinates: 47.38,9.444147459825976
Distance between coordinates: ~68.28km, not 100.
GeodeticCalculator.getOrthodromicDistance() returns 100000.0 for the same coordinates.

Here some test code which returns a wrong coordinate (attached as well):

//Zurich, Switzerland coordinates
Point2D startPoint = new Point2D.Double(47.38, 8.54);

//Calculate a point 100 km to the east of Zurich
GeodeticCalculator calc = new GeodeticCalculator();
//GeodeticCalculator calc = new GeodeticCalculator(CRS.decode("EPSG:3785"));
//GeodeticCalculator calc = new GeodeticCalculator(CRS.decode("EPSG:4326"));
calc.setStartingGeographicPoint(startPoint);
calc.setDirection(0, 100000);
Point2D endPoint = calc.getDestinationGeographicPoint();

System.out.println("Startpoint Coordinates: " + startPoint.getX() + "," + startPoint.getY());
System.out.println("Endpoint Coordinates: " + endPoint.getX() + "," + endPoint.getY());

Environment: Windows 8.1, Java 64bit 1.7.0_45b18
Project: GeoTools
Priority: Major Major
Reporter: Juri Buchmüller
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to