<div dir="ltr"><div><div>Hi Frank,<br><br></div>thanks for pointing out the MultiPolygon, Indeed you're right.<br><br></div>While when I print the geometry, I get all the underlying vertices data.<br><br>feature = layer.GetFeature(408)<br>
georef = feature.GetGeometryRef()<br>georef.GetGeometryName()<br><pre>'MULTIPOLYGON'<br><br></pre><div class="gmail_extra">when I print georef, I get a big list of data which are the vertices I guess.<br></div><div class="gmail_extra">
<br></div><div class="gmail_extra">thanks again,<br><br>Chao<br><br><div class="gmail_quote">On Thu, Mar 28, 2013 at 7:06 PM, Frank Warmerdam <span dir="ltr"><<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Chao,<br>
<br>
I suspect you have a multipolygon.  So each subgeometry is a polygon<br>
on which there are in turn subgeometries which are rings.<br>
<br>
By the way, if you just print the geometry in python you should get<br>
the "Well Known Text" representation which can be explanatory.<br>
<br>
Best regards,<br>
Frank<br>
<div><div class="h5"><br>
<br>
<br>
On Thu, Mar 28, 2013 at 9:58 AM, Chao YUE <<a href="mailto:chaoyuejoy@gmail.com">chaoyuejoy@gmail.com</a>> wrote:<br>
> Dear all,<br>
><br>
> I try to read fire polygon shapefile by ogr (beginner level), I referred to<br>
> some sources online:<br>
> <a href="http://geoinformaticstutorial.blogspot.fr/2012/10/accessing-vertices-from-polygon-with.html" target="_blank">http://geoinformaticstutorial.blogspot.fr/2012/10/accessing-vertices-from-polygon-with.html</a><br>

> <a href="http://gis.stackexchange.com/questions/8144/get-all-vertices-of-a-polygon-using-ogr-and-python" target="_blank">http://gis.stackexchange.com/questions/8144/get-all-vertices-of-a-polygon-using-ogr-and-python</a><br>

><br>
> However, both the links are incomplete as I have polygons who have more than<br>
> one linearring objects, which<br>
> fianally turns out to have hole inside the polygon.<br>
><br>
> But I have another strange issue, is that there are some polygons with more<br>
> than one linearring object,<br>
> but all the rings have zero points. However, the fire size of the polygon is<br>
> not zero, and when I checked<br>
> the same polygon in ArcGIS, there is really a shape! could anyone point out<br>
> I miss something?<br>
> thanks!!<br>
><br>
> In [28]:<br>
><br>
> feature = layer.GetFeature(276)<br>
><br>
> geo = feature.GetGeometryRef()<br>
><br>
> geo.GetGeometryCount()<br>
><br>
> Out[28]:<br>
><br>
> 2<br>
><br>
> In [29]:<br>
><br>
> ring = geo.GetGeometryRef(0)<br>
><br>
> ring.GetPointCount()<br>
><br>
> Out[29]:<br>
><br>
> 0<br>
><br>
> In [31]:<br>
><br>
> ring = geo.GetGeometryRef(1)<br>
><br>
> ring.GetPointCount()<br>
><br>
> Out[31]:<br>
><br>
> 0<br>
><br>
> In [34]:<br>
><br>
> feature.items()['SIZE_HA']<br>
><br>
> Out[34]:<br>
><br>
> 13041.187<br>
><br>
><br>
> Chao<br>
> --<br>
> ***********************************************************************************<br>
> Chao YUE<br>
> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)<br>
> UMR 1572 CEA-CNRS-UVSQ<br>
> Batiment 712 - Pe 119<br>
> 91191 GIF Sur YVETTE Cedex<br>
> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16<br>
> ************************************************************************************<br>
><br>
</div></div>> _______________________________________________<br>
> gdal-dev mailing list<br>
> <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<span class=""><font color="#888888"><br>
<br>
<br>
--<br>
---------------------------------------+--------------------------------------<br>
I set the clouds in motion - turn up   | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com">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>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div>***********************************************************************************</div>
<div>Chao YUE<br>Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)<br>UMR 1572 CEA-CNRS-UVSQ<br>Batiment 712 - Pe 119<br>91191 GIF Sur YVETTE Cedex</div>
<div>Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16<br></div>

<div>************************************************************************************</div>
</div></div>