<?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: Use Raster Calculator to Modify DEM Elevations based on a Mask in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70597#M970</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you need to decide whether to subtract or set the value based on the pixel position (different parts of the raster would be subtracted or set), or do you want to decide for the whole model (on one run you subtract all that meet a condition, and on the next you set all that meet a condition)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: it sounds like you want to apply your choice whether to subtract or set for the whole model. You can do this by adding a new variable (boolean or integer or some other flag) and nesting Con() statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con(newVariable = 1, &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Con(IsNull("%Mask_raster%"),"%Input_raster%", ("%Input_raster%" -float(%Double%))), &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Con(IsNull("%Mask_raster%"),"%Input_raster%", ("%Input_raster%"&amp;nbsp; == float(%Double%)))&lt;/SPAN&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...which translates to: if the value of newVariable = 1, do the subtract statement, else do the set statement. You could do this with a boolean checkbox, too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2015 20:04:28 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2015-09-15T20:04:28Z</dc:date>
    <item>
      <title>Use Raster Calculator to Modify DEM Elevations based on a Mask</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70592#M965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know its allmost the same question as "&lt;A href="https://community.esri.com/thread/121172"&gt;Use Raster Calculator to Modify DEM Elevations based on Vector Layer&lt;/A&gt;​but i am trying to build a model but i am stuck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="model.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/126821_model.png" style="width: 620px; height: 349px;" /&gt;&lt;/P&gt;&lt;P&gt;my first model, and i got that to work has this expression:&lt;/P&gt;&lt;P&gt;Con(IsNull("%Output_raster%"),float(%Double%), "%Output_raster%"). but this sets a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;what I now want is to subtract a value from the DEM using this model. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;can sameone help me with the right expressing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;Thank you and Greeting Peter&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2015 20:32:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70592#M965</guid>
      <dc:creator>PeterVersteeg</dc:creator>
      <dc:date>2015-09-14T20:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Use Raster Calculator to Modify DEM Elevations based on a Mask</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70593#M966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Con is confusing, but hopefully this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con(first, second, third) translates to: for each pixel, if the first thing is true, return the second thing. If the first thing is not true, return the third thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure I completely understand what you want to do, but if I'm right that you want to subtract a value (or raster) if it falls within a mask, and use the original value if not, then you should use an expression like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con(IsNull("mask"), "original", ("original" - some number or raster))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This expression translates to: check each pixel. If it is not in the mask (i.e. is null), use the original raster value. If the pixel is in the mask, subtract some value (or raster) from the original raster. Of course, change "some value or raster", to a value or raster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2015 20:54:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70593#M966</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-09-14T20:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Use Raster Calculator to Modify DEM Elevations based on a Mask</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70594#M967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-GB" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;Thank you Darren for this clear explanation&lt;/SPAN&gt;. Now I get it &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;SPAN lang="EN-GB" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;This model is for burning my water into a DEM.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-GB" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;This is my new model&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;IMG alt="model2.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/126860_model2.png" style="width: 620px; height: 278px;" /&gt;&lt;/P&gt;&lt;P&gt;The expression i use now is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con(IsNull("%Mask_raster%"),"%Input_raster%", ("%Input_raster%" -float(%Double%)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it works great. BUT I can only use it to subtract a value. I could think about a use for this model when I want to simply set a value. The expression would look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con(IsNull("%Mask_raster%"),"%Input_raster%", ("%Input_raster%"&amp;nbsp; == float(%Double%)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to choose between – (subtract) and == (set value) in a model?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;again thank you Darren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 04:34:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70594#M967</guid>
      <dc:creator>PeterVersteeg</dc:creator>
      <dc:date>2015-09-15T04:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Use Raster Calculator to Modify DEM Elevations based on a Mask</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70595#M968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just return the double thus :&lt;/P&gt;&lt;P&gt;Con(IsNull("%Mask_raster%"),"%Input_raster%", (float(%Double%)))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 07:21:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70595#M968</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2015-09-15T07:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Use Raster Calculator to Modify DEM Elevations based on a Mask</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70596#M969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry you did not understand me. your expression only sets a value. now i cannot subtract a value from my DEM with this expression. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i could make 2 models but is there a way to do both in 1 model?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gr Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 19:53:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70596#M969</guid>
      <dc:creator>PeterVersteeg</dc:creator>
      <dc:date>2015-09-15T19:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Use Raster Calculator to Modify DEM Elevations based on a Mask</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70597#M970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you need to decide whether to subtract or set the value based on the pixel position (different parts of the raster would be subtracted or set), or do you want to decide for the whole model (on one run you subtract all that meet a condition, and on the next you set all that meet a condition)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: it sounds like you want to apply your choice whether to subtract or set for the whole model. You can do this by adding a new variable (boolean or integer or some other flag) and nesting Con() statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con(newVariable = 1, &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Con(IsNull("%Mask_raster%"),"%Input_raster%", ("%Input_raster%" -float(%Double%))), &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Con(IsNull("%Mask_raster%"),"%Input_raster%", ("%Input_raster%"&amp;nbsp; == float(%Double%)))&lt;/SPAN&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...which translates to: if the value of newVariable = 1, do the subtract statement, else do the set statement. You could do this with a boolean checkbox, too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 20:04:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70597#M970</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-09-15T20:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Use Raster Calculator to Modify DEM Elevations based on a Mask</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70598#M971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;He Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your right this is what i want with this model. i understand the expression but setting the new variable is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i would like to use the boolean chack box. it is in my model as a precondition for the raster calculator. this do's not work. i did not change your expression. i think i need to set the boolean but do not know were or how.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you again for the help and the explanation. that the tools is not working is all on me &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;greetings Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 21:38:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70598#M971</guid>
      <dc:creator>PeterVersteeg</dc:creator>
      <dc:date>2015-09-15T21:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Use Raster Calculator to Modify DEM Elevations based on a Mask</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70599#M972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Darren, don't forget double equals:&amp;nbsp; ==&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also if you have a boolean model variable named CheckBox you can recast it to integer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Con( int("%CheckBox%") == 1,
&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Con(IsNull("Mask_raster")&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Input_raster", &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ("Input_raster" - float(%Double%))), &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Con(IsNull("Mask_raster"),&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Input_raster",&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; float(%Double%)))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:42:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/use-raster-calculator-to-modify-dem-elevations/m-p/70599#M972</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-10T22:42:52Z</dc:date>
    </item>
  </channel>
</rss>

