Raster Calculator: Con tool expression error

549
1
10-06-2011 02:49 PM
Vincentvan_Exel
New Contributor
Hi,

I am a ArcGIS 10 user and I am trying to calculate between a series of points the equidistant lines on a cost surface.
For Point1 and Point2 I have calculated the cost surfaces 1_Cost and 2_Cost. Now I want to create a new raster that gives the value "1" to raster cells that are "closer" to Point1 and "2" to those closer to Point2.
I tried to do this with the Raster Calculater (Spatial Analyst) tool, but I keep getting syntax errors. If I understand correctly the syntax that I should use in the Raster Calculator looks like this:

Con (in_conditional_raster, in_true_raster_or_constant, {in_false_raster_or_constant}, {where_clause})

But I get an expression error when I enter:
Con ("Cost1", "1", {"2"}, {"Cost1" < "Cost2"})

What would the correct syntax look like?
Thanks in advance for your efforts!
0 Kudos
1 Reply
Luke_Pinner
MVP Regular Contributor
The curly braces indicate optional parameters and are not part of the syntax, this is documented in the help - http://help.arcgis.com/en/arcgisdesktop/10.0/help/002t/002t00000011000000.htm

The correct syntax would be something like: Con ( "Cost1" < "Cost2", "1", "2")
0 Kudos