The issues I keep seeing depend on unique combinations of values.
I have three rocktype raster layers for area and they are edge-to-edge (they do not overlap). They each have "VALUE" fields and "COUNT" fields. There's one row of data for each attribute table where "VALUE"=1 where the rock type exists. I guess this is like mask.
What I need to do is combine these three rasters into one with raster calculator using this logic.
rocktype1==1, output value=1
rocktype2==1, output value=2
rocktype3==1, output value=3
Here's what I've tried:
Con("rocktype2"==1, 2) | Con("rocktype1"==1, 1) | Con("rocktype3"==1, 3)
Con("paleo"==1, 2, Con("precamb"==1, 1, Con("tert_quat"==1, 3)))
Combine(["rocktype2","rocktype1","rocktype3"])
rocktype1 + rocktype2 + rocktype3
I continuously get a blank output raster. What am I doing wrong here?
I'm using ArcMap 10.3.
-
(Raster1==1)+(raster2==1)*2+(raster3==1)*3FelixIP– FelixIP2016年04月17日 09:48:07 +00:00Commented Apr 17, 2016 at 9:48
-
this expression produced another blank raster output.Stephen E– Stephen E2016年04月17日 22:18:43 +00:00Commented Apr 17, 2016 at 22:18
-
Set environment extent to union of inputs.FelixIP– FelixIP2016年04月17日 22:38:20 +00:00Commented Apr 17, 2016 at 22:38
-
I've set that parameter in processing extent in envinronment settings and it still produces a blank rasterStephen E– Stephen E2016年04月17日 22:51:25 +00:00Commented Apr 17, 2016 at 22:51
-
What does Raster==1 produces?FelixIP– FelixIP2016年04月17日 22:53:02 +00:00Commented Apr 17, 2016 at 22:53
2 Answers 2
The raster calculator is working a different way.
First you need to declare your OutRaster that will be saved:
OutRas = Con(...)
Your expression may probably look like this (like your second try, but not sure why you set other names there):
OutRas = Con("rocktype1"==1,1,Con("rocktype2"==2,2,Con("rocktype3"==1,3)))
-
Oops sorry those are the actual names of the rocktypes, just forgot to change them for this purpose. I tried the expression you suggested and the output was only rocktype1.Stephen E– Stephen E2016年04月17日 22:19:23 +00:00Commented Apr 17, 2016 at 22:19
As per comment by FelixIP, this expression worked for me:
~IsNull("precamb")+2*(~IsNull("paleo"))+3*(~IsNull("tert_quat"))
-
Mark it as solved please to help othersFelixIP– FelixIP2016年04月20日 02:02:53 +00:00Commented Apr 20, 2016 at 2:02
Explore related questions
See similar questions with these tags.