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

Stephen Woodbridge woodbri at swoodbridge.com
Sun Apr 9 10:34:38 PDT 2017


On 4/9/2017 11:38 AM, CTL101 wrote:
> Hi, I am attempting the following ogr2ogr sql intersect operation using gdal
> 2.1.3 at command line, and an input sqlite file that is 2.51GB in size. The
> program has been running for a few days and seems to be processing, but is
> very slow. The output file size is not incrementing as it does with small
> test excerpts of the file. Has the program crashed? And how might I improve
> performance? I have experimented with the -gt and --config cache options
> somewhat.
> 
> ogr2ogr -gt 65536 -nlt PROMOTE_TO_MULTI25D --config OGR_SQLITE_CACHE 20480
> -f SQLite -dsco SPATIALITE=YES output.sqlite input.sqlite -nln output
> -dialect sqlite -sql "SELECT ST_Intersection(A.geometry, B.geometry) AS
> geometry, A.name, B.name FROM inputtable1 A, inputtable2 B WHERE
> ST_Intersects(A.geometry, B.geometry)"
> 
> Any advice appreciated. Regards, Chris

Do you have spatial indexes on both tables?

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the gdal-dev mailing list