<?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: Raster calculator in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178247#M2504</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The raster names shouldn't be in quotes if they are variable names&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Mar 2020 15:37:08 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2020-03-23T15:37:08Z</dc:date>
    <item>
      <title>Raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178246#M2503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear GIS experts. &lt;/P&gt;&lt;P&gt;I can't get my raster calculator expression to run.&lt;/P&gt;&lt;P&gt;I have two different raster datasets:&lt;/P&gt;&lt;P&gt;- wnb_near&lt;/P&gt;&lt;P&gt;- svo_near&lt;/P&gt;&lt;P&gt;I want to create a new raster. When the value of svo_near ist smaller than the value of wnb_near, I want to write the value of wnb_near in the new raster, otherwise the value of svo_near:&lt;/P&gt;&lt;P&gt;if svo_near &amp;lt; wnb_near, then wnb_near, else svo_near&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the following expression in the raster calculator:&lt;/P&gt;&lt;P&gt;Con("svo_near" &amp;lt; " wnb_near", "wnb_near", "svo_near")&lt;/P&gt;&lt;P&gt;It doesn't work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two raster datasets are attached. Could somebody please help? Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Barbara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 15:28:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178246#M2503</guid>
      <dc:creator>BarbaraImhof</dc:creator>
      <dc:date>2020-03-23T15:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178247#M2504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The raster names shouldn't be in quotes if they are variable names&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 15:37:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178247#M2504</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-23T15:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178248#M2505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see anything wrong with the statement, as it's in Raster Calculator not map algebra, the quotes are needed.&lt;/P&gt;&lt;P&gt;I would troubleshoot by performing some simple expressions on each raster to see if the rasters themselves are the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 16:11:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178248#M2505</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-03-23T16:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178249#M2506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never use the raster calculator &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;Anyway, I used the Combine tool to come up with a raster that you can reclassify.&lt;/P&gt;&lt;P&gt;You can see where wbn_near class 3 matches svo_near for 4567 cells, so that become the basis for the reclass&lt;/P&gt;&lt;P&gt;This would probably easier since you have a lot of areas don't overlap&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image" height="266" src="https://community.esri.com/legacyfs/online/485974_combine_sa.png" width="529" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 17:11:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178249#M2506</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-23T17:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178250#M2507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Barbara - so one of the problems I came across with the rasters and the raster calculator had to do with NULL values in the raster dataset.&amp;nbsp; Whenever I tried to do raster math the NULL values would mess with the output.&amp;nbsp; So here's the workflow I used to get what I think is the correct approach (I could be wrong!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Ran the CON geoprocessing tool twice to identify those NULL values in the svo_near and wnb_near raster datasets.&amp;nbsp; If NULL, calc that cell to be zero.&amp;nbsp; If not NULL then give the cells the original svo_near and wnb_near&amp;nbsp; cell values.&amp;nbsp; See Capture1 image.&amp;nbsp; 2 new raster datasets are created with the _NN (not null) suffix.&amp;nbsp; (svo_near_NN and wnb_near_NN)&lt;/LI&gt;&lt;LI&gt;Then I ran the Raster Calculator GP tool with the following syntax:&amp;nbsp; &amp;nbsp;Con(Raster("svo_near_NN") &amp;lt; ("wnb_near_NN"),"wnb_near_NN", "svo_near_NN")&amp;nbsp; See Capture2 image.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;With the new output raster dataset (rascal5), I did a few cell evaluations and it seemed to process correctly.&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/486010_Capture1.JPG" /&gt;&lt;IMG alt="" class="jive-emoji jive-image image-2 j-img-original" src="https://community.esri.com/legacyfs/online/486014_Capture2.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know what you discover.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 21:02:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178250#M2507</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2020-03-23T21:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178251#M2508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why is why combine then a reclass might be easier&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 21:11:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178251#M2508</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-23T21:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178252#M2509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Possibly - many ways to accomplish the same task I always say.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 22:06:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178252#M2509</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2020-03-23T22:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178253#M2510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting question and great answers by everybody.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As @Robert LeClair said, there are many ways to solve this problem. So, instead of getting into the solutions presented here, I would like to point out a few different things that could be relevant for getting the output @Barbara is looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Con Statement and the use of quotation:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Con("svo_near" &amp;lt; "wnb_near", "wnb_near", "svo_near")&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This statement is valid in Raster Calculator. (@Barbara Please note there is an extra space between " and the letter w in your statement, but I guess that's a typo).&lt;/P&gt;&lt;P&gt;However, if you want to execute this statement in Python window, or in a standalone python script, you need to cast your dataset as a raster as follows.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Con(Raster("svo_near") &amp;lt; Raster(" wnb_near"), "wnb_near", "svo_near")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was not clear to me what exactly @Barbara meant by "it doesn't work", but I can see the problem in the&amp;nbsp;Con output could happen for many reasons:&lt;/P&gt;&lt;P&gt;(1) The extent of these datasets are different&lt;/P&gt;&lt;P&gt;(2) The origin (lower-left) corners are different, may lead to cell misalignment between these two datasets&lt;/P&gt;&lt;P&gt;(3) The existence of NoData in both datasets (where one dataset has value and the other one has NoData).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;From the dataset properties I can see:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;wnb_near&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;Bottom: 1,225,582.880500&lt;BR /&gt;Letf: 2,671,897.064800&lt;BR /&gt;Columns: 4494&lt;BR /&gt;Rows: 5592&lt;BR /&gt;Cellsize: 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;svo_near&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;Bottom: 1,226,215.736100&lt;BR /&gt;Letf: 2,671,630.064800&lt;BR /&gt;Columns: 3431&lt;BR /&gt;Rows: 5425&lt;BR /&gt;Cellsize: 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Analysis Environment&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Since, I don't know which dataset extent is important for @Barbara, I am going to make the following assumptions for my analysis environment.&lt;/P&gt;&lt;P&gt;Extent: Union of Inputs&lt;/P&gt;&lt;P&gt;Cell Size: Same as wnb_near&lt;/P&gt;&lt;P&gt;Snap Raster: Same as wnb_near&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem Statement&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It seems like @Barbara is trying to get the maximum value of the two datasets (wnb_near and&amp;nbsp;&lt;BR /&gt;svo_near) in the output.&lt;/P&gt;&lt;P&gt;If that is correct, I can use the Cell Statistics tool to solve this problem. Why Cell Statistics? Because this tool has an option to ignore NoData during analysis, which will become really handy in this situation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note, all other approaches are valid and will produce accurate results as long as we take care of the extent, cell alignment and NoData.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Analysis&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(1) Set analysis environment&amp;nbsp;as stated above&lt;/P&gt;&lt;P&gt;(2) Run Cell Statistics tool with Maximum as Overlay Statistics&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="648" src="https://community.esri.com/legacyfs/online/486029_pastedImage_11.png" width="243" /&gt;&lt;IMG class="image-2 jive-image" height="272" src="https://community.esri.com/legacyfs/online/486030_pastedImage_12.png" width="258" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Analysis Output&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;named this output as max_wnb_svo. The output cover the extent of both datasets and carried over cell values from both inputs by ignoring NoData.&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Barbara, is this what you are looking for?&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" height="491" src="https://community.esri.com/legacyfs/online/486031_pastedImage_14.png" width="557" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Inputs&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Please notice the different in extent and origin.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;wnb_near&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-6 jive-image" height="488" src="https://community.esri.com/legacyfs/online/486034_pastedImage_20.png" width="553" /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;svo_near&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-5 jive-image" height="485" src="https://community.esri.com/legacyfs/online/486033_pastedImage_19.png" width="550" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Conclusion&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I may misunderstood the original problem stated by @Barbara and therefore, the output I created may not what @Barbara is looking for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I wanted to highlight the importance of the analysis extent and the cell alignment for any raster analysis and the need of&amp;nbsp; using Raster object in any map algebra expression outside of Raster Calculator. Also wanted to point out the "Ignore NoData in calculations" option in the Cell&amp;nbsp;Statistics tool, which becomes really handy in cases like this.&lt;/P&gt;&lt;P&gt;I hope, by considering all these, and all the other analytical options presented by others @Barbara will be able to&amp;nbsp;create the appropriate output.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Noman&amp;nbsp;&lt;/P&gt;&lt;P&gt;Esri, Redlands, California&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2020 05:48:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178253#M2510</guid>
      <dc:creator>NawajishNoman</dc:creator>
      <dc:date>2020-03-24T05:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Raster calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178254#M2511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear GIS experts&lt;/P&gt;&lt;P&gt;Thank you! I'm very thankful for your help and the time you put in your answers! With your help it works.&lt;/P&gt;&lt;P&gt;Stay well and again thanks&amp;nbsp; a lot&lt;/P&gt;&lt;P&gt;Barbara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2020 09:33:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator/m-p/178254#M2511</guid>
      <dc:creator>BarbaraImhof</dc:creator>
      <dc:date>2020-04-08T09:33:01Z</dc:date>
    </item>
  </channel>
</rss>

