[gdal-dev] OGR - GetLength in Python

Ari Jolma ari.jolma at gmail.com
Fri Nov 19 01:13:30 EST 2010


On 11/18/2010 03:52 PM, Ludovic Granjon wrote:
> Hi all
>
> I try to calculate the length of a linestring in python.
> But is there a way in python with ogr to calculate this. I see there's 
> a GetLength()  in the OGRLineString Class Reference 
> http://www.gdal.org/ogr/classOGRLineString.html#7b3dc3abefd16aea17ac9fcc0ccd0010 
> , but I don't see if there's the same thing in python ?

There's Length() method in the bindings for the Geometry class. It's a 
simple interface to OGR_G_Length(), which calls get_Length(), which 
computes the length using simple euclidian 2D length for line strings 
and rings.

Ari

>
> Thanks
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20101119/89411cf1/attachment.html


More information about the gdal-dev mailing list