Use a polygon overlay to assign raster cell values

216
7
Jump to solution
12-02-2021 02:17 PM
Labels (2)
GJB
by
New Contributor III

Hello, I am using Pro 2.8.3. I want to use a polygon shapefile (areas of bedrock outcrop) as an overlay to a raster (overburden thickness) in order to assign the overlain raster cells a particular value (zero where bedrock is at the ground surface). Any tips would be greatly appreciated!  Thank you.

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

build the expression, I can't remember if the single quotes are needed around the raster names

Con('geo_bed_exp_raster',1.8, Con('Int_TopoToR_1' <= 25, 0.6, 0.0001))

which basically means

      if geo_bed.... has a value, assign the new one 1.8,

     if false

         if 'Int_TopoToR_1' <= 25  give it value 0.6  otherwise 0.0001

in general .... condition, True, False

of you can nest them   (condition, True, (condition, True, False))


... sort of retired...

View solution in original post

0 Kudos
7 Replies
DanPatterson
MVP Esteemed Contributor

pay attention to converting the polygon shapefile to raster (eg cell size, alignment, extent, snap raster),

then use the Con tool to assign the poly-raster to locations where it is present and the overburden raster otherwise.

Con (Spatial Analyst)—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
GJB
by
New Contributor III

Thank you Dan. I am having trouble formulating the con expression - my expressions are not giving the desired output. Specifically, how to assign the poly-raster to locations where it is present? Any additional input would be greatly appreciated.  Thanks!

 

0 Kudos
DanPatterson
MVP Esteemed Contributor

I don't know what your polygon file looks like, but if it just indicates where something is, then you will get a raster having a value (which ever field you pick) where it is present and nodata where it isn't.  So if you have several classes in your polygon file, then you will end up with a raster representing those classes and the empty spaces (no observation or nodata) will be classes as such.

When you have your raster produced from the polygon file, then you can proceed, but if you need help with the Con statement, show what your raster names are and what you have tried in the con statement


... sort of retired...
0 Kudos
GJB
by
New Contributor III

Please reference the attached screenshot. The poly-raster is 'geo_bed_exp_raster' which shows where bedrock is exposed at the surface.  The overburden raster is 'Int_TopoToR_1' which shows depth to rock.  Ultimately, I want to create a new raster with a new field called Recharge, that is assigned a value of 1.8 where the poly-raster is present; 0.6 where Int_TopoToR_1 <= 25; and 0.0001 where Int_TopoToR_1 > 25. I think I'm having trouble seeing how to put together a con expression that includes two existing rasters and a new field.

0 Kudos
DanPatterson
MVP Esteemed Contributor

build the expression, I can't remember if the single quotes are needed around the raster names

Con('geo_bed_exp_raster',1.8, Con('Int_TopoToR_1' <= 25, 0.6, 0.0001))

which basically means

      if geo_bed.... has a value, assign the new one 1.8,

     if false

         if 'Int_TopoToR_1' <= 25  give it value 0.6  otherwise 0.0001

in general .... condition, True, False

of you can nest them   (condition, True, (condition, True, False))


... sort of retired...
0 Kudos
GJB
by
New Contributor III

Thank you Dan!  Your solution was right on target.  I used this variation of the expression:

Con(Int_TopoToR_1 = 0, 1.8, Con((Int_TopoToR_1 > 0) & (Int_TopoToR_1 <= 25)), 0.6, Con(Int_TopoToR_1 > 25, 0.0001 ))

0 Kudos
DanPatterson
MVP Esteemed Contributor

Glad it worked out


... sort of retired...
0 Kudos