-
-
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
Improves the GDAL clip by mask layer tool #9445
Improves the GDAL clip by mask layer tool #9445
Conversation
…hoose the output resolution and the multithreaded warping option
Patch by @PedroVenancio |
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.
Looking good! Don't forget to update/extend the unit tests at https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tests/GdalAlgorithmsTest.py#L582
@@ -81,9 +94,26 @@ def initAlgorithm(self, config=None): | |||
self.tr('Match the extent of the clipped raster to the extent of the mask layer'), | |||
defaultValue=True)) | |||
self.addParameter(QgsProcessingParameterBoolean(self.KEEP_RESOLUTION, | |||
self.tr('Keep resolution of output raster'), | |||
self.tr('Keep resolution of input raster'), |
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.
Is this a bug fix? Would be good to separate this commit so it can be backported
defaultValue=False)) | ||
|
||
self.addParameter(QgsProcessingParameterBoolean(self.SET_RESOLUTION, |
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.
To me this parameter seems redundant -- we could cover the same functionality by testing if X_RESOLUTION and Y_RESOLUTION are set and not None. (and throw an exception if only one is set and not the other)
self.tr('Set output file resolution'), | ||
defaultValue=False)) | ||
self.addParameter(QgsProcessingParameterNumber(self.X_RESOLUTION, | ||
self.tr('X Resolution to output bands'), |
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.
self.tr('X Resolution to output bands'), | |
self.tr('X Resolution for output bands'), |
defaultValue=None, | ||
optional=True)) | ||
self.addParameter(QgsProcessingParameterNumber(self.Y_RESOLUTION, | ||
self.tr('Y Resolution to output bands'), |
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.
self.tr('Y Resolution to output bands'), | |
self.tr('Y Resolution for output bands'), |
optional=True)) | ||
multithreading_param = QgsProcessingParameterBoolean(self.MULTITHREADING, | ||
self.tr('Use multithreaded warping implementation'), | ||
defaultValue=False) |
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.
Any reason this should default to true?
I just noticed this is targeted at 3.4 -- is that valid? Looks like a new feature to me. |
@nyalldawson yes I see your point. Is not really a bug fix. |
Hi @nyalldawson This feature/pull request was a mix of:
The proposal for the backport was for that reasons, but I understand that there are some changes, and can be considered new features. @nyalldawson Please, change the code where you consider that it can be improved. Although it is functional, I believe the code can be much more polite. I see one problem in it, as it is using QgsProcessingParameterBoolean (and not radio buttons). So, a user can check both KEEP_RESOLUTION and SET_RESOLUTION at the same time. Is there any form to put them mutually exclusive in Processing? If not, I think a user needs to know what is doing when activate an option that is, by default, unselected. |
Description
Adds the option to allow choose the output resolution and the multithreaded warping option## Checklist
fixes #11111
in the commit message next to the description[FEATURE]
in the commit message[needs-docs]
in the commit message and contain sufficient information in the commit message to be documentedscripts/prepare-commit.sh
script before each commit