<?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: calculate Altitude difference in a Raster in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14889#M243</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot for the answers, i think it should work with the "Con" tool. I am working on global scale therefore my DEM is a Mosaic Raster dataset. So i have troubles with the "path and name to your dem" thing in the python code... how do i define the path to a Mosaic raster dataset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 04 Jan 2015 12:50:19 GMT</pubDate>
    <dc:creator>flohBärtschi</dc:creator>
    <dc:date>2015-01-04T12:50:19Z</dc:date>
    <item>
      <title>calculate Altitude difference in a Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14885#M239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey, &lt;/P&gt;&lt;P&gt;I should know, if in my 100 by 100km grid cell is an altitude difference of 1000m. each grid cell that has at least that much difference schould get the value 1, all others the value 0.&lt;/P&gt;&lt;P&gt;I start with a SRTM DEM with 90m resolution, and a grid with 100km resolution. &lt;/P&gt;&lt;P&gt;which is the appropriate tool for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Floh &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in German:&lt;/P&gt;&lt;P&gt;Hallo,&lt;/P&gt;&lt;P&gt;Ich habe folgende Frage:&lt;/P&gt;&lt;P&gt;Ich möchte in einer 100x100km Rasterzelle wissen, ob es mindestens 1000m Höhenunterschied hat. Jedes Raster, welches die bedingung erfüllt soll den wert 1 bekommen, alle anderen den wert 0.&lt;/P&gt;&lt;P&gt;als Grundlage dafür habe ich ein DEM mit 90m Auflösung, (SRTM) und eine Rasterdatei mit 100km auflösung.&lt;/P&gt;&lt;P&gt;nach welchem tool soll ich suchen?&lt;/P&gt;&lt;P&gt;Besten Dank für eure tipps&lt;/P&gt;&lt;P&gt;Floh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Dec 2014 08:39:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14885#M239</guid>
      <dc:creator>flohBärtschi</dc:creator>
      <dc:date>2014-12-28T08:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: calculate Altitude difference in a Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14886#M240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you looking for a local difference or determining those extreme cells with highest and lowest values?&lt;/P&gt;&lt;P&gt;For local differences you could use the Focal Statistics tool with the range statistic type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case of the determining the highest and lowest you could use some simple python code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy.sa import *

dem = r"path\and\name\to\your\dem"
ras = arcpy.Raster(dem)
dem_min = ras.minimum
dem_max = ras.maximum

result = Con((ras - dem_min) &amp;gt;= 1000, 1, Con((dem_max - ras) &amp;gt;= 1000), 1, 0)
result.saveas(r"path\and\name\to\your\output raster")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:35:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14886#M240</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T20:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: calculate Altitude difference in a Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14887#M241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't know python code you can use tool : Con &lt;A href="http://resources.arcgis.com/fr/help/main/10.2/index.html#//009z00000005000000" title="http://resources.arcgis.com/fr/help/main/10.2/index.html#//009z00000005000000"&gt;Aide ArcGIS (10.2, 10.2.1 et 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 11:24:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14887#M241</guid>
      <dc:creator>Jean-PierreDEBOOS1</dc:creator>
      <dc:date>2014-12-29T11:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: calculate Altitude difference in a Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14888#M242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or the link to the German Help page would be: &lt;A href="http://resources.arcgis.com/de/help/main/10.2/index.html#//009z00000005000000" title="http://resources.arcgis.com/de/help/main/10.2/index.html#//009z00000005000000"&gt;ArcGIS-Hilfe (10.2, 10.2.1 und 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 15:41:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14888#M242</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-12-29T15:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: calculate Altitude difference in a Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14889#M243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot for the answers, i think it should work with the "Con" tool. I am working on global scale therefore my DEM is a Mosaic Raster dataset. So i have troubles with the "path and name to your dem" thing in the python code... how do i define the path to a Mosaic raster dataset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Jan 2015 12:50:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14889#M243</guid>
      <dc:creator>flohBärtschi</dc:creator>
      <dc:date>2015-01-04T12:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: calculate Altitude difference in a Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14890#M244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good point... that is a little more complex and I'm not sure if you can convert the mosaic raster dataset to a raster object... This is what I did (and I corrected some errors in the code):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os
from arcpy.sa import *
arcpy.env.overwriteOutput = True
ws = r"C:\Forum\rasCat\bla.gdb"

arcpy.CheckOutExtension("Spatial")

mosa = os.path.join(ws, "mosa")
dem = os.path.join("IN_MEMORY", "dem01")
arcpy.CopyRaster_management(in_raster=mosa,out_rasterdataset=dem,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; config_keyword="#",background_value="#",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nodata_value="-3,402823e+038",onebit_to_eightbit="NONE",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; colormap_to_RGB="NONE",pixel_type="#",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scale_pixel_value="NONE",RGB_to_Colormap="NONE")

ras = arcpy.Raster(dem)
dem_min = ras.minimum
dem_max = ras.maximum
print dem_min, dem_max

result = Con((ras - dem_min) &amp;gt;= 1000, 1, Con((dem_max - ras) &amp;gt;= 1000, 2, 0))
result.save(os.path.join(ws, "outras01"))

arcpy.CheckInExtension("Spatial")&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ws contains the path to the file geodatabase.&lt;/LI&gt;&lt;LI&gt;mosa is the path to the mosaic dataset in the file geodatabase&lt;/LI&gt;&lt;LI&gt;dem is a intermediate raster, result from converting the mosaic dataset to a raster (in memory)&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:36:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14890#M244</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T20:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: calculate Altitude difference in a Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14891#M245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;nice try, but my DEM-mosaic is like 150GB big, so i can't copy it into my memory...&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV class="dp-highlighter"&gt;&lt;DIV class="bar"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;OL class="dp-py" start="1"&gt;&lt;LI class="alt"&gt;&lt;SPAN style="line-height: 12pt;"&gt;mosa = os.path.join(ws, &lt;/SPAN&gt;&lt;SPAN class="string" style="line-height: 12pt;"&gt;"mosa"&lt;/SPAN&gt;&lt;SPAN style="line-height: 12pt;"&gt;)&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="alt"&gt;&lt;SPAN&gt;dem = os.path.join(&lt;SPAN class="string"&gt;"IN_MEMORY"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class="string"&gt;"dem01"&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;P&gt;when i tried it the&amp;nbsp; "ERROR 000426: Out Of Memory Failed to execute (CopyRaster)." occurred.&lt;/P&gt;&lt;P&gt;Do you have another idea? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 08:35:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14891#M245</guid>
      <dc:creator>flohBärtschi</dc:creator>
      <dc:date>2015-01-05T08:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: calculate Altitude difference in a Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14892#M246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you considered the Aggregate tool? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the tool Environments button and set the processing cell size to 100 and explicitly set the extent so the lower left corner aligns with your 100,000-m grid cells. Then run Aggregate with a factor of 1000 to process each block. There is no RANGE option but you could run the tool with MINIMUM and MAXIMUM to make two 100km grids which you can then subtract.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have this 100km min and max grids calculated, you can subtract and classify as 1,0 in a single step using the Raster Calculator. (No script coding!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14204769566389640 jive_text_macro" jivemacro_uid="_14204769566389640" modifiedtitle="true"&gt;&lt;P&gt;Con(("max100" - "min100") &amp;gt; 1000, 1, 0)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test with a small extent first, as this processing may take quite a while. 150GB is a lot of data. You may even need to run your analysis in extent pieces to get it to work, and merge the results together using the Mosaic tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 16:52:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14892#M246</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-01-05T16:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: calculate Altitude difference in a Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14893#M247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, 150 GBs is a little big to load into memory. See the answer by &lt;A href="https://community.esri.com/migrated-users/3355"&gt;Curtis Price&lt;/A&gt;‌ for alternative methods. Remember that the resulting raster will be big too...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 23:27:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-altitude-difference-in-a-raster/m-p/14893#M247</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-01-05T23:27:24Z</dc:date>
    </item>
  </channel>
</rss>

