[gdal-dev] OGR distance different than in ArcGIS

Frank Warmerdam warmerdam at pobox.com
Wed Mar 6 16:17:13 PST 2013


On Wed, Mar 6, 2013 at 3:59 PM, Uli Strötz <ustroetz at gmail.com> wrote:

> Hi Frank,
>
> The distance is according to ArcGIS 500m. According to Python(OGR)
> 29215.31. I was thinking the same, that GDAL gives the distance according
> to the Geographic Coordinate System. Is there a way it uses the units of
> the Projected Coordinate System (which would be meters)? Or do you know of
> another workaround to get the result in meters?
>

Uli,

A lot depends on the precision you need.  Options include:

1) Compute normally and multiply by a fixed degrees to meters value to get
an approximate distance in meters.  A WGS degree is approximately 111111
meters.

2) Transform everything to an appropriate projected coordinate system, and
do the distance there.

3) Somehow find the nearest point on the line to the point (I don't see how
to do that with ogr.Geometry) and then use a great circle calculator like
the PROJ.4 geod command.

4) Do this in PostGIS using the "geography" type instead of "geometry".
 This is supposed to allow metric operations on spherical geometry.  I have
no direct experience though.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130306/73736018/attachment.html>


More information about the gdal-dev mailing list