-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
QgsFeatureSource not synchronised with QgsVectorLayer for memory provider #58113
Comments
The short answer is that it's not supposed to work. As soon as you make a feature source it's independent from the layer and won't pick up changes to the layer. The only reason it works for the other formats is because there's the backend storage getting altered and the modification are being done outside of the whole QgsVectorLayer world. The API is designed to require you to make the feature source after changing the layer. |
Geometry checker does not work with memory layers, so we change how the cache in the QgsFeaturePool object is managed, to refresh it more often.
Thanks @nyalldawson for this explanation. |
Here is a video illustrating the problem, that the geometry checker plugin does not work properly with memory layers (and thus blocking me from continuing qgis/QGIS-Enhancement-Proposals#236): Delete small angle vertices, on a GPKG layer (OK) VS a memory layerMemory layer: only one vertex removed, the original geometry is always taken on each vertex deletion iteration GPKG layer: all the vertices are removed, the iteration on the geometry is correct geometry_checker_memory_layer-2024-07-16_10.07.09.mp4 |
Geometry checker does not work with memory layers, so we change how the cache in the QgsFeaturePool object is managed, to refresh it more often.
Geometry checker does not work with memory layers. We change how QgsFeaturePool class works with memory layers to avoid creating a "double-cached" system, as memory layers are already a cache layer by construction.
Geometry checker does not work with memory layers. We change how QgsFeaturePool class works with memory layers to avoid creating a "double-cached" system, as memory layers are already a cache layer by construction.
Geometry checker does not work with memory layers. We change how QgsFeaturePool class works with memory layers to avoid creating a "double-cached" system, as memory layers are already a cache layer by construction.
Geometry checker does not work properly with memory layers. We change how QgsFeaturePool class works with memory layers to avoid creating a "double-cached" system, as memory layers are already a cache layer by construction.
Geometry checker does not work properly with memory layers. We change how QgsFeaturePool class works with memory layers to avoid creating a "double-cached" system, as memory layers are already a cache layer by construction.
Geometry checker cache does not work properly with memory layers. refreshCache now directly adds the geometry in the feature pool cache.
Geometry checker cache does not work properly with memory layers. refreshCache now directly adds the geometry in the feature pool cache.
Geometry checker cache does not work properly with memory layers. refreshCache now directly adds the geometry in the feature pool cache.
Geometry checker cache does not work properly with memory layers. refreshCache now handles a list of updated features to be thread-safe. Also, fixes a locker mode, and correctly remove features from spatial index.
Geometry checker cache does not work properly with memory layers. refreshCache now handles a list of updated features to be thread-safe. Also, fixes a locker mode, and correctly remove features from spatial index.
What is the bug or the crash?
While (still) working on qgis/QGIS-Enhancement-Proposals#236 (porting the geometry checker to the processing toolbox), I stumbled across an incredibly specific bug, which took me days to understand that it was a bug, and days to try to find it...
I need help understanding the bug, and fixing it.
Trying to explain it simply: there is a difference when working with temporary layers VS working with other providers (GPKG in this example).
Steps to reproduce the issue
The simple test with memory layer:
The test with memory and GPKG layer showing that GPKG does not fail whereas memory does:
The CPP test:
Versions
master and LTR 3.34.8
Supported QGIS version
New profile
Additional context
Any help is welcome, I need to know if it's supposed to work as it works with memory or ogr provider, and advices on how to fix it, or point code locations...
Thank you.
The text was updated successfully, but these errors were encountered: