<?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 Re: Performing if else condition on two raster layers in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459460#M6599</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you be a little more concise in explaining what you are trying to do?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Aug 2014 19:15:37 GMT</pubDate>
    <dc:creator>IanMurray</dc:creator>
    <dc:date>2014-08-26T19:15:37Z</dc:date>
    <item>
      <title>Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459459#M6598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I am working on a project and i am writing my scripts in python. However, i am experiencing an obstacle that might make me quit this project for good. Here is is the problem. I want to perform a if else condition on two raster layers that have constant values across all there grid. Initially, i create two raster layers, each with a constant value within each cell. However, when i perform a loop on these two raster layers, one of them at the end will have cells with different values and i need to loop in again to compare it with the other raster with a constant value. I tried using the "Con" tool but things have not worked at all.&amp;nbsp; Any clues please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 17:57:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459459#M6598</guid>
      <dc:creator>LawrenceSekaluvu</dc:creator>
      <dc:date>2014-08-26T17:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459460#M6599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you be a little more concise in explaining what you are trying to do?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 19:15:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459460#M6599</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-08-26T19:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459461#M6600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Definitely include what you have tried either within the Con statement or within your script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 20:28:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459461#M6600</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-08-26T20:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459462#M6601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi @Ian,&lt;/P&gt;&lt;P&gt; I want basically to perform a "if else" condition on each cell within a raster in python window environment. At first, i thought that i could get two raster layers (one with a constant value for all cells and the other with varying values within each cell) and insert the "if else" statement right away within the loop. This seems not to work out all. Lastly, I have some other three parameters that need to be calculated for each cell depending on whether the "if else" condition returns true or false.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 20:58:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459462#M6601</guid>
      <dc:creator>LawrenceSekaluvu</dc:creator>
      <dc:date>2014-08-26T20:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459463#M6602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please post your script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 21:07:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459463#M6602</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-08-26T21:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459464#M6603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Dan said, Con is the tool you want. A Python if/else statement will not process raster cell values cell by cell like you want to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 21:12:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459464#M6603</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-08-26T21:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459465#M6604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Dan,&lt;/P&gt;&lt;P&gt;I did that but when I use the Con statement, there is one moment when i have to compare a raster layer with all cells having the same value against a constant value, and In this case i get an error&amp;nbsp; message. However, if i perform the same Con condition on a raster layer with a range of cell values and specify the condition within the value range, it works out quite well with out bring any errors. May be there is some else hidden that i don't understand!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 21:18:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459465#M6604</guid>
      <dc:creator>LawrenceSekaluvu</dc:creator>
      <dc:date>2014-08-26T21:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459466#M6605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, you could convert a raster to an ascii, and compare cell values between the two ascii files, assuming they have the same extent.&amp;nbsp; You could even generate a new ascii based on if the values are the same, and convert it back to a raster by adding the header file from the original ascii to the output ascii(I actually have a project I'm working on that is based on this).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But yea, a conditional statement would be easier.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 21:21:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459466#M6605</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-08-26T21:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459467#M6606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is my script &lt;/P&gt;&lt;P&gt;""&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy&lt;/P&gt;&lt;P&gt;... from arcpy.sa import *&lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;... #calculating slope&lt;/P&gt;&lt;P&gt;... S = Slope("DEM","PERCENT_RISE","")&lt;/P&gt;&lt;P&gt;... H = S/100&lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;... #initialize parameters&lt;/P&gt;&lt;P&gt;... T = 10&lt;/P&gt;&lt;P&gt;... Temp = Times("DEM",0)&lt;/P&gt;&lt;P&gt;... M0 = Plus(Temp,0.2)&lt;/P&gt;&lt;P&gt;... fb = 0.345&lt;/P&gt;&lt;P&gt;... D = 2&lt;/P&gt;&lt;P&gt;... Cellsize = 2&lt;/P&gt;&lt;P&gt;... d1 = 0.21&lt;/P&gt;&lt;P&gt;... d2 = 0.01&lt;/P&gt;&lt;P&gt;... d3 = 0.31&lt;/P&gt;&lt;P&gt;... d4 = 0.4&lt;/P&gt;&lt;P&gt;... d5 = 0.395&lt;/P&gt;&lt;P&gt;... Kr = 2.0&lt;/P&gt;&lt;P&gt;... Kh = 0.004 &lt;/P&gt;&lt;P&gt;... for t in range (0, T):&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t += 1&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #first conditional statement&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C01 = Con("M0","M0","","VALUE &amp;gt;= fb") &lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C1 = Times(C01, 0)&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kv = (d1*(d2/d3)) + Kh&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Qv = Kv * H * Cellsize * D &lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; K1 = Plus(C1,Kv)&amp;nbsp; &lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Qh1 = Plus(C1,Qv) &lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #second conditional statement&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C02 = Con("M0","M0","","VALUE &amp;lt; fb")&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C2 = Times(C02, 0)&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ep = Exp((-13*(d4/d5)))&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kf = Kr * Ep&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Qf = Kf * H * Cellsize * D &lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; K2 = Plus(C2,Kf)&amp;nbsp; &lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Qh2 = Plus(C2,Qf) &lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; K = K1 + K2&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QT = Qh1 + Qh2&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mt = K + QT&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M0 = Mt&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print K, QT, Mt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ""&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 22:14:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459467#M6606</guid>
      <dc:creator>LawrenceSekaluvu</dc:creator>
      <dc:date>2014-08-26T22:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459468#M6607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would still like to see the Con statements you used AND the error message, which is probably the key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 22:36:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459468#M6607</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-08-26T22:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459469#M6608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your statement:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14090959237966844" jivemacro_uid="_14090959237966844"&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;C01 = Con("M0","M0","","VALUE &amp;gt;= fb")&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;should be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14090959147169975" jivemacro_uid="_14090959147169975"&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;C01 = Con("M0","M0","","VALUE &amp;gt;= " + str(fb))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and similarly for the second Con statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 23:32:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459469#M6608</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2014-08-26T23:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459470#M6609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why aren't you using real Python map algebra? For example, you're doing this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14091202075615304 jive_text_macro" jivemacro_uid="_14091202075615304"&gt;
&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Temp = Times("DEM",0)&lt;/P&gt;
&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;M0 = Plus(Temp,0.2)&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Python Map algebra takes advantage of the Raster object and overtyping of operators to write straightforward expressions like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14091206217007079 jive_text_macro" jivemacro_uid="_14091206217007079"&gt;
&lt;P&gt;M0 = Raster("DEM") * 0 + 0.2&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which if course, begs the question, why are you zeroing out every cell of your DEM before you add 0.2 to it?&lt;/P&gt;&lt;P&gt;Map Algebra is a lot easier to debug than using the tools directly (Plus, Times, etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's another example:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14091212131228057 jive_text_macro" jivemacro_uid="_14091212131228057" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 9pt !important;"&gt;&lt;SPAN style="color: #000000; font-size: 9pt !important;"&gt;C01 = Con(&lt;/SPAN&gt;&lt;SPAN class="string" style="color: blue; font-size: 9pt !important;"&gt;"M0"&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 9pt !important;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string" style="color: blue; font-size: 9pt !important;"&gt;"M0"&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 9pt !important;"&gt;,"&lt;/SPAN&gt;&lt;SPAN class="string" style="color: blue; font-size: 9pt !important;"&gt;","&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 9pt !important;"&gt;VALUE &amp;gt;= " + str(fb))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 9pt !important;"&gt;Using map algebra on the raster object m0 created above:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14091212816023562" jivemacro_uid="_14091212816023562"&gt;
&lt;P&gt;C01 = Con(m0 &amp;gt;= fb, m0) &lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 06:24:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459470#M6609</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-08-27T06:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459471#M6610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Ian,&lt;/P&gt;&lt;P&gt;Thanks, let me try out that and see whether it will work out quite well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 15:12:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459471#M6610</guid>
      <dc:creator>LawrenceSekaluvu</dc:creator>
      <dc:date>2014-08-27T15:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459472#M6611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the error message i get&lt;/P&gt;&lt;P&gt;""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;ERROR &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #94d666;"&gt;999999&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;: Error executing function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;The table was not found. [VAT_Con_plus_ras1]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;A column was specified that does not exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;A column was specified that does not exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;The table was not found. [VAT_Con_plus_ras1]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;The operation was attempted on an empty geometry.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;ERROR &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #307b32;"&gt;010416&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;: Error in setting raster table filter for D:\Codetrial\Cond.gdb\plus_ras2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;ERROR &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #307b32;"&gt;010213&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;: Error in reading raster M0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;ERROR &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #307b32;"&gt;010325&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;: Run-time error - ***.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;ERROR &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #307b32;"&gt;010067&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;: Error in executing grid expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #e60000;"&gt;Failed to execute (Con). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; """&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 15:14:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459472#M6611</guid>
      <dc:creator>LawrenceSekaluvu</dc:creator>
      <dc:date>2014-08-27T15:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459473#M6612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmmmm quick guess...it is a floating point raster, hence it has no table, hence no field named value so you can't query a value field&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 16:42:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459473#M6612</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-08-27T16:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459474#M6613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just checked it out, Dan. I get Lawrence's exact error message by leaving the variable name inside the where clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14091583251205371 jive_text_macro" jivemacro_uid="_14091583251205371"&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; val = 580&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; C = arcpy.sa.Con("block_dem_1m.tif","block_dem_1m.tif","","VALUE &amp;gt; val")&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;... but not like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14091583175943193" jivemacro_uid="_14091583175943193"&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; C = arcpy.sa.Con("block_dem_1m.tif","block_dem_1m.tif","","VALUE &amp;gt; " + str(val))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above is a floating raster, with no table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 16:51:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459474#M6613</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2014-08-27T16:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459475#M6614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rules that out then...thanks for the update and you appear to be correct about the " locations&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 17:10:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459475#M6614</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-08-27T17:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459476#M6615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Darren, i have tried out that and it works well with a raster having a range of values a cross the grid cells. However, it doesn't work out for rasters with a constant value across the cells. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 17:29:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459476#M6615</guid>
      <dc:creator>LawrenceSekaluvu</dc:creator>
      <dc:date>2014-08-27T17:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459477#M6616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean something like this doesn't work, or something else entirely?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14091610718051738 jive_text_macro" jivemacro_uid="_14091610718051738"&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;C01 = Con("M0","M0","","VALUE == " + str(fb))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As always, please post your script so we can better see what you're talking about.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 17:38:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459477#M6616</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2014-08-27T17:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Performing if else condition on two raster layers</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459478#M6617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;If I understand the problem correctly I would do the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="color: #1f497d;"&gt;Multiply each raster by say 1000 (or whatever you decide on) because COMBINE will INT the values&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #1f497d;"&gt;Use COMBINE&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Have a look at the &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z0000007r000000.htm"&gt;COMBINE &lt;/A&gt;tool and decide if this will do the job.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;-Steve&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 22:33:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/performing-if-else-condition-on-two-raster-layers/m-p/459478#M6617</guid>
      <dc:creator>SteveLynch</dc:creator>
      <dc:date>2014-08-27T22:33:25Z</dc:date>
    </item>
  </channel>
</rss>

