QGIS icon indicating copy to clipboard operation
QGIS copied to clipboard

[Processing] Expose geometry checker to processing toolbox

Open Djedouas opened this issue 1 year ago • 12 comments

Description

Supersedes #55552

This Pull Request aims to integrate the geometry checker in the processing toolbox within the scope of QEP 236.

The main goal is to adapt the initial algorithms from Geometry Checker to function within Processing. Each process will follow a consistent logic: one input layer and two distinct outputs for erroneous geometries and identified errors through "error->location". These outputs will be based on QgsGeometryCheckError fields, providing users with additional manipulation possibilities. Other Geometry Checker processes will be added following this review, and we plan to include additional correction/manipulation processes.

The aim is to adapt QGIS verification and correction tools (topology and geometry checker plugins) to make them compatible with Processing. Our foundation lies in some verification and data correction scripts we have encountered or developed during various projects.

To ensure a consistent user experience, each process will operate similarly:

An input layer, with the ability to select a single layer for each algorithm (using batch mode for multiple layers if needed).
A default tolerance parameter set at 8 (for 1e-8) in the advanced settings.
Specific configurations for algorithms (QVariantMap configurationCheck).
Outputs will display erroneous geometries and their associated points without modification, empowering users to decide on subsequent actions. While direct modifications to the layer could be considered (see native:truncate), we've chosen to separate these actions to allow users to make their own decisions.

Correction algorithms based on these outputs are proposed to address various use cases.

Screen captures

1. Check errors

Check geometry: errors will be flagged as a point layer showing places where the angle is < min angle

Launch processing

image

Errors layer attribute table

image

Source and errors layer

image

2. Fix with appropriate processing

Launch the delete vertex processing With the errors layer (output from the previous check) as input

image

Source and fixed layer (neon red)

image

Report layer showing what was done

image

Regarding the code

To use QgsFeaturePool, it's necessary to that the input layer be a QgsProcessingParameterVectorLayer.

The new processes are grouped under new categories named "Check geometry" and "Fix geometry". Suggestions for improved naming are welcome. The aim is to unify verification and correction processes from topology and geometry_checker plugins within this category.

The current displayName, "Check Geometry (algorithm name)", is provisional. Any suggestions for enhancing this designation are welcome.

To avoid overwhelming process options, I've opted to enforce the "gc_" prefix for field names (see outputFields). It's worth considering whether to make this parameter configurable.

The creation of QgsGeometryCheckContext requires a QgsProject. Currently, I utilize the one from the input layer if available, otherwise QgsProject(). However, the optimal method for this is yet to be determined.

Lastly, this initial proposal introduces one algorithm to initiate the discussion. For ease of review, we'll open a PR for each process.

Funded by QGIS (Grant OpenSource 2023) and Oslandia

Part of https://github.com/qgis/QGIS-Enhancement-Proposals/issues/236

cc @lbartoletti

Djedouas avatar Jan 23 '24 08:01 Djedouas

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit 91036c8f32055d69e28f07fbe21ff5c361a2ac8e)

github-actions[bot] avatar Jan 23 '24 10:01 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Feb 09 '24 02:02 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Mar 06 '24 02:03 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Mar 21 '24 02:03 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Apr 05 '24 02:04 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Apr 20 '24 02:04 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar May 05 '24 02:05 github-actions[bot]

While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist.

github-actions[bot] avatar May 12 '24 02:05 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar May 28 '24 02:05 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Jul 02 '24 02:07 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Jul 17 '24 02:07 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Aug 02 '24 02:08 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Aug 17 '24 02:08 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Sep 03 '24 02:09 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Sep 18 '24 02:09 github-actions[bot]