4

Does anyone familiar with the QGIS Zonal Statistics tool know why stats calculations might return empty?

Inputs

  1. DEM for South Carolina: http://dnr.sc.gov/GIS/descdem.html
  2. A vector shapefile: https://s3.amazonaws.com/www.improvz.com/gis/Archive.zip

Desired result: Zonal Statistics calculates elevation on all shapes.

Actual result: Zonal Statistics plugin returns empty values for all fields

Parcels and DEM loaded Zonal Stats plugin prompt Zonal Stats calculating No elevation stats are calculated

QGIS 2.8 on MacOSX.

nmtoken
  • 13,355
  • 5
  • 38
  • 87
Adestin
  • 83
  • 6

2 Answers2

2

Your file "CAD_PARCEL_MP have some topology error (check with menu Vector >"topology checker).

I fix it with the processing tool "fix geometry" in QGIS 3.2, and than it seems working

enter image description here enter image description here

Christophe P.
  • 2,175
  • 11
  • 22
2

It is interesting to know that fix geometries solved this issue, thanks to Volta.

My suggestion is (was) to reproject the polygon layer to match with the DEM layer; since most FAQ about Zonal Statistics are related to different CRSs between raster and polygon layers.

A quick test, reprojecting the CAD_PARCEL_MP to EPSG: 2029 *NAD27(76) UTM zone 17N* looks OK.

enter image description here

... an alternative option, just in case :)


Update

Seeing the comment by ndawson, my last line just in case should be just in case the work has to be done in pre-QGIS 3. The CRS issue is gone now.

Kazuhito
  • 30,746
  • 5
  • 69
  • 149
  • tks, @Kazuhito...helpful! – Adestin Jul 31 '18 at 17:43
  • This is no longer required in QGIS 3.2 - if you have different CRS between the raster and vector, it will automatically be handled correctly. – ndawson Jul 31 '18 at 21:32
  • @ndawson, I am not sure about your comment. I had this issue today (QGIS 3.16) and setting both: the shape and the raster to the same CRS was the only thing that made it work for me – Vincé Oct 29 '21 at 09:59