feat: only offline the subset that matches all layer's filters#138
feat: only offline the subset that matches all layer's filters#138suricactus merged 1 commit intomasterfrom
Conversation
If a project has layer1 and layer2 that have the same data source, but different applied filters, download only the features that match either layer1 or layer2 filter and not all the features from the datasource.
| @@ -439,6 +440,9 @@ def _convert_to_offline_project( | |||
| layer_bbox = tr.transform(bbox) | |||
There was a problem hiding this comment.
Not related to the change in this PR, but since I see it now and it's an important one, I shall speak ;)
You should wrap this transform around a try / except. If the transform fails, QGIS throws a QgsCsException. Without catching that, I suspect here what will happen is that we'll either silently fail or the whole offline will fail due to a parent try / except.
If we catch it here, it'll allow us to decide whether we want to a/ stop the export and provide clear guidance on how to resolve failure (i.e., fix your extent), b/ offline the whole layer without being filtered by a bounding box, or c/ offline the layer with zero feature in it.
I'm leaning towards option b or c, and I can think of multiple reasons why either are good 😆
If a project has layer1 and layer2 that have the same data source, but different applied filters, download only the features that match either layer1 or layer2 filter and not all the features from the datasource.