Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Here is my newest issue:

I have temperature as a raster file and different ecoregions of a province as polygons. What I want to do is calculate the mean temperature per ecoregion.

I succeeded in doing this by Zonal Statistics which creates an output raster, but what I actually want, as I realized later, is I the temperature value per ecoregion. So how do I assign that value to the ecoregion?

I thought I can do zonal statistics as table and then join this table to the ecoregion. It does work but for some reason it does not calculate values for some of the ecoregions (1400 ouf of 7400 get null values). I tried to find a pattern in the ecoregions that didn't get assigned a value, so e.g if they were too small or have a too complicated shape or if they are at the edge of the province...but no..they are just randomly distributed.

Any ideas or something that I am missing?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

I took a look at the data you provided. Initially, I had issues getting ArcMap to recognize the ASCII raster format. I had to open the ascii file in Notepad++ and rename it as a .asc file instead of .ascii. Once I got it into ArcMap, I had projection issues. I was able to get everything working properly by reprojecting the .asc raster to another projection (it shouldn't matter which projection you use, I used CA Teale Alber's just because that's what I use for work, but you should use one that makes sense for the area). In the process of reprojecting the data, it converted the raster from ascii to a .img. Using the newly reprojected .img raster as an input, I had no issues with NoData appearing in my zonal statistics raster or table (I ran both tools).

I suspect that this is a format issue that may relate to the projection file included with the .ascii raster. Try reprojecting the ascii file (and in the process converting it to a .img) and using that as an input and see if that works for you.

share|improve this answer
    
Hi, thanks for your time. Good point, but no I left it checked. –  Sandra Nov 6 '12 at 19:37
    
Can you provide a sample of your temperature raster so I can run some tests? –  egdetti Nov 6 '12 at 19:41
    
Sure, how can I send it to you? –  Sandra Nov 6 '12 at 19:42
    
I've updated my answer to reflect what I found working with your data. –  egdetti Nov 6 '12 at 20:44
    
It is inappropriate on this site to use the Q&A space to carry out a private conversation in which others cannot participate! Sandra, please provide a public location for those data so others can view them, or we will need to close this thread. –  whuber Nov 6 '12 at 21:39

Thank you Aaron and Egdetti for your time. (sorry Whuber for my mistake) Aaron you explained the process really nice, thank you a lot. Egdetti, you pointed me to the right direction, the different projections of the two datasets mess the zonal statistics table up. I wasn't aware that this is an issue :-( My raster layer is a floating point raster with the spatial reference of NAD_1983_BC_Environment_Albers, Datum:D_North_America_1983 my zone layer (polygons) was in GCS_North_American_1983 but with the same Datum. (This made me realize that I don't really understand what the datum is?)

However, I tried the zonal statistics table on the same raster but with a different zone layer (one that has NAD_1983_BC_Environment_Albers) and there I had no Null values.

So I tried and projected my original zone layer into NAD_1983_BC_Envrionment_Albers which lowered the amounts of Null values but there are still some left?

I assume it is still related to projections..my all time favourites:-)

share|improve this answer

The attached sample data shows two layers: a raster and polygon feature class. The raster shows monthly max temperature across the USA. Consider the three polygons ecoregions 1, 2 and 3. The goal here is to do the following:

  1. Run zonal statistics to calculate the average max temp within each ecoregion.
  2. Join the output table to the ecoregion layer.
  3. Export the joined layer to a featureclass in order to make the joins permanent.

enter image description here

Run Zonal Statistics as Table

enter image description here

Join the new zonal table to the ecoregion layer. Make sure the feature class/shapefile and zonal table are both either inside or outside of a geodatabase so that the OID or FID will be easier to sync.

enter image description here

Finally export the ecoregion layer to a shapefile or featureclass in order to make the join permanent.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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