<?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 Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707564#M40085</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;From the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Raster_Calculator/009z000000z7000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS 10 Help&lt;/A&gt;&lt;SPAN&gt; page on the raster calculator:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Note:&lt;BR /&gt;&lt;BR /&gt;The Raster Calculator tool is intended for use in the ArcGIS Desktop application only as a GP tool dialog box or in ModelBuilder. It is not intended for use in scripting and is not available in the ArcPy Spatial Analyst module.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, you can use map algebra operators and functions directly in python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;E.g.&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from arcpy.sa import *
import arcpy

arcpy.CheckOutExtension("Spatial")
landmask=Raster(r'C:\SomeDirectory\landmask')
bathymetry=Raster(r'C:\SomeDirectory\bathy')

masked_bathymetry=Con(IsNull(landmask), bathymetry, 70000)
masked_bathymetry.save(r'C:\SomeDirectory\maskbath')&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 05:43:42 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2021-12-12T05:43:42Z</dc:date>
    <item>
      <title>raster calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707558#M40079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: luke.kaim&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Okay, I made a interpolated surface of bathymetry and it looks really good, but my problem is that it also interpolates values on land. How do I set the cells on land to be some arbitrary number like 70,000. I made a mask of the raster that are all cells on land, but now how do I merge them using the raster calculator such that all land values have the same arbitrary value? What I am trying to do should not be that hard. I think I am just struggling with the syntax. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke Kaim&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke Kaim (SIE)&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="mailto:Lucas.Kaim@maine.edu"&gt;Lucas.Kaim@maine.edu&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;(914)263-7866&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 21:15:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707558#M40079</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-11-18T21:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: raster calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707559#M40080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could set the Raster symbology to make anything over a certain value show up as a constant. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-or-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You could create a raster using your mask which has a large value over land and a 0 value over water, do a raster calculate to add those two together. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-or- &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you could Resample the dem and assign anything over a certain value a constant.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2011 20:14:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707559#M40080</guid>
      <dc:creator>AnthonyTimpson2</dc:creator>
      <dc:date>2011-11-21T20:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: raster calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707560#M40081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: lpinner&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like: Con(IsNull(landmask), bathymetry, 70000) in the raster calculator.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2011 23:43:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707560#M40081</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-11-24T23:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: raster calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707561#M40082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: luke.kaim&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much lpinner. I definitely owe you a beer. This is what I put in the Raster Calculator and it does the trick. Con(IsNull("%Ftoraster3%"),"%idw20meter2%", 70000)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would you or anyone else be able to explain in words what this expression means though? Is there a good online tutorial that discusses what con and IsNull?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 21:38:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707561#M40082</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-11-27T21:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: raster calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707562#M40083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Con means 'conditional', it's basically an if/else statement - see the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Con/009z00000005000000/"&gt;Con reference&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IsNull means just that, it determines which cells in the input raster have no data and which do - see &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Is_Null/009z000000m8000000/"&gt;IsNull reference&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So the raster calculator statement I gave you above means:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If a landmask cell has no data (is not land) then assign the value of the bathymetry raster (from the cell at the same coordinates) to the output raster, otherwise assign 70000 to that cell.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 22:00:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707562#M40083</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2011-11-27T22:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: raster calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707563#M40084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: luke.kaim&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does Raster calculator not work within Python and IDL?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I have, but it gives errors every time I try to run the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Ftoraster3 = "Ftoraster3"
FinRast_r = "finRast"



# Process: Feature to Raster
arcpy.FeatureToRaster_conversion(PolygonFeature, "FID", Ftoraster3, "20")


# Process: Raster Calculator
#arcpy.gp.RasterCalculator_sa("Con(IsNull(\"%Ftoraster3%\"),\"%idw20meter2%\", -1)", FinRast_r)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:43:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707563#M40084</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T05:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: raster calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707564#M40085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;From the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Raster_Calculator/009z000000z7000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS 10 Help&lt;/A&gt;&lt;SPAN&gt; page on the raster calculator:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Note:&lt;BR /&gt;&lt;BR /&gt;The Raster Calculator tool is intended for use in the ArcGIS Desktop application only as a GP tool dialog box or in ModelBuilder. It is not intended for use in scripting and is not available in the ArcPy Spatial Analyst module.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, you can use map algebra operators and functions directly in python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;E.g.&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from arcpy.sa import *
import arcpy

arcpy.CheckOutExtension("Spatial")
landmask=Raster(r'C:\SomeDirectory\landmask')
bathymetry=Raster(r'C:\SomeDirectory\bathy')

masked_bathymetry=Con(IsNull(landmask), bathymetry, 70000)
masked_bathymetry.save(r'C:\SomeDirectory\maskbath')&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:43:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/raster-calculator/m-p/707564#M40085</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-12-12T05:43:42Z</dc:date>
    </item>
  </channel>
</rss>

