1

I have two different rasters that are both in the same resolution (250 feet). The rasters are Forest Type and Forest Age. Even though they are representations of the same forest, their extent does not match up perfectly.

I would like to assign the value of the nearest Forest Type to each pixel on the Forest Age raster. My goal is to create a raster with the same coverage as Forest Age, but with the nearest Forest Types values.

For instance, if a pixel had a value for Forest Age but no value for Forest Type, I would need to have the nearest Forest Type added to an attribute table (be it the Forest Age Raster or a separate table).

I have access to the Spatial Analyst extension.

  • Use euclidean allocation on forest. Use con to remove cells that don't have both type and age. – FelixIP Jul 17 '19 at 3:24
  • @FelixIP, I'd never heard of that tool. That is perfect for this. Thank you, so much! – Tom Jul 17 '19 at 15:46
2

Edit: Ignore my answer. Use Euclidean Allocation, like FelixIP mentioned.

Since you've edited your question, it appears that my previous answer does not apply.

Instead, what you want is the Nibble tool. First create a raster converting NoData cells in your Forest Type raster to 1s and every other value to NoData; use the Con/IsNull process described here. In Nibble, pass your Forest Type raster as the input raster and your Con/IsNull output raster as the nibble mask.

Previous answer:

You can simply use the ArcGIS CopyRaster tool to copy Forest Types, setting the Forest Age raster as the SnapRaster.

If they have different cell sizes and you'd like to match them, you would need to Resample, setting "NEAREST" as the resampling type. But you still need to set the SnapRaster.

| improve this answer | |
  • The two raster datasets do not line up perfectly. I need to get the nearest value of Raster 2 (Forest Type) to Raster 1 (Forest Age) for each pixel of Raster 1 (Forest Age). – P. Simon Jul 16 '19 at 18:55
  • @P.Simon, that's exactly what this will do. The SnapRaster setting will align them. If you want to get both values into the same attribute table, then you could use the Combine tool. – Tom Jul 16 '19 at 19:16
  • I just used the Combine tool. It aligned the values but did not return the nearest value for Forest Type in pixels that did not contain Forest Type values. It returned a value of '0'. – P. Simon Jul 16 '19 at 19:32
  • You still have to run the Nibble tool on the Forest Type raster prior to running combine tool. – RGfromRWBJV Jul 16 '19 at 20:53

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.