Adding two rasters together

snowgage

Posted 21 December 2010 - 02:55 PM

snowgage

Key Contributor

Validated Member

56 posts

Gender:Male

Location:Bozeman, MT

United States

Good afternoon. I know this is simple but am missing something obvious.

I have two raster datasets that have cost-surface values (0-20). They both have the same extent (i.e. county boundary). The difference between the two is that one raster is a grid of land use and is continuous across the whole county. The other raster only represents public lands. Although it has the same extent as the whole county, there are some areas where the raster has no cells (i.e. private lands).

I am creating a cost surface and want to add the two together. When I do this using raster calculator, the resulting grid only occurs where both datasets overlap. Am I taking the wrong approach to adding the two grids together? Any suggestions?

snowgage

Posted 21 December 2010 - 03:09 PM

snowgage

Key Contributor

Validated Member

56 posts

Gender:Male

Location:Bozeman, MT

United States

Good afternoon. I know this is simple but am missing something obvious.

I have two raster datasets that have cost-surface values (0-20). They both have the same extent (i.e. county boundary). The difference between the two is that one raster is a grid of land use and is continuous across the whole county. The other raster only represents public lands. Although it has the same extent as the whole county, there are some areas where the raster has no cells (i.e. private lands).

I am creating a cost surface and want to add the two together. When I do this using raster calculator, the resulting grid only occurs where both datasets overlap. Am I taking the wrong approach to adding the two grids together? Any suggestions?

thanks in advance,

Josh

Figured it out..

Areas of private lands were valued as no-data. I reclassified these to equal 0. This way when I added the two together the no-data cells were effectively ignored.

Adam Wilbert

Posted 21 December 2010 - 03:11 PM

Adam Wilbert

Legendary Contributor

Validated Member

296 posts

Gender:Male

Location:Bellingham, WA, USA

United States

are you using a conditional statement? I'm thinking it needs to be something like "con (public_lands=nodata, land_use, public_lands+land_use)" so if the Public Lands raster is null, then it only returns the value of the Land Use raster, but if Public Lands has a value, then it adds the two together.