Tuesday, 25 June 2019

Does QGIS automatically use spatialite spatial indexes?


When you write a query in spatialite you have to manually join your query to the spatial index for that index to be used to speed up the query. When QGIS displays data does it take advantage of any spatial indexes as you pan and zoom around your data?




Answer



Yes. It does as it appears from looking at the source code for the Spatialite Data Provider.


The QgsSpatiaLiteFeatureIterator class is the one that supplies the features to the map upon sending a rectangle extent. You can just search for 'spatialIndex' in that class to see they actually use the index if available.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...