[QGIS-Developer] QGIS Script Error and Resampling Tool

Andrea Peri aperi2007 at gmail.com
Wed Jul 8 11:06:22 PDT 2020


Have you tried the saga -> resampling inside qgis ?

A.


Il mer 8 lug 2020, 18:50 Federico Gianoli <alpacagis at gmail.com> ha scritto:

> Dear all,
>
> I'm looking for a function to resample a raster from 300m to 1km by
> considering the mean value of pixels that are not "No Data", as GDAL Warp
> does.
> But, in case the majority of values within the 3x3 kernel of the 300m
> raster are "No data", "No data" will be assigned to the resampled pixel,
> which is not included in the above mentioned GDAL tool.
> I tried to explain the request here:
> https://gis.stackexchange.com/questions/366978/how-to-resample-a-raster-considering-a-minimum-number-of-valid-pixels].
> Apparently, neither QGIS nor Gdal have the possibility to make this control
> on the values during the resampling. Do you know if there is an automatic
> way to do this?
> In order to solve this problem, I have done this script
> https://gist.github.com/fgianoli/46a45c5fe042a952580947a282feedc1 to
> create a mask to check my results. But I'm experiencing this error at the
> end of the process, and I don't understand if my code is wrong or is a qgis
> setting:  (I'm running version 3.14 under Win10):
>
> NameError: free variable 'self' referenced before assignment in enclosing
> scope
> Traceback (most recent call last):
>   File
> "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\gui\AlgorithmDialog.py",
> line 201, in on_complete
>     self.feedback.reportError(
> NameError: free variable 'self' referenced before assignment in enclosing
> scope
>
>
>
> Any suggestions?
> Many thanks and kind regards,
>
> Federico
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200708/ed841457/attachment.html>


More information about the QGIS-Developer mailing list