<br><br><div class="gmail_quote">On Wed, Mar 6, 2013 at 3:59 PM, Uli Strötz <span dir="ltr"><<a href="mailto:ustroetz@gmail.com" target="_blank">ustroetz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div>Hi Frank,<br><br><span>The distance is according to ArcGIS 500m. According to Python(OGR) 29215.31. </span>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?<br>
</div></div></div></blockquote><div><br></div><div>Uli,</div><div><br></div><div>A lot depends on the precision you need.  Options include:</div><div><br></div><div>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.</div>
<div><br></div><div>2) Transform everything to an appropriate projected coordinate system, and do the distance there.</div><div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>Best regards,</div></div>-- <br>---------------------------------------+--------------------------------------<br>I set the clouds in motion - turn up   | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a><br>
light and sound - activate the windows | <a href="http://pobox.com/~warmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>and watch the world go round - Rush    | Geospatial Software Developer<br>