Skip to content

feat: only offline the subset that matches all layer's filters#138

Merged
suricactus merged 1 commit intomasterfrom
QF-7981-minioffliner_apply_filters
Mar 3, 2026
Merged

feat: only offline the subset that matches all layer's filters#138
suricactus merged 1 commit intomasterfrom
QF-7981-minioffliner_apply_filters

Conversation

@suricactus
Copy link
Collaborator

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.

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.
@duke-nyuki
Copy link

@@ -439,6 +440,9 @@ def _convert_to_offline_project(
layer_bbox = tr.transform(bbox)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😆

Copy link
Collaborator Author

@suricactus suricactus Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #139

@suricactus suricactus merged commit 5eee86b into master Mar 3, 2026
7 checks passed
@suricactus suricactus deleted the QF-7981-minioffliner_apply_filters branch March 3, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants