Select to view content in your preferred language

(again): How to construct this IF Statement to obtain the value of the cell?

1343
4
05-25-2011 12:20 PM
JamalNUMAN
Legendary Contributor
(again): How to construct this IF Statement to obtain the value of the cell from 3 rasters?

please, see the attached image that shows my question

explanation:

the value of the cell in the result raster (donated by op) is obtained by the following if statement

----------------------------------------------------------------


if [Type] = "Forest" and [FlowType] = "TYPE D" and [Slope] = 1 then op = .8
if [Type] = "Forest" and [FlowType] = "TYPE D" and [Slope] = 2 then op = .6
if [Type] = "Forest" and [FlowType] = "TYPE D" and [Slope] = 3 then op = .4

if [Type] = "Forest" and [FlowType] = "TYPE E" and [Slope] = 1 then op = 1
if [Type] = "Forest" and [FlowType] = "TYPE E" and [Slope] = 2 then op = .6
if [Type] = "Forest" and [FlowType] = "TYPE E" and [Slope] = 3 then op = .4



if [Type] = "FieldCrop-Shrub" and [FlowType] = "TYPE D" and [Slope] = 1 then op = .6
if [Type] = "FieldCrop-Shrub" and [FlowType] = "TYPE D" and [Slope] = 2 then op = .4
if [Type] = "FieldCrop-Shrub" and [FlowType] = "TYPE D" and [Slope] = 3 then op = .2


if [Type] = "FieldCrop-Shrub" and [FlowType] =  "TYPE E"  and [Slope] = 1 then op = .8
if [Type] = "FieldCrop-Shrub" and [FlowType] =  "TYPE E"  and [Slope] = 2 then op = .4
if [Type] = "FieldCrop-Shrub" and [FlowType] =  "TYPE E"  and [Slope] = 3 then op = .2

--------------------------------------------------------------------------------------------------------------

how can i obtained this value given the 3 rasters and all the combinations above?

how to construct such if statement to deal with these raster?

is there any tool in ArcGIS to perform this?

thank you

regards
Jamal
----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
0 Kudos
4 Replies
JamalNUMAN
Legendary Contributor
Con
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z00000005000000.htm


Thank you for the answer Patterson.

i couldn't manage how to use the "Con" tool to fit my case! (attached).

the help doesn't show what I'm looking for...!

Could you please elaborate more how can i use this tool?

how can i use it to apply the first condition?

---------------------------------------------------------------------------------------------
if [Type] = "Forest" and [FlowType] = "TYPE D" and [Slope] = 1 then op = .8
---------------------------------------------------------------------------------------------

regards

Jamal
----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
0 Kudos
DanPatterson_Retired
MVP Emeritus
use "combine" to produce the unique conditions if you don't want to do the nested "con" statements, then query for your cases.  It is all documented in the help files
0 Kudos
JamalNUMAN
Legendary Contributor
use "combine" to produce the unique conditions if you don't want to do the nested "con" statements, then query for your cases.  It is all documented in the help files


Thank you Patterson.

i used the combine tool then i added a new field at which i applied the if statement. it did work

----------------------------------------------------------------------------------------------------
if [LANDUSE] = 1 then
          if [HYDRCOND] = 1 then
             Select Case [SLOPE]
    Case 1
       oo = .6
    Case 2
         oo =.4
    Case 3
        oo =.2
    Case Else
       oo =0
End Select
           else
          if [HYDRCOND] = 2 then
             Select Case [SLOPE]
    Case 1
       oo = .8
    Case 2
         oo =.4
    Case 3
        oo =.2
    Case Else
       oo =0
End Select

          end if
end if
else
if  [LANDUSE]  = 2 then
          if [HYDRCOND] = 1 then
             Select Case [SLOPE]
    Case 1
       oo = .8
    Case 2
         oo =.6
    Case 3
        oo =.4
    Case Else
       oo =0
End Select
           else
          if [HYDRCOND] = 2 then
             Select Case [SLOPE]
    Case 1
       oo = 1
    Case 2
         oo =.6
    Case 3
        oo =.4
    Case Else
       oo =0
End Select

end if
end if
end if
end if
---------------------------------------------------------------------------------------------------------
Regards

Jamal
----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
0 Kudos