[gdal-dev] ogr2ogr intersect very slow at command line with large sqlite input

CTL101 chrislloyd2 at yahoo.co.uk
Mon Apr 10 07:29:18 PDT 2017

Hi Jukka, Thanks for your advice and the useful link. I have done as you
suggested and put together a revised query and tested in on a sample. This
worked successfully and significantly more quickly. I will now test on the
full dataset. The following is my command as it stands. Is this what you
envisaged and do you have any further tips to optimise? Regards, Chris

ogr2ogr -gt 65536 -nlt PROMOTE_TO_MULTI25D --config OGR_SQLITE_CACHE 20480
-f SQLite -dsco SPATIALITE=YES output.sqlite input.sqlite -nln outputtable
-dialect sqlite -sql "SELECT ST_Intersection(A.geometry, B.geometry) AS
geometry, A.acolumnname, B.acolumnname FROM inputtable1 A, inputtable2 B
WHERE ST_Intersects(A.geometry, B.geometry) AND A.ogc_fid IN (SELECT
A.ogc_fid FROM SpatialIndex WHERE f_table_name = 'inputtable1' AND
search_frame = B.geometry)"

View this message in context: http://osgeo-org.1560.x6.nabble.com/ogr2ogr-intersect-very-slow-at-command-line-with-large-sqlite-input-tp5316545p5316670.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.

More information about the gdal-dev mailing list