[gdal-dev] ogr2ogr intersect very slow at command line with large sqlite input
jratike80
jukka.rahkonen at maanmittauslaitos.fi
Mon Apr 10 08:20:09 PDT 2017
CTL101 wrote
> 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)"
Hi,
It looks good to me but I know only the basics. If you are not happy with
the speed write to Spatialite forum
https://groups.google.com/forum/#!forum/spatialite-users. Processing with
Spatialite is not always extremely fast and ST_Intersection may be the heavy
part.
-Jukka Rahkonen-
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/ogr2ogr-intersect-very-slow-at-command-line-with-large-sqlite-input-tp5316545p5316681.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
More information about the gdal-dev
mailing list