Tom,<br><br>The -skipfailures flag skips only failures to create new features. Null geometries in non-null shapetype shapefile are not handled.<br>The only way I can think of to clean such a file is by checking the geometry in each feature.<br>
<br><div class="gmail_quote">On Thu, Aug 5, 2010 at 1:01 AM, Tom Jeffery <span dir="ltr">&lt;<a href="mailto:tjeffery@gmail.com">tjeffery@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Chaitanya,<br>
<br>
I&#39;ve found the issue with the particular shapefile I&#39;m using.  It actually<br>
has some null geometries in it, which are fixable using ESRI&#39;s &quot;Repair<br>
Geometry&quot; tool.  I read that ogr2ogr is also suppose to remove records with<br>
empty geometries, but it doesn&#39;t seem to be working on my file, even with<br>
the -skipfailures flag set.<br>
<br>
Any thoughts?  Or is there another good way to clean a shapefile that might<br>
have null geometries?<br>
<br>
Thanks so much for your help so far!<br>
<div><div></div><div class="h5"><br>
-Tom<br>
<br>
<br>
Chaitanya kumar CH wrote:<br>
&gt;<br>
&gt; Tom,<br>
&gt;<br>
&gt; GDAL/OGR updates the shapefile along with the dbf file when a feature is<br>
&gt; changed. That means updating the extents according to the geometries in<br>
&gt; the<br>
&gt; changed features. My guess is that there is a problem reading a feature&#39;s<br>
&gt; geometry extents.<br>
&gt;<br>
&gt; Call the OGRGeometry::getEnvelope method on each geometry and check if the<br>
&gt; OGREnvelope::MinX and OGREnvelope::MinY values are within the expected<br>
&gt; extents. You can isolate the problem this way.<br>
&gt;<br>
&gt; Otherwise, put together a sample dataset and create a new ticket at<br>
&gt; <a href="http://trac.osgeo.org/gdal/newticket" target="_blank">http://trac.osgeo.org/gdal/newticket</a><br>
&gt;<br>
&gt; On Wed, Aug 4, 2010 at 10:00 PM, Tom Jeffery &lt;<a href="mailto:tjeffery@gmail.com">tjeffery@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Chaitanya,<br>
&gt;&gt;<br>
&gt;&gt; The updated file is read properly with ogrinfo.  The only difference<br>
&gt;&gt; between<br>
&gt;&gt; ogrinfo -al between the two, besides the new field that was created, is<br>
&gt;&gt; the<br>
&gt;&gt; extent, which looks like this:<br>
&gt;&gt;<br>
&gt;&gt; Original file:<br>
&gt;&gt; Extent: (1528126.013001, 45899.818172) - (1542444.478012, 61468.662925)<br>
&gt;&gt;<br>
&gt;&gt; Updated file:<br>
&gt;&gt;<br>
&gt;&gt; (-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000,<br>

&gt;&gt;<br>
&gt;&gt; -179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000)<br>

&gt;&gt; - (1542444.478012, 61468.662925)<br>
&gt;&gt;<br>
&gt;&gt; That...is a really large negative number!  Any idea why it might be<br>
&gt;&gt; getting<br>
&gt;&gt; blown up?<br>
&gt;&gt; -Tom<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Chaitanya kumar CH wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Tom,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Can you check the destination shapefile with &#39;ogrinfo&#39; and see if it<br>
&gt;&gt; &gt; works?<br>
&gt;&gt; &gt; If ogrinfo gives a valid output of the new file, check with &#39;ogrinfo<br>
&gt;&gt; -al&#39;<br>
&gt;&gt; &gt; and compare it with the old file&#39;s output.<br>
&gt;&gt; &gt; ( <a href="http://www.gdal.org/ogrinfo.html" target="_blank">http://www.gdal.org/ogrinfo.html</a> )<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; Best regards,<br>
&gt;&gt; &gt; Chaitanya kumar CH.<br>
&gt;&gt; &gt; /tʃaɪθənjə/ /kʊmɑr/<br>
&gt;&gt; &gt; +91-9494447584<br>
&gt;&gt; &gt; 17.2416N 80.1426E<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; gdal-dev mailing list<br>
&gt;&gt; &gt; <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
&gt;&gt; &gt; <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://osgeo-org.1803224.n2.nabble.com/gdal-dev-Editing-attributes-with-ogr-causing-corrupt-shapefile-tp5372483p5373236.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/gdal-dev-Editing-attributes-with-ogr-causing-corrupt-shapefile-tp5372483p5373236.html</a><br>

&gt;&gt; Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; gdal-dev mailing list<br>
&gt;&gt; <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
&gt;&gt; <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Best regards,<br>
&gt; Chaitanya kumar CH.<br>
&gt; /tʃaɪθənjə/ /kʊmɑr/<br>
&gt; +91-9494447584<br>
&gt; 17.2416N 80.1426E<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; gdal-dev mailing list<br>
&gt; <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
&gt;<br>
<br>
--<br>
</div></div>View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/gdal-dev-Editing-attributes-with-ogr-causing-corrupt-shapefile-tp5372483p5373963.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/gdal-dev-Editing-attributes-with-ogr-causing-corrupt-shapefile-tp5372483p5373963.html</a><br>

<div><div></div><div class="h5">Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>/tʃaɪθənjə/ /kʊmɑr/ <br>+91-9494447584<br>17.2416N 80.1426E<br>