-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Processing] init first algorithms from geometry_checker #55552
[Processing] init first algorithms from geometry_checker #55552
Conversation
|
||
QgsProcessingMultiStepFeedback multiStepFeedback( mIsInPlace ? 4 : 3, feedback ); | ||
|
||
QgsProject *project = mInputLayer->project() ? mInputLayer->project() : QgsProject::instance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid accessing project here? It's likely a cause of the multithreading issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried:
std::unique_ptr<QgsGeometryCheckContext> checkContext = std::make_unique<QgsGeometryCheckContext>( mTolerance, mInputLayer->sourceCrs(), QgsCoordinateTransformContext(), nullptr );
But, I got these thread errors:
CRITICAL Qt : setValid (/home/lbartoletti/QGIS_fix_polygon/src/core/qgsmaplayer.cpp:2518) is run from a different thread than the object lives in [0xd237d0 vs 0x20e6540]
CRITICAL Qt : project (/home/lbartoletti/QGIS_fix_polygon/src/core/qgsmaplayer.cpp:2749) is run from a different thread than the object lives in [0xd237d0 vs 0x20e6540]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backing up a step, why do the geometry checker classes need access to a project at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Project can be used to resolve additional layers on algorithms". Since, it's the layerId that is passed and one has to retrieve the mapLayer from this ID.
AFAIK, it's used in Gap Algorithm Check. Maybe @m-kuhn has a better idea than me on how and where it's used?
b574518
to
6efe836
Compare
- in place processing was dropping attributes - standard run was duplicating features - wrong geometry support for in place multipart processing
Fixes and tests
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
|
Sorry, it's taken a long time to look into this one! (Christmas break!) I'm honestly a little confused by the approach here. I get the benefit of moving these tools to processing algorithms, but I'm unsure how this will permit removal of the interactive geometry checker tools. Is that in scope for this work? (If not, then I'm concerned that we'll just end up with ANOTHER set of geometry checker tools which don't exactly overlap the functionality of the others 🤣 ) |
@nyalldawson Regarding correction, we are exploring several approaches that @Djedouas can detail better than I can. In this Pull Request, I attempted to propose an in-place solution, but it doesn't work well (if at all); a false good solution. Ultimately, we will opt for two combined approaches, addressing various identified cases:
For your information, I will let Jacky continue on this subject, but I will still be present, albeit more in the background. |
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
|
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. |
Description
This Pull Request presents three new processing examples for integration 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:
Regarding the code:
Lastly, this initial proposal introduces three algorithms 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 qgis/QGIS-Enhancement-Proposals#236
cc @Djedouas @manisandro