[Gdal-dev] LinearRing and GetGeometryType

Frank Warmerdam warmerdam at pobox.com
Wed Feb 8 22:20:46 EST 2006


On 2/8/06, Didrik Pinte <dpinte at itae.be> wrote:
> Hi,
>
> I'm using the Python interface to OGR, but the problem will be
> encountered in all the languages
>
> As a subclass of OGRLineString, when calling geometry.GetGeometryType()
> on a OGRLinearRing object, it returns ogr.wkbLineString type and not an
> ogr.wkbLinearRing type.
>
> It this behaviour normal ? or should it be modified ?
>
> What should be the best fix for this problem ?
>
> [1] implement GetGeometryType in OGRLinearString ?
> [2] if the current behaviour is the right way to do it, just fix it in
> my ogr.py file redefining the GetGeometryType for the LinearRing
> objects ?

Didrik,

The OGRLinearRing used to return wkbLinearRing (a
nonstandard made up code of mine) but I removed
it again a while ago.  I'm not really sure why.  If you
want to distinguish linear rings from line strings you
can check the geometry name (call GetGeometryName()).

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 Programmer for Rent




More information about the Gdal-dev mailing list