-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling of missing spatial indexes in Processing #30530
Comments
One of the reason, spatial indexing is optional and somewhat hidden under layer properties, is due to the file/folder permission. Usually the index file sits with the file/geodatabase. If user has limited access/permission to the folder/schema, the index creation will throw up lots of errors. |
Great point, I did not consider that. I am sure that many typical work environments for QGIS rely on networked, read-only data. Highlighting the absence of a spatial index would still be useful then, the users would have to talk to their admins for (and hey, this would also reduce network traffic :) ). |
@rouault just told me that there is a layer capability attribute |
Provides warnings in Processing algorithms when running on layers which don't have a spatial index present (e.g. geojson files) and where performance will be severely hurt as a result Fixes qgis#30530
Provides warnings in Processing algorithms when running on layers which don't have a spatial index present (e.g. geojson files) and where performance will be severely hurt as a result Fixes #30530
Provides warnings in Processing algorithms when running on layers which don't have a spatial index present (e.g. geojson files) and where performance will be severely hurt as a result Fixes qgis#30530 (cherry picked from commit f20801a)
Feature description.
Many GIS algorithms heavily benefit from spatial indexes. If there is no spatial index, any operations that rely on spatial relationships between geometries will be unnecessarily slow.
For example a Count points in polygon comparison:
Processing should warn, like it nowadays does for CRS mismatches, if there is no spatial index for operations that would benefit from it.
Alternatively Processing could generate indexes internally but I don't know anything about how QGIS handles this for its internal layer structure. It would be a waste if an index was created every time an algorithm ran, maybe they could be stored in memory.
This could greatly benefit many users and lead to QGIS being faster in random comparisons magically.
Additional context.
I just realised, after years of QGIS usage, that QGIS does not write a spatial index when exporting shapefiles (see #30528). This means I wasted countless hours over the years waiting for algorithms to finish just because there was no spatial index being used. :o)
The text was updated successfully, but these errors were encountered: