Speeding up a GDAL SQL query with indexes or different file formats

المشرف العام

Administrator
طاقم الإدارة
I have a query that I'm performing with python and OGR2OGR similar to this:

/opt/gdal-custom/bin/ogr2ogr -f CSV /vsistdout/ foo.shp -dialect sqlite -sql "SELECT A, MAX(D) AS D, B, C, AsGeoJSON(GEOMETRY) AS geojson FROM foo WHERE ST_Intersects(GeomFromText('POLYGON ((-94.1748 26.90248,-94.1748 27.60567,-93.07617 27.60567,-93.07617 26.90248,-94.1748 26.90248))', 4326), GEOMETRY) GROUP BY A, B, C" The real query takes about 1:07 minutes on a shapefile, and 20 seconds if I convert the shape file to sqlite. I need to get it faster. I can't get gdal to read the qix file. MBRIntersects() doesn't speed things up.

Is there a way I can use a index or another file format to speed things up?



أكثر...
 
أعلى