Hi Frank, thanks for pointing out the MultiPolygon, Indeed you're right.
While when I print the geometry, I get all the underlying vertices data. feature = layer.GetFeature(408) georef = feature.GetGeometryRef() georef.GetGeometryName() 'MULTIPOLYGON' when I print georef, I get a big list of data which are the vertices I guess. thanks again, Chao On Thu, Mar 28, 2013 at 7:06 PM, Frank Warmerdam <warmer...@pobox.com>wrote: > Chao, > > I suspect you have a multipolygon. So each subgeometry is a polygon > on which there are in turn subgeometries which are rings. > > By the way, if you just print the geometry in python you should get > the "Well Known Text" representation which can be explanatory. > > Best regards, > Frank > > > > On Thu, Mar 28, 2013 at 9:58 AM, Chao YUE <chaoyue...@gmail.com> wrote: > > 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 > > > ************************************************************************************ > > > > _______________________________________________ > > gdal-dev mailing list > > gdal-dev@lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/gdal-dev > > > > -- > > ---------------------------------------+-------------------------------------- > I set the clouds in motion - turn up | Frank Warmerdam, > warmer...@pobox.com > light and sound - activate the windows | http://pobox.com/~warmerdam > and watch the world go round - Rush | Geospatial Software Developer > -- *********************************************************************************** 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 ************************************************************************************
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev