<div dir="ltr"><div>Here is my example:</div><div>ogr2ogr -overwrite -f AmigoCloud "AmigoCloud:15276 datasets=100056" ~/Downloads/Visits.geojson<br></div><div><br></div><div>I am trying to append, or overwrite data into existing dataset id:100056. But it still created a new dataset, and it did not delete/clean old dataset. I am thinking I need to do something in my OGRAmigoCloudDataSource::ICreateLayer(). I am not checking if dataset exist. I always create a new one. </div><div><br></div><div>How should I handle this case?</div><div><br></div></div><div class="gmail_extra"><br clear="all"><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 Tue, Nov 28, 2017 at 3:30 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 mardi 28 novembre 2017 15:20:20 CET Victor Chernetsky wrote:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Hi 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">> Then in my driver, how do I know if I have to append data to existing</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> dataset, </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> or overwrite existing data, or create a new dataset all together?</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">That should work automagically if you correctly implement the semantics of the </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">relevant dataset and layer virtual methods</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">If the user doesn't specify -append or -overwrite, but just -update, and the layer doesn't exist, then ogr2ogr will call GDALDataset::ICreateLayer()</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">> What about -overwrite option?</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">If the user specify -overwrite, then ogr2ogr will call GDALDataset::DeleteLayer(), and then ICreateLayer()</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">Looking quickly at the amigocloud driver, everything looks in place already.</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">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">-- </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>