java - jscience: how can I calculate the distance between two LatLong?
I need to calculate the distance (meters, kmts, whatever) between two Latitude/Longitude positions? I found jscience which I guess is able to do it but I don't know the API.
Could anybody point me to one example?
I googled and clicked on the first link.
Seems like the "Haversine" formula is an easy solution.
A quick look at the jscience API doesn't reveal any method of calculating distance, but it may be buried in there somewhere.
I've used the jcoord library before now which has a nice and simple interface, e.g.
A more complete set of libraries comes from the GeoTools project, where they use a library by the name of JTS. See http://docs.geotools.org/latest/user...y/api/jts.html for an example of calculating distance with these libraries.
In the end, it may be just as easy to implement the Haversine formula yourself, depending on how accurate you need things to be, the coordinate reference systems being used, where on the Earth you want it to work, etc.
but are you using a GIS program ?
my self i use ISIS3
is this on a "perfect" sphere?
or on the Earth's aeroid
or say the Real distance say from new york to Detroit using the Earth's DEM
|All times are GMT -5. The time now is 06:50 PM.|