[Proj] C API to calculate distances
Oliver Eichler
oliver.eichler at dspsolutions.de
Mon Jan 22 11:51:07 EST 2007
Gerald I. Evenden wrote:
> On Monday 22 January 2007 6:14 am, Oliver Eichler wrote:
>> Hi,
>>
>> I wonder if there is a C API to calculate the real great circle distance
>> of two points on a WGS84 ellipsoid. I know there is "geod" on the
>> command line. I had a look at it's source code however this looked quite
>> complicated. As this must be a standard problem isn't there something like;
>>
>> distance(p1,p1, d, dir)
>>
>> p1: point 1
>> p2: point 2
>> d: distance
>> dir: direction in degrees
>
> For the "inverse" problem: input is geographic coordinates for each point
> along with all the ellipsoid parameters: equitorial radius and one of the
> ellipsoid parameters (eccentricity, flattening, etc.).
>
> Return value is distance and the azimuths at each of the points.
Yeah, that's what I need. I guess my pseudo code was misleading. Does
proj4 implement such an API? Or do I have to make my own C function of
Vincenty’s formula as described at
'http://www.movable-type.co.uk/scripts/LatLongVincenty.html' ?
Oliver
>
> An alternative is the FORTRAN procedures available from NGS but they require
> the same arguments and return the same (slightly more accurate) results.
>
> It is unlikely that any general library would supply a procedure just
> configured for one ellipsoid.
More information about the Proj
mailing list