<div dir="ltr">Hi,<div>Out of interest, I tried the tack of converting to shapefile with a .dbf only containing the primary index OGC_FID.</div><div>This might provide an alternative for indexed access to the geometry. I see it isn't needed anymore, but anyway, </div><div>for info and comparison:</div><div>What worked:</div><div>- shapefile record count 25201411 agrees with sqlite table.</div><div>- shapefile size (.shp): 672 MB (recordcount * 28 + 100).</div><div>- shapefile index (.sbn): 194 MB. That's quite a bit more compact than the spatialite index?</div><div>- apparently immediate response when zooming in or inquiring by clicking (did not measure response time accurately)</div><div>What went wrong:</div><div>- could not select the primary index for conversion using ogr2ogr ... -select OGC_FID ...</div><div>- Got incomplete conversion when using spatialite_gui with spatiaLite version 4.3.0.a, conversion to DBF.<br></div><div> recordcount of the conversion: 19927604</div><div><br></div><div>This using OSGEOW prompt of Qgis 2.18.0 (with GDAL 2.1.1, released 2016/07/07), on a windows 7 machine.</div><div><br></div><div>Perhaps worthwhile to use the (no-index.sqlite) dataset to look into the conversion.</div><div><div>Error trying to convert to shapefile with OGC_FID:<br></div></div><div><div>F:\>ogr2ogr -f "ESRI Shapefile" -nlt POINT -select OGC_FID test.shp j:/downloads/no-index.sqlite</div><div>ERROR 1: Field 'OGC_FID' not found in source layer.</div><div>ERROR 1: Terminating translation prematurely after failed</div><div>translation of layer osmi_addresses_nodes_with_addresses (use -skipfailures to skip errors)</div></div><div><br></div><div>Is the OGC_FID primary index identical to a shapefile FID, that is, not in the table, but really a counter?</div><div>So, I'm not sure I can properly link points to the sqlite data, but otherwise it looks doable.</div><div>Jan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 6, 2017 at 2:30 PM, Frederik Ramm <span dir="ltr"><<a href="mailto:frederik@remote.org" target="_blank">frederik@remote.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
while what I wrote in the previous post is still interesting and a<br>
bit strange, I have meanwhile upgraded to GDAL 2 packages from the<br>
ubuntugis-unstable repository for Xenial, and now the behaviour is as I<br>
would expect it: The ogr2ogr -spat command *with* indexes takes<br>
practically no time (0.05 seconds), and the -spat command *without*<br>
index takes about 40 seconds as before.<br>
<br>
Sorry for the noise then.<br>
<div class="HOEnZb"><div class="h5"><br>
Bye<br>
Frederik<br>
<br>
--<br>
Frederik Ramm ## eMail <a href="mailto:frederik@remote.org">frederik@remote.org</a> ## N49°00'09" E008°23'33"<br>
______________________________<wbr>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/gdal-dev</a></div></div></blockquote></div><br></div>