2

I have a 0.5 meter raster that defines presence or absence (cells are either 1 or 0). I have another 5 meter raster, which I created. I would like to calculate a percent coverage of the underlying 0.5 meter raster and pull that value into the corresponding cell in the 5-meter raster. The rasters don't line up and cannot be adjusted.


One thing I now realize is that the cells are slightly less than 0.5 meters, .46999 to be exact. I ran block statistics, using a 10.638298 X 10.638298 rectangle (5/.469999), with snap raster set to, the slightly offset, 5-meter raster. That's taking a while to run, but I'm guessing that it won't work quite right. I also have a 5-meter polygon fishnet and I could also convert the .46999 meter forest cover raster into a polygon feature. Then I could calculate the area within each 5-meter 'cell'.

1
  • Jim, it looks like you may have two accounts. Please merge them by filling out the form at gis.stackexchange.com/help/user-merge: then you will be able to edit and comment on your question.
    – whuber
    Mar 3, 2013 at 21:44

2 Answers 2

2

An easy way to do this is to use block statistics with a Mean rule. Specify a 10 by 10 neighborhood to get 5m blocks from your 0.5m data. Since your values are 0 and 1, the average values will equal percentages. To make sure it lines up with the 5m raster, change your environment settings so that your 5m raster is the snap raster (underneath processing extent) and the output cell size to 5m.

1
  • +1 Block Statistics are a good alternative to resampling
    – Aaron
    Mar 3, 2013 at 21:15
2

Another option is to use a script tool called "Class Percent", available in the ArcGIS - Geomorphometry and Gradient Metrics Toolbox from a GISse contributor. This tool calculates the class percent of a binary integer raster via focal statistics and a user defined moving window. For example, the image to the left is a binary raster (0 or 1) and the class percent output to the right shows the percent cover calculated in a 1 ac moving window.

enter image description here

I'm not sure what you plan to do with the 5m resolution raster. If you want to convert the class percent output to 5m resolution, use Resample. Alternatively, you can specify the cell size output in the Environment Settings under Raster Analysis.

If you want to use the class percent output for additional calculations with your 5m resolution raster, use raster algebra with Raster Calculator. Possibly, Cell Statistics may work for your calculations. As @Jay indicated, use snap raster to align your images if need be.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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