Select to view content in your preferred language

Con Statement help

763
2
12-04-2012 04:41 PM
MikeFazio
New Contributor
Hello,

I need to write a Con statement in the Raster Calculator tool and I am having difficulty with the structure.

I have two rasters, one being basal-area (basal.img) and the other being state parks (parks.img).

The value field for the basal.img is the amount of basal-area per acre reclassified as 1,2,3,4,5.  The value field for the state parks field is road distance from a certain point in miles.

I am attempting to write a statement where if Basal-area is >3 and if the distance to a state park is <80 then the resulting value would be 10, otherwise it would be 1.

Any help would be greatly appreciated, thanks!
0 Kudos
2 Replies
AndreuAres_Martin
Emerging Contributor
This is the structure:

con(basal_area >3, con(state_parks < 80, 10, 1), 1)

The structure of con is, con(statement, if true, if false)

Also, take into account if your rasters have null values, any value versus a null value, will be a null value.
0 Kudos
DanPatterson_Retired
MVP Emeritus
pay attention to case sensitivity and the need for brackets when using the Con statement ie
http://forums.arcgis.com/threads/20461-syntax-error-in-con-statement
0 Kudos