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

Add Advanced Option to Exclude Specific Attribute Values in Geometry Check (Area) Using Expressions #60099

Open
pigreco opened this issue Jan 9, 2025 · 3 comments
Labels
Feature Request Geometry checker Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@pigreco
Copy link
Contributor

pigreco commented Jan 9, 2025

Feature description

Feature Request Content:
Currently, the Geometry Check (Area) tool performs area-based geometry validation without the ability to exclude specific attribute values using a custom expression. This functionality would be particularly useful for excluding geometries that do not require validation based on certain conditions (e.g., attributes with specific values or particular criteria).

Proposal:
Add an advanced option to the Geometry Check (Area) tool that allows users to define an expression to exclude geometries based on their attribute values. For example:

An input field to enter an SQL-like expression or logical condition.

The ability to exclude geometries whose attributes meet a specific condition (e.g., attribute = 'value_to_exclude' or attribute IS NULL).

Use Case Example:
Suppose we have a polygon layer with an attribute type that can take values such as building, road, river, etc. If we want to exclude from the area check all geometries where the type attribute is equal to road, we could use an expression like:

type != 'road'

This way, the tool will perform the area check only on geometries that do not meet the exclusion condition.

Benefits:
Greater flexibility in geometry validation.

Time savings by avoiding unnecessary checks on specific geometries.

Better integration with complex workflows where only certain geometries require validation.

Suggested Implementation:
Add an optional input field in the advanced options panel of the Geometry Check (Area) tool.

Allow the use of simple expressions (e.g., comparisons between attributes and values, logical operators, etc.).

Validate the expression before running the check to avoid syntax errors.

This feature would be a valuable addition for users working with complex datasets who need more control over geometry validation processes.

Additional context

text reworked by deepseek_ai

#59637

@pigreco pigreco added Processing Relating to QGIS Processing framework or individual Processing algorithms Feature Request Geometry checker labels Jan 9, 2025
@agiudiceandrea
Copy link
Contributor

This could usually be achieved by executing the "Select by expression" (qgis:selectbyexpression) processing algorithm and then execute the needed processing algorithm with the "Selected features only" option set.

@pigreco
Copy link
Contributor Author

pigreco commented Jan 11, 2025

This could usually be achieved by executing the "Select by expression" (qgis:selectbyexpression) processing algorithm and then execute the needed processing algorithm with the "Selected features only" option set.

You are right, it can be done as you suggest, but by doing so I lose the opportunity to use the 'selected features only' functionality for other purposes, i.e. I could filter on a previous selection.

@agiudiceandrea
Copy link
Contributor

Properly setting the "Modify current selection by" parameter of the "Select by expression" processing algorithm may be of help in this case:

0 — creating new selection
1 — adding to current selection
2 — removing from current selection
3 — selecting within current selection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Geometry checker Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

2 participants