<div dir="ltr">Thanks, this worked! <div><br></div><div>I have a followup question: how does gdal/ogr2ogr knows that my destination dataset/layer exists?</div><div>For instance, -append option suppose to do different things if layer exists, or not. I don't see any isExists() APIs that would check it.<br></div><div><br></div><div>Thanks,</div><div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><b>Victor Chernetsky</b></div><div><b><br></b></div><div><div><b><img src="http://www.amigocloud.com/static/homepage/img/e-mail-signature.png" width="96" height="22"><br></b><div><font color="#000000">+1 </font><font color="#000000">(408) 368-4607</font></div><div><a href="mailto:victor@amigocloud.com" style="color:rgb(17,85,204)" target="_blank">victor@amigocloud.com</a><br></div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Nov 29, 2017 at 12:02 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div style="font-family:'Sans Serif';font-size:9pt;font-weight:400;font-style:normal"><span class="">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">On mercredi 29 novembre 2017 12:00:17 CET Victor Chernetsky wrote:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Hey Even,</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> How do I set OVERWRITE option?</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
</span><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">With -lco OVERWRITE=YES since this is a layer creation option</p><span class="">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> I tried all these:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> ogr2ogr -overwrite -f AmigoCloud "AmigoCloud:15276 datasets=100322"</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
</span><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">This will trigger the logic at</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><a href="https://github.com/OSGeo/gdal/blob/trunk/gdal/apps/ogr2ogr_lib.cpp#L3180" target="_blank">https://github.com/OSGeo/gdal/<wbr>blob/trunk/gdal/apps/ogr2ogr_<wbr>lib.cpp#L3180</a></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">that first try to see if a layer has the same name as the input layer name, and if so call DeleteLayer() on it</p><span class="">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">-- </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Spatialys - Geospatial professional services</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a></p></span></div></blockquote></div><br></div></div>