2

How can I fix the error 0-d arrays can't be indexed?

This message appears after the tentative to use the algorithm Qgis Zonal Statistics. Detail: the algorithm worked very well several times and then failed irreversibly.

Sergio
  • 233
  • 3
  • 13
  • 1
    It sounds like you're experiencing non-overlapping zone/data, very small zone or projection difference. This error also occurs when the input is geographic and a metre/foot cell size is specified... when rounded the array becomes (0,0) elements thereby a 0 dimension array. More information about the zone/data rasters would help to further diagnose the likely cause of this problem. – Michael Stimson Jul 14 '15 at 01:18
  • As suggested, here are more details. PROJECT 1 The project and the data are in UTM / SAD69 23 S map projection ; The size of the cells is in meters (two alternatives were tested: 1 and 1 x 5 x 5). The raster layer exceeds the area of the vector layer in about 25 m.

    PROJECT 2 The project and the data are in UTM / SAD69 19 S map projection ; The dimension of the cells is in meters (50 x 50). The raster layer exceeds the area of the vector layer in about 250 m.

    Coincidentally the problem appeared after updating the toolbox. @Michael

    – Sergio Jul 14 '15 at 11:05
  • Can you tell me where you got the updated toolbox from and I'll see if I can read the code... I speak python, C, C++, C#, VB and other miscellaneous half-languages (like XML). You are absolutely certain that all the data has a native projection of UTM / SAD69 23 S. Can you try defining the spatial reference of a copy to WGS84 UTM 23 South (http://www.spatialreference.org/ref/epsg/wgs-84-utm-zone-23s/) using EPSG:32723. Perhaps the odd SR string is confusing the tool, a straight EPSG (albeit with a different datum) might produce workable results. – Michael Stimson Jul 14 '15 at 21:29
  • The update of the toolbox was done from the plugin manager of QGIS, as qgis manual recommends. Yes, I'm absolutely sure that all data has a native projection of UTM / SAD69 23 S. I tried, just now, your suggestion to use EPSG:32723: fail again. I tried also EPSG: 3857 - WGS84 pseudo Mercator: fail. It has happened in tow machines, both of then with windows xp. Tomorrow I will try these applications in another computer with another Windows. It will be done in two steps: a) before update; b) after update. – Sergio Jul 14 '15 at 23:52
  • What format are the raster and vector? The source that I am looking at is http://qgis.org/api/qgszonalstatistics_8cpp_source.html Is it possible that there is an empty geometry (or less than 1/2 cell) present in the vector overaly? – Michael Stimson Jul 15 '15 at 00:09
  • Raster format: Geotiff; Vector format: shape file. I am looking for any empty geometry (or less than 1/2 cell) present in the vector overlay. – Sergio Jul 15 '15 at 00:35
  • Calculate areas should make that easier. http://gis.stackexchange.com/questions/23355/how-to-calculate-polygon-areas-in-qgis look for anything very close to 0. – Michael Stimson Jul 15 '15 at 00:36
  • Well, there is no empty geometry. I created a new project exclusive to study this problem. It is composed by 3 files: a little clip of the srtm27_17, 2 grids (polygon) generated by QGIS Vector Grid. Everything in SIRGAS2000 UTM 23s. However the problem persists. If you wish, the zip file with all files and the project file (Zonal Statistics) is available at link . – Sergio Jul 15 '15 at 12:13
  • The zonal statistics algorithm worked very well in the computer with QGIS 2.6.1. – Sergio Jul 15 '15 at 14:50
  • I think it's time to log this with QGIS at http://qgis.org/en/site/getinvolved/development/index.html#bugs-features-and-issues I can't see any bugs in that code (which may or may not be the right one)... QGIS is one program of a few that will support multiple installs, I would suggest that you install a previous version where it was known to work and continue the rest of your project in the version you're comfortable with. – Michael Stimson Jul 15 '15 at 21:43

0 Answers0