Sunburned Surveyor a écrit :
> - Right now my code uses doubles to represent lat and long values. I'd
> like to create a convenient wrapper class to represent a lat/long
> coordinate (possible with an elevation). I noted that GeoTools has a
> latitude and longitude classes:
> 
> http://javadoc.geotools.fr/2.5/org/geotools/measure/Latitude.html
> http://javadoc.geotools.fr/2.5/org/geotools/measure/Longitude.html
> 
> Is there a class GeoTools uses to represent a Lat/Long pair? If there
> isn't, what interface or class might I extend/implement to do so? I
> don't want to roll my own lat/long wrapper if I don't have to.

There is no class for a pair of (Latitude,Longitude) objects. The usual class
for this purpose is GeneralDirectPosition, which holds ordinates as an array of
double. If the coordinates are (latitude,longitude), each GeneralDirectPosition
have an array of length 2. The length could be greater if there is additional
dimensions (for example elevation or time).


> - I want to create some utility methods that work with lat/long
> coordinates on the ellipsoid. I only need a simple sphere, nothing
> fancier. I'm dealing with positional accuracies of several feet (if
> not tens of feet), so I'm not going to get exceited about the
> differences between a shpere and an ellipsoid at this point. I know
> that GeoTools offers the DefaultEllipsoid class:
> 
> http://javadoc.geotools.fr/2.5/org/geotools/referencing/datum/DefaultEllipsoid.html
> 
> Would there be objections to adding some methods to this class to
> perform the calculations I need, or should I whip up my own
> implementation of the Ellipsoid interface?


It depends, which methods would you like to add? Would some of them overlaps
with GeodeticCalculator?

http://javadoc.geotools.fr/2.5/org/geotools/referencing/GeodeticCalculator.html

        Martin

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to