todd runstein a écrit :
I'm using GeodeticCalculator to calculate the
difference between the "x"s and "y"s.  Unfortunately,
I'm not able to get it working.  Any assistance would
be appreciated.


GeographicCRS geoCRS = DefaultGeographicCRS.WGS84;
DefaultEllipsoid e = (DefaultEllipsoid) 
CRSUtilities.getHeadGeoEllipsoid(geoCRS);
GeodeticCalculator calc = new GeodeticCalculator(e);

Note 1: If you know that you want the WGS84 ellipsoid in all cases, you can just use the default constructor:

  GeodeticCalculator calc = new GeodeticCalculator();

Note 2: if you use one of latest Geotools snapshot (I'm not sure since which milestone), you can write:

  CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84;
  GeodeticCalculator calc = new GeodeticCalculator(crs);

where 'crs' doesn't need to be geographic; GeodeticCalculator will performs the needed transformations on the fly if you use 'setFooPosition' methods.

The code you sent seems correct. What are the coordinates values tested?

        Martin.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to