I will definitely not recommend it then. Seems I got lucky in this case scenario.<div><br></div><div>Thanks.</div><div><br></div><div><br></div><div><br></div><div>Donovan<br><br><div class="gmail_quote">On Fri, Feb 3, 2012 at 3:19 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le vendredi 03 février 2012 22:59:36, Donovan Cameron a écrit :<br>
<div class="im">> FYI<br>
><br>
> Further testing with -overwrite given your explanation<br>
</div>> *ogr2ogr -overwrite output.shp output.shp -progress*<br>
<div class="im">> ...works as well but only if the files are in the same output directory<br>
<br>
</div>Overwriting the source file with itself is definitely not supported. Do at your<br>
own risk ! The DBF error isn't surprising in that context.<br>
<div class="im"><br>
><br>
> But it does report a dbf error:<br>
</div>> *ERROR 1: fread(631) failed on DBF file.*<br>
<div class="HOEnZb"><div class="h5">><br>
> But I can still open the output for appending and view the results in a GIS<br>
> viewer like QGIS.<br>
><br>
> Though the -where or -fid trick works as well<br>
><br>
> On Wed, Feb 1, 2012 at 2:38 PM, Even Rouault<br>
><br>
> <<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>>wrote:<br>
> > Le mercredi 01 février 2012 22:22:42, Donovan Cameron a écrit :<br>
> > > Afternoon List.<br>
> > ><br>
> > > I am trying to generate an empty feature (shp or gml) from a template<br>
> ><br>
> > that<br>
> ><br>
> > > retains both the attribute-table schema and map projection.<br>
> > ><br>
> > > I can't get the *-overwrite *flag to work, it just copies the entire<br>
> > > feature (ie, makes a duplicate):<br>
> > > *ogr2ogr -overwrite -f "GML" geoname.gml /vsizip/vsicurl/<br>
> > > ${inZIP}/${inGML}* *<br>
> > > *<br>
> > > The next commands <<a href="http://gis.stackexchange.com/a/16510/1297" target="_blank">http://gis.stackexchange.com/a/16510/1297</a>>[1] work<br>
> ><br>
> > using<br>
> ><br>
> > > *-where *or *-fid*:<br>
> > > *ogr2ogr -f "GML" geoname.gml /vsizip/vsicurl/ ${inZIP}/${inGML} -where<br>
> > > "FID < 0"*<br>
> > > *ogr2ogr -f "GML" geoname.gml /vsizip/vsicurl/ ${inZIP}/${inGML} -fid<br>
> > > "< 0"*<br>
> > ><br>
> > > I thought the* -overwrite* flag would delete the output layer and<br>
> ><br>
> > recreate<br>
> ><br>
> > > it empty <<a href="http://www.gdal.org/ogr2ogr.html" target="_blank">http://www.gdal.org/ogr2ogr.html</a>>[2]?<br>
> ><br>
> > -overwrite deletes the output layer, so that the new features added by<br>
> > ogr2ogr<br>
> > aren't added to the previously existing one, but in no way it creates an<br>
> > empty<br>
> > layer.<br>
> ><br>
> > The -where "fid < 0" trick is actually an interesting one. I've no better<br>
> > suggestion.<br>
</div></div></blockquote></div><br></div>