<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Con statement error in raster calculator in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/con-statement-error-in-raster-calculator/m-p/112964#M1577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to pull out the cells from 2 8-bit integer rasters (same area, different years) that have the same value. The raster calculator statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Con("raster1" == 61 &amp;amp; "raster2" == 61, 1, 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error: rcexec()&amp;lt;type 'exceptions.ValueError'&amp;gt;: The truth value of a raster is ambiguous.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These are FGDB rasters, but I get the same results with grids. I've also tried this on a couple of different computers, and I've created a couple of similar random rasters with the same results. If I break the statement down into simple one (ie Con("raster1" == 61, 1, 0)) it will run.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One possibility is that the raster properties&amp;nbsp; report both rasters as having a continous data type rather than discrete. I'm not sure how to change that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know I can do some reclass work arounds, but I'm at the beginning of a modelling project, and I am hoping to build some more complex Con statements. Any advice is welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working with ArcGIS 10 Arcinfo on 64-bit Windows 7.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Sep 2010 02:14:13 GMT</pubDate>
    <dc:creator>RichardRupp</dc:creator>
    <dc:date>2010-09-18T02:14:13Z</dc:date>
    <item>
      <title>Con statement error in raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/con-statement-error-in-raster-calculator/m-p/112964#M1577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to pull out the cells from 2 8-bit integer rasters (same area, different years) that have the same value. The raster calculator statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Con("raster1" == 61 &amp;amp; "raster2" == 61, 1, 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error: rcexec()&amp;lt;type 'exceptions.ValueError'&amp;gt;: The truth value of a raster is ambiguous.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These are FGDB rasters, but I get the same results with grids. I've also tried this on a couple of different computers, and I've created a couple of similar random rasters with the same results. If I break the statement down into simple one (ie Con("raster1" == 61, 1, 0)) it will run.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One possibility is that the raster properties&amp;nbsp; report both rasters as having a continous data type rather than discrete. I'm not sure how to change that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know I can do some reclass work arounds, but I'm at the beginning of a modelling project, and I am hoping to build some more complex Con statements. Any advice is welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working with ArcGIS 10 Arcinfo on 64-bit Windows 7.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Sep 2010 02:14:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/con-statement-error-in-raster-calculator/m-p/112964#M1577</guid>
      <dc:creator>RichardRupp</dc:creator>
      <dc:date>2010-09-18T02:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Con statement error in raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/con-statement-error-in-raster-calculator/m-p/112965#M1578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;the expression parser seems to require ( ) to separate the different conditions before and after &amp;amp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ie&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Con(("polynom2" == 5)&amp;nbsp; &amp;amp; ("logistic" == 5), 1, 0)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Sep 2010 13:27:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/con-statement-error-in-raster-calculator/m-p/112965#M1578</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2010-09-18T13:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Con statement error in raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/con-statement-error-in-raster-calculator/m-p/112966#M1579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, Dan! That was one combination of parentheses that I had overlooked. That gave me the results I expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although it is entirely possible I missed it, I don't think this syntax shows up in the ArcGIS documention.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 15:11:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/con-statement-error-in-raster-calculator/m-p/112966#M1579</guid>
      <dc:creator>RichardRupp</dc:creator>
      <dc:date>2010-09-20T15:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Con statement error in raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/con-statement-error-in-raster-calculator/m-p/112967#M1580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No unfortunately it doesn't...you should forward this thread as an "issue" to tech support.&amp;nbsp; There is a tendancy to show simple examples and not complex ones.&amp;nbsp; I don't know if this would classify as a bug, but one would expect &amp;amp; (or any other boolean) to parse the left and the right correctly without the need for brackets.&amp;nbsp; Otherwise indicate said information (via an example perhaps) in the online help files.&amp;nbsp; I would also suggest that everyone use the online help rather than the arcmap help since it is updated and the built-in help is static&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for version 10&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html?TopicName=welcome"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html?TopicName=welcome&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;for 9.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=welcome"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=welcome&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;for previous versions substitute your version number in the appropriate spot.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 17:24:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/con-statement-error-in-raster-calculator/m-p/112967#M1580</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2010-09-20T17:24:41Z</dc:date>
    </item>
  </channel>
</rss>

