I have temperature as a raster file and different ZIP Code Tabulation Areas (ZCTAs) as polygons. I'd like to calculate the mean temperature per zip code.

I need to know the temperature value per ZIP code region and I am trying to use the zonal statistics as table but my results are showing only one row out of 1769 ZIP codes. What could be the reason why this is happening? I also tried to do zonal statistics and wasn't successful either.

I thought that maybe the problem was that the raster (TIFF) is not only for California and my shapefile is of CA. I don't know if that's relevant.

  • What is your case field? – FelixIP Oct 29 '15 at 4:26

My guess is that you have a selection on your zip code layer. Try clearing the selection and running it again.

ArcGIS tools will often run on a selection rather than the entire table.

EDIT - 30/10/2015

I reread the documentation on the zonal statistics table and it states that

The number of rows in the output table is the number of zones.

I'm thinking that you have more than one zone, but is it possible that your processing environment is set so that the processing extent will only process within one zone? Further, are both datasets in the same location and same coordinate system?

  • Thank you for your response! Actually I thought about if it was a selection issue, but it isn't. The is no rows or columns selected. – user61483 Oct 29 '15 at 18:42
  • yes, I have more than a thousand zones, but the zonal statistics gives an output table with just one zone. I will check the processing environment. Both datasets have the same coordinate system. Not same location. The raster comprehends a bigger portion of what the polygon covers since my polygon is from California and the raster has a little bit of washington and nevada. – user61483 Nov 2 '15 at 18:23

The solution that works for me in a similar situation: Convert the ZIP Code Tabulation Areas (ZCTAs) polygons to a raster at the resolution/cell size of temperature file that you have. Then extract the temperature value per zip using the converted raster.

  • While this may indeed work, there is no need to convert the polygons to raster for Zonal Statistics. The tool works with both raster or polygon. – Fezter Oct 29 '15 at 6:07
  • Yes it works with both, but from my experience the raster is effective. Further making the two resolutions similar takes care of a pixel being accounted for twice using the line as boundary. No discrepancies will be observed, otherwise with line boundary few discrepancies are observed. – Peter M Macharia Oct 29 '15 at 6:12
  • Hi Peter, thanks for your response. I did the conversion from polygon to raster using the same cell size as the raster but for some reason my raster came out with a wrong format; when I do the conversion keeping the default cell size then this doesn't happen. Would that mean that my temperature raster is not appropriate to be used with this shape file? – user61483 Oct 29 '15 at 20:34
  • What do you mean by wrong format – Peter M Macharia Oct 30 '15 at 4:21
  • I mean that the shape of the output raster was weird, it formed a line cutting across the image of the raster – user61483 Nov 2 '15 at 18:17

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.