Thanks for the code tips!  I'm sticking with EPSG:4326
because it's available on every WMS service I'm
interested in (at least so far) - it seemed an easy
shortcut to limit the calculation for now.  I
appreciate the more concise approach - thank you!

The code works fine in most cases but fails if I use
-180:-90 & 180:90.  Any ideas?

--- Martin Desruisseaux
<[EMAIL PROTECTED]> wrote:

> 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
> 


The only "dumb question" is the one you were too afraid to ask.
________________________________________
Check out RouteRuler - Free software for runners, cyclists, walkers, etc.
http://routeruler.sourceforge.net
________________________________________
Get a handle on your data with "pocOLAP", the "little" OLAP project
http://pocolap.sourceforge.net
________________________________________

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-------------------------------------------------------
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_id=7637&alloc_id=16865&op=click
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to