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.

  • 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 1: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 (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 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 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.