Resampling a 1m resolution raster to 30m raster(s) while preserving the original data

387
3
12-20-2013 05:18 AM
EthanBodnaruk
New Contributor
Hi ArcGIS users,

I have a 1m resolution land cover map with 5 land cover classes.  I would like to end up with 5 separate maps each at a 30m resolution that indicates the fraction of each land cover type it contains. 

So for a given block of 900 pixels (corresponding to 30 x 30) if I had  300, 200, 175, 150, and 75 pixels of each respective land cover type, I would want:

Raster 1:  First cell to have value of 300/900
Raster 2:  First cell to have value of 200/900
Raster 3:  175/900
Raster 4:  150/900
Raster 5:  75/900

Then of course this would have to be performed for the entire map.  So if I had 9 million pixels (9 million square meter study area) I would end up with (9 million divided by 900 =) 10,000 pixels in each of my new rasters. 

I also have a separate raster at a 30 m resolution that I want my new final rasters to conform to spatially. 

I'd appreciate any advice on how to carry this out.  Thanks!

Best,
Ethan
0 Kudos
3 Replies
Luke_Pinner
MVP Regular Contributor
In the raster calculator you could use the Aggregate and Con functions:
Aggregate(Con("landuse_raster" == somenumber, 1, 0), 30, "SUM") / 900.0

Note replace "somenumber" with the relevant land use code each time you run the calculation.
0 Kudos
EthanBodnaruk
New Contributor
Dear Lpinner,

Thank you so much for your response!  Those commands are exactly what I need.  I can run "con" and "aggregate" separately (with limited success for aggregate for some reason) but have problems running the combined code using both con and aggregate. 

I get an error stating that the cell size and extent aren't defined.  I searched around on forums and  understand that the computer needs to know the cell size and the extent you're processing over because it doesn't make assumptions about that on its own (which makes sense of course).  I tried using arcpy.env.Cellsize and arcpy.env.extent to specify these using the original raster.  The computer seemed to accept the commands but I got the same errors using the code you suggested afterwards.

Any idea where I'm messing up? 

Thanks so much!

Best,
Ethan
0 Kudos
EthanBodnaruk
New Contributor
I figured it out using the model builder.  I don't have to repeat my steps much so it was fine to do this way.  Thanks so much!  Problem resolved!!!
0 Kudos