[gdal-dev] more than one linearring object in the geometry but with all linerring objects having zero points?

Chao YUE chaoyuejoy at gmail.com
Thu Mar 28 09:58:15 PDT 2013


Dear all,

I try to read fire polygon shapefile by ogr (beginner level), I referred to
some sources online:
http://geoinformaticstutorial.blogspot.fr/2012/10/accessing-vertices-from-polygon-with.html
http://gis.stackexchange.com/questions/8144/get-all-vertices-of-a-polygon-using-ogr-and-python

However, both the links are incomplete as I have polygons who have more
than one linearring objects, which
fianally turns out to have hole inside the polygon.

But I have another strange issue, is that there are some polygons with more
than one linearring object,
but all the rings have zero points. However, the fire size of the polygon
is not zero, and when I checked
the same polygon in ArcGIS, there is really a shape! could anyone point out
I miss something?
thanks!!

In [28]:

feature = layer.GetFeature(276)

geo = feature.GetGeometryRef()

geo.GetGeometryCount()

Out[28]:

2

In [29]:

ring = geo.GetGeometryRef(0)

ring.GetPointCount()

Out[29]:

0

In [31]:

ring = geo.GetGeometryRef(1)

ring.GetPointCount()

Out[31]:

0

In [34]:

feature.items()['SIZE_HA']

Out[34]:

13041.187


Chao
-- 
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130328/41e86258/attachment-0001.html>


More information about the gdal-dev mailing list