FYI<div><br></div><div>Further testing with -overwrite given your explanation<div><div><b>ogr2ogr -overwrite output.shp output.shp -progress</b></div><div>...works as well but only if the files are in the same output directory</div>
<div><br></div><div>But it does report a dbf error:</div><div><b>ERROR 1: fread(631) failed on DBF file.</b></div><div><br>But I can still open the output for appending and view the results in a GIS viewer like QGIS.</div>
<div><br></div><div>Though the -where or -fid trick works as well</div><div><br><div class="gmail_quote">On Wed, Feb 1, 2012 at 2:38 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 mercredi 01 février 2012 22:22:42, Donovan Cameron a écrit :<br>
<div class="im">> Afternoon List.<br>
><br>
> I am trying to generate an empty feature (shp or gml) from a template that<br>
> retains both the attribute-table schema and map projection.<br>
><br>
</div>> I can't get the *-overwrite *flag to work, it just copies the entire<br>
<div class="im">> feature (ie, makes a duplicate):<br>
</div>> *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 using<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 recreate<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 ogr2ogr<br>
aren't added to the previously existing one, but in no way it creates an empty<br>
layer.<br>
<br>
The -where "fid < 0" trick is actually an interesting one. I've no better<br>
suggestion.<br>
</blockquote></div><br></div></div></div>