-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Check and fix algorithms improvement #61531
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
base: master
Are you sure you want to change the base?
Check and fix algorithms improvement #61531
Conversation
🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. 🪟 Windows buildsDownload Windows builds of this PR for testing. |
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.
Hi @Djedouas
Thanks for these updates. I was about to open issue reports for these and saw your PR, hence I'm asking here.
) ); | ||
|
||
std::unique_ptr<QgsProcessingParameterNumber> tolerance = std::make_unique<QgsProcessingParameterNumber>( | ||
QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 |
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.
As mentioned in qgis/QGIS-Documentation#9773, afaiu I find this tolerance parameter (8 meaning 10^-8) non-obvious, and its min/max values counter-intuitive. A parameter help is at least required for end users, but imho, we should move to something simpler as a plain double value with unit selector, as commonly used for this kind of parameter.
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.
Yes but it's to keep consistency with Geometry Checker plugin:
output.mp4
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.
btw, Geometry Checker accepts only an integer https://github.com/qgis/QGIS/blob/master/src/analysis/vector/geometry_checker/qgsgeometrycheckcontext.cpp#L20
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.
Yes but it's to keep consistency with Geometry Checker plugin:
Probably, but 1E-8 as shown in the plugin looks much more meaningful than 8. I don't know how strong is/should be the link between the two tools and I'm not speaking in terms of code, rather as a Processing end user who would expect some obviousness in the options and harmonization (and that we take advantage from improved parameter types in Processing)...
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.
Yes I agree that from an end user perspective, it could be confusing. However, we are tied with how the geometry checker is written right now.
We can't use the distance widget parameter because it would be nonsense and difficult to restrict the user to specific logarithmic values like "10, 1, 0.1, 0.001, 0.0001, etc.".
Our options are
- to create another parameter type, think of its UI, and that handles the differences we have between geographic and metric distances
- to change how the geometry checker tolerance is handled
I prefer to go with option 2. but in any case, it will be a work that would be done in a dedicated PR.
Right now, we could improve the documentation, or add a description of the tolerance parameter in every processing description.
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 would have said
Right now, we could improve the documentation,
orAND add a description of the tolerance parameter in every processing description.
They should have a start of answer in the GUI imho.
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.
Added a short text in every processing short help.
The "Tolerance" advanced parameter defines the numerical precision of geometric operations, given as an integer n, meaning that any difference smaller than 10⁻ⁿ (in map units) is considered zero.
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.
Given that this option is in advanced panel, I doubt people will modify it and don't think it deserves a mention in the algorithm main help. It should instead be as a tooltip over the parameter only, i.e.:
tolerance->setHelp( QObject::tr( "The \"Tolerance\" defines the numerical precision of geometric operations, "
"given as an integer n, meaning that any difference smaller than 10⁻ⁿ (in map units) is considered zero." );
45ff9b4
to
2bc04ce
Compare
Hi @DelazJ What do you think of changing the "Check geometry (<name>)" processing name to simply "<name>" ? It seems heavy right now: |
2bc04ce
to
ed61539
Compare
I agree that it looks crowded. I'm not very sure that an alg named "Angle" or "Contained" would be obvious (well, it is still displayed under the check group). PS: I'm not sure that the alg name is supposed to be in title case... ("Check Geometry (Dangle) --> Check geometry (dangle)") |
- avoid using new keyword to avoid memory leaks - remove auto keyword - better formatting - better algorithm description
- avoid using new keyword to avoid memory leaks - remove auto keyword - better formatting - better algorithm description
- avoid using new keyword to avoid memory leaks - remove auto keyword - better formatting - better algorithm description
- avoid using new keyword to avoid memory leaks - remove auto keyword - better formatting - better algorithm description
- avoid using unnecessary pointers - remove auto keyword - better formatting
- avoid using unnecessary pointers - remove auto keyword - better formatting
- avoid using unnecessary pointers - remove auto keyword - better formatting
- avoid using unnecessary pointers - remove auto keyword - better formatting
QList<QgsGeometryCheckError *> contains pointers to non-Qt objects. When the list is deleted, all pointers inside the list are deleted, but every data that each pointer points to is not automatically freed.
38b4cd4
to
89eb999
Compare
@DelazJ In fact, I think that we need to keep the long algorithm name, because when used inside a processing model we must see a full name. I really don't have an idea about title case or not for the name, that's why there is a mix... What do you think about this?
That's a good point. We could add the check name like the algorithm name:
|
@Djedouas Sorry I do not get the point with the modeler. The name should really be shortened for the reason you mentioned earlier, and maybe revisited to greatly reflect what the alg does. Do we really need the "check..." every time? What about e.g.:
Actually, they should not be in title case. If you walk through the Processing toolbox you'll notice that only the first letter is in upper case, unless there is an acronym. This is the rule to follow.
I'm not really fan; still long and not inline with existing practice. What about e.g.:
Sorry to add: There is also that great function to display algs short help when you hover over them in the toolbox. That may be helpful. But I realize there are quite a few algorithms using it. 😢 If usual Processing algs reviewers could chime in... |
Description
Following #59637 to improve the processing checks and fixes already here.