Skip to content
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

Make "Filter by geometry type" alg also available via Processing Toolbox #49334

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

pathmapper
Copy link
Contributor

Description

Currently the very useful algorithm Filter by geometry type is not available via the Processing Toolbox but there are use cases for having it also there, e.g. splitting a WFS layer with mixed feature geometries into single layers.

Examples:

@github-actions github-actions bot added this to the 3.28.0 milestone Jul 12, 2022
@pathmapper
Copy link
Contributor Author

Test failure seems unrelated -> #48778 (comment)

@nyalldawson
Copy link
Collaborator

I must admit I'm a little confused by this 😄

QGIS doesn't really have support for mixed geometry type layers right now (ideally we would!), and all the sources which support mixed geometry types require you to manually select which geometry type you want for the layer when you load that source into a project.

How are you getting a mixed geometry type layer in the first place as a source for running the algorithm?

@pathmapper
Copy link
Contributor Author

pathmapper commented Jul 13, 2022

Oh, sorry that it's not clear from the PR description. The WFS used for the examples above is not under my control and has changed since then (currently no features for feature type: xplan:BP_AnpflanzungBindungErhaltung)

Short answer: from WFS sources

Long version:

There are WFS around which are serving feature types with mixed geometry types. If you load them with QGIS (via WFS connection), there's no dialogue which require you to manually select which geometry type you want for the layer. Instead one layer containing all available geometry types is added.

The type of the added layer is either one geometry type like point, linestring, polygon, ... (I guess this is determined by the geometry type of the first feature in the WFS response document) or QGIS sometimes adds a layer with the following "mixed geometry icon":

grafik

Here's a screencast demonstrating this (unfortunately this WFS is not publicly available, here the WFS response saved as file
wfs_response.zip ).

Please note that the type for the added layer is Point but it contains also lines and polygons. The lines and polygons are not rendered on the canvas but included in the attribute table and feature count.

If you execute the Filter by geometry type algorithm on it, you get this sorted out (last part of the screencast).

demonstration_mixed_wfs.mp4

Mixed geometry type layers from WFS source are currently a pain point in QGIS, here are two issues related to this:

The Filter by geometry type algorithm relieves this pain point a bit.

all the sources which support mixed geometry types require you to manually select which geometry type you want for the layer when you load that source into a project

According to this, it sounds like the missing selection dialog for WFS sources with mixed geometry types is a bug.

If you drag a file with the WFS response of the screencast sample wfs_response.zip into QGIS, it shows the following dialog:

grafik

Having such a dialog for layers with mixed geometries from WFS sources would be great and there would be no need anymore to work around with the Filter by geometry type algorithm.

@pathmapper
Copy link
Contributor Author

pathmapper commented Jul 13, 2022

Found another publicly available WFS which is serving mixed geometry types for a feature type:

WFS endpoint: http://xplanung.lkee.de/xplansyn-wfs/services/xplansynwfs

Feature type: xplan:BP_AnpflanzungBindungErhaltung

grafik

@nyalldawson
Copy link
Collaborator

@pathmapper

Fair enough, that's a valid explanation!

@nyalldawson nyalldawson reopened this Jul 14, 2022
@nyalldawson nyalldawson merged commit aa8727e into qgis:master Jul 14, 2022
@pathmapper pathmapper deleted the filter_by_geom_toolbox branch July 14, 2022 19:42
@DelazJ DelazJ added the Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. label Jul 15, 2022
@github-actions
Copy link

@pathmapper
This pull request has been tagged as requiring documentation.

A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged.

Please update the description (not the comments) with helpful description and screenshot to help the work from documentors.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@github-actions
Copy link

@pathmapper
A documentation ticket has been opened at qgis/QGIS-Documentation#7674
It is your responsibility to visit this ticket and add as much detail as possible for the documentation team to correctly document this change.
Thank you!

pathmapper added a commit to pathmapper/QGIS-Documentation that referenced this pull request Jul 15, 2022
Fix qgis#7674
Algorithm was moved from "Modeler Tools" to "Vector selection" group in qgis/QGIS#49334
DelazJ pushed a commit to qgis/QGIS-Documentation that referenced this pull request Jul 15, 2022
Fix #7674
Algorithm was moved from "Modeler Tools" to "Vector selection" group in qgis/QGIS#49334
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants