[gdal-dev] OGRGeometry Distance

Even Rouault even.rouault at mines-paris.org
Mon Sep 21 14:37:51 EDT 2009


Selon Christopher Barker <Chris.Barker at noaa.gov>:

I'd note that in the OGR XPlane driver, a function is available to compute the
distance on the spheroid. You could use it if you don't need much accuracy :
http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/xplane/ogr_xplane_geo_utils.cpp

(It's an internal function to OGR, so you'd have to copy&paste it in your code,
or add a CPL_DLL decoration in the corresponding .h and rebuild GDAL)

> Yilmaz Arslanoglu wrote:
> > I wanted to compute the distance between two points,
>
> you need to be clear by what you mean here: I suspect you mean:
>
> "The shortest distance between two points following the surface of the
> earth"
>
> In which case, what you are looking for is referred to as the geodesic
> distance:
>
> http://www.vterrain.org/Misc/distance.html
>
> To do this accurately (and you may not need much accuracy!) on an
> ellipsoid requires a fair bit of math. I don't know if it's built in to
> OGR or PROJ at this point, but there are a few libraries out that that
> do it, including Gerald I. Evenden's "geodesic" lib, which can be found
> here:
>
> http://home.comcast.net/~gevenden56/geodesy/project/
>
> -Chris
>
>
>
> --
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R            (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception
>
> Chris.Barker at noaa.gov
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>




More information about the gdal-dev mailing list