Bug report #14858

Processing QGIS Zonal Stats broken on Windows

Added by Giovanni Manghi over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Victor Olaya
Category:Processing/QGIS
Affected QGIS version:master Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:22811

Description

Seems only Windows is affected (the last working release seems to be 2.6).

Try this project

https://github.com/qgis/QGIS-Documentation/tree/master/source/docs/training_manual/exercise_data/processing/more_backends

You'll get

Uncaught error while executing algorithm
Traceback (most recent call last):
File "C:/OSGeo4W/apps/qgis/./python/plugins\\processing\\core\\GeoAlgorithm.py", line 203, in execute
self.processAlgorithm(progress)
File "C:/OSGeo4W/apps/qgis/./python/plugins\\processing\\algs\\qgis\\ZonalStatistics.py", line 249, in processAlgorithm
attrs.insert(idxMode, float(mode(masked, axis=None)[0][0]))
File "C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\
umpy\\ma\\core.py", line 2941, in getitem
dout = ndarray.__getitem__(_data, indx)
IndexError: 0-d arrays can't be indexed

on 2.14 and master

and

Uncaught error while executing algorithm
Traceback (most recent call last):
Traceback (most recent call last):
File "C:/OSGeo4W/apps/qgis-ltr/./python/plugins\\processing\\core\\GeoAlgorithm.py", line 232, in execute
self.processAlgorithm(progress)
File "C:/OSGeo4W/apps/qgis-ltr/./python/plugins\\processing\\algs\\qgis\\ZonalStatistics.py", line 105, in processAlgorithm
(startColumn, startRow) = mapToPixel(xMin, yMax, geoTransform)
File "C:/OSGeo4W/apps/qgis-ltr/./python/plugins\\processing\\tools\
aster.py", line 68, in mapToPixel
gdal.InvGeoTransform(geoTransform)[1], mX, mY)
TypeError: not a sequence

on 2.8

Associated revisions

Revision 44c948b0
Added by Alexander Bruy over 8 years ago

[processing] add support for GDAL 2.x in raster tools (refs #14858)

History

#1 Updated by Alexander Bruy over 8 years ago

Tested with geomorpho.qgs project (more_backends.qgs seems does not have any raster layers in it) under Windows using latest qgis-dev package — no errors, statistics calculated correctly. I got same results as under Linux.

#2 Updated by Alexander Bruy over 8 years ago

Issue with 2.8.9 confirmed, I also got

Uncaught error while executing algorithm
Traceback (most recent call last):
Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis-ltr-dev/./python/plugins\\processing\\core\\GeoAlgorithm.py", line 232, in execute
    self.processAlgorithm(progress)
  File "C:/OSGEO4~1/apps/qgis-ltr-dev/./python/plugins\\processing\\algs\\qgis\\ZonalStatistics.py", line 105, in processAlgorithm
    (startColumn, startRow) = mapToPixel(xMin, yMax, geoTransform)
  File "C:/OSGEO4~1/apps/qgis-ltr-dev/./python/plugins\\processing\\tools\
aster.py", line 68, in mapToPixel
    gdal.InvGeoTransform(geoTransform)[1], mX, mY)
TypeError: not a sequence

#3 Updated by Giovanni Manghi over 8 years ago

Alexander Bruy wrote:

Tested with geomorpho.qgs project (more_backends.qgs seems does not have any raster layers in it) under Windows using latest qgis-dev package — no errors, statistics calculated correctly. I got same results as under Linux.

weird you don't get errors in 2.14 or master, I have clean testing environments on windows and I see the same on both OSes.

#4 Updated by Alexander Bruy over 8 years ago

Fix for 2.8.x commited.

#5 Updated by Giovanni Manghi over 8 years ago

Alexander Bruy wrote:

Fix for 2.8.x commited.

still can't replicate the other error on 2.14/master?

#6 Updated by Alexander Bruy over 8 years ago

Yes, no error on master.

#7 Updated by Giovanni Manghi over 8 years ago

Alexander Bruy wrote:

Yes, no error on master.

tested Windows right (is only Windows issue)?

#8 Updated by Alexander Bruy over 8 years ago

Yes, I tested on Windows and can't reproduce this

#9 Updated by Alexander Bruy over 8 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Seems works fine on all systems now

Also available in: Atom PDF