<?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 dem analysis in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7364#M144</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm having trouble with what I think should be a relatively straightforward analysis of 10 meter dem data.&amp;nbsp; If you have a minute, could you offer any suggestions.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to calculate a sort of "exposure" score for every cell in a raster.&amp;nbsp; The basic idea is to compare the value of each raster cell with those nearby(200-400m radius).&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;E1= (# cells in surrounding area with elev.&amp;lt; cell&amp;nbsp; elev.)/(# cells in surrounding area with elev.&amp;gt; cell&amp;nbsp; elev.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;E2= (sum[cell elev.-(elev.of surrounding cells&amp;lt;gage&amp;nbsp; elev.)])/(sum[(elev.of surrounding cells&amp;gt;cell&amp;nbsp; elev.)-cell elev.])&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For both indices, larger values represent locations with greater exposure and smaller values represent more protected, less exposed locations.&amp;nbsp; For instance, the E1 value for a location on top of a cone would be infinity, while that for the low point of an inverted cone would be 0.&amp;nbsp; I've been able to compute these indices for a small number of point locations using a combination of buffer and zonal tools.&amp;nbsp; Unfortunately, I'm now trying to perform this analysis for every cell in a much larger area(2-3 thousand cells) and my original method is no longer feasible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would greatly appreciate any suggestion you could offer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;spencer&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Nov 2013 19:43:12 GMT</pubDate>
    <dc:creator>spencersawaske</dc:creator>
    <dc:date>2013-11-06T19:43:12Z</dc:date>
    <item>
      <title>dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7364#M144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm having trouble with what I think should be a relatively straightforward analysis of 10 meter dem data.&amp;nbsp; If you have a minute, could you offer any suggestions.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to calculate a sort of "exposure" score for every cell in a raster.&amp;nbsp; The basic idea is to compare the value of each raster cell with those nearby(200-400m radius).&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;E1= (# cells in surrounding area with elev.&amp;lt; cell&amp;nbsp; elev.)/(# cells in surrounding area with elev.&amp;gt; cell&amp;nbsp; elev.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;E2= (sum[cell elev.-(elev.of surrounding cells&amp;lt;gage&amp;nbsp; elev.)])/(sum[(elev.of surrounding cells&amp;gt;cell&amp;nbsp; elev.)-cell elev.])&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For both indices, larger values represent locations with greater exposure and smaller values represent more protected, less exposed locations.&amp;nbsp; For instance, the E1 value for a location on top of a cone would be infinity, while that for the low point of an inverted cone would be 0.&amp;nbsp; I've been able to compute these indices for a small number of point locations using a combination of buffer and zonal tools.&amp;nbsp; Unfortunately, I'm now trying to perform this analysis for every cell in a much larger area(2-3 thousand cells) and my original method is no longer feasible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would greatly appreciate any suggestion you could offer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;spencer&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 19:43:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7364#M144</guid>
      <dc:creator>spencersawaske</dc:creator>
      <dc:date>2013-11-06T19:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7365#M145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Spencer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that using &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z00000028000000" rel="nofollow noopener noreferrer" target="_blank"&gt;numpy&lt;/A&gt;&lt;SPAN&gt; should be the way to go here. There is not much help on using numpy in ArcGIS, but I came across a nice &lt;/SPAN&gt;&lt;A href="http://shreshai.blogspot.nl/2011/07/utilizing-numpy-to-perform-complex-gis.html" rel="nofollow noopener noreferrer" target="_blank"&gt;blog post&lt;/A&gt;&lt;SPAN&gt; that explains some of the basics. I tried to calculate the E1 and E2 (see script and results below).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from numpy import *

# based on 
blog post:
# http://shreshai.blogspot.nl/2011/07/utilizing-numpy-to-perform-complex-gis.html

# input and output rasters
inputDEM = r'C:\Project\_Forums\numpy\grd\dem'
outRasE1 = r'C:\Project\_Forums\numpy\grd\dem01E1'
outRasE2 = r'C:\Project\_Forums\numpy\grd\dem01E2'
outRasAlt = r'C:\Project\_Forums\numpy\grd\dem01alt'

# determine dimensions of array
myArray = arcpy.RasterToNumPyArray(inputDEM)
[rows,cols]= myArray.shape

# cellsize = 10m, distance of 200m = 20, window size will be 41
# half the window size (20 = 20 pixels * 10m/pixel = 200 meters, moving window = 420 * 420)
winhalf = 20 

# provide value in case of division by zero
infE1 = (winhalf * 2 + 1)^2
infE2 = (winhalf * 2 + 1)^2 * myArray.max()

IE1=zeros((cols,rows))
IE2=zeros((cols,rows))
Ialt=zeros((cols,rows))

cnt = 0
for r in range(0,rows):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if r % 10 == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Processing row:{0}".format(r)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for c in range (1,cols):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cnt+=1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = myArray[r,c]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r1 = r - winhalf
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if r1 &amp;lt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r1 = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r2 = r + winhalf
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if r2 &amp;gt; rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r2=rows

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c1 = c - winhalf
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if c1 &amp;lt; 1:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c1 = 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c2 = c + winhalf
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if c2 &amp;gt; cols:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c2 = cols

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # size is number of pixels in moving window
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size = (r2-r1+1) * (c2-c1+1)


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # E1= (# cells in surrounding area with elev.&amp;lt; cell elev.)/(# cells in surrounding area with elev.&amp;gt; cell elev.)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = myArray[r1:r2+1,c1:c2+1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; indicesGT = where(data&amp;gt;value,ones(data.shape),zeros(data.shape))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; indicesLT = where(data&amp;lt;value,ones(data.shape),zeros(data.shape))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outGT = sum(indicesGT)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outLT = sum(indicesLT)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if outGT == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outValE1 = infE1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outValE1 = outLT / outGT


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # E2= (sum[cell elev.-(elev.of surrounding cells&amp;lt;gage elev.)])/(sum[(elev.of surrounding cells&amp;gt;cell elev.)-cell elev.])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; indicesGTE2 = where(data&amp;gt;value,data - (ones(data.shape)*value),zeros(data.shape))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; indicesLTE2 = where(data&amp;lt;value,(ones(data.shape)*value) - data,zeros(data.shape))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outGTE2 = sum(indicesGTE2)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outLTE2 = sum(indicesLTE2)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if outGTE2 == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outValE2 = infE2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outValE2 = outLTE2 / outGTE2


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # alternative output value could be:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # percentage of pixels in neighborhood with value higher than pixel value
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; indices = where(data&amp;gt;value,ones(data.shape),zeros(data.shape))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outVal = sum(indices)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outPerc = outVal * 100 / size


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # assign values to output array
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IE1[c,r] = outValE1 # E1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IE2[c,r] = outValE2 # E2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ialt[c,r] = outPerc


# transpose
I2E1 = IE1.transpose()
I2E2 = IE2.transpose()
I2Alt = Ialt.transpose()

# retrieve meta from input raster
descData=arcpy.Describe(inputDEM)
cellSize=descData.meanCellHeight
extent=descData.Extent
spatialReference=descData.spatialReference
pnt=arcpy.Point(extent.XMin,extent.YMin)

#E1
newRasterE1 = arcpy.NumPyArrayToRaster(I2E1,pnt, cellSize,cellSize)
newRasterE1.save(outRasE1)

#E2
newRasterE2 = arcpy.NumPyArrayToRaster(I2E2,pnt, cellSize,cellSize)
newRasterE2.save(outRasE2)

#Alternative
newRasterAlt = arcpy.NumPyArrayToRaster(I2Alt,pnt, cellSize,cellSize)
newRasterAlt.save(outRasAlt)

print "ready..."&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Result of analysis E1&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]29001[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In E2 there will be an nasty effect at the bottom and right side, since no compensation is applied for the reduction in the moving window size.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Result of alternative&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;As an alternative it might be interesting to look at the percentage of pixels in the neighborhood with a cell value higher than the value of the central pixel. This shows drainage with dark red colors and ridges in green. Don't know if this is useful...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]29002[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Some useful links:&lt;/STRONG&gt;&lt;BR /&gt;&lt;A href="http://shreshai.blogspot.nl/2011/07/utilizing-numpy-to-perform-complex-gis.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://shreshai.blogspot.nl/2011/07/utilizing-numpy-to-perform-complex-gis.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://wiki.scipy.org/Tentative_NumPy_Tutorial" rel="nofollow noopener noreferrer" target="_blank"&gt;http://wiki.scipy.org/Tentative_NumPy_Tutorial&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//018v00000023000000" rel="nofollow noopener noreferrer" target="_blank"&gt;RasterToNumPyArray (arcpy)&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//018v0000005n000000" rel="nofollow noopener noreferrer" target="_blank"&gt;NumPyArrayToRaster (arcpy)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:18:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7365#M145</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T20:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7366#M146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Xander,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wow, thank you so much for putting so much time into this.&amp;nbsp; I am incredibly impressed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-spencer&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 13:42:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7366#M146</guid>
      <dc:creator>spencersawaske</dc:creator>
      <dc:date>2013-11-11T13:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7367#M147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Xander,&lt;BR /&gt;&lt;BR /&gt;Wow, thank you so much for putting so much time into this.&amp;nbsp; I am incredibly impressed.&lt;BR /&gt;&lt;BR /&gt;-spencer&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Spencer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm glad I could be of any assistance. If you think it was helpful you&amp;nbsp;&amp;nbsp; can use the "arrow" button in order to help other&amp;nbsp; members find useful&amp;nbsp; information:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://forums.arcgis.com/attachment.php?attachmentid=27933&amp;amp;d=1380632266&amp;amp;thumb=1" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;More info here: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/forums-mvp/"&gt;http://resources.arcgis.com/en/help/forums-mvp/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 13:45:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7367#M147</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2013-11-11T13:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7368#M148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Xander,&lt;BR /&gt;&lt;BR /&gt;Wow, thank you so much for putting so much time into this.&amp;nbsp; I am incredibly impressed.&lt;BR /&gt;&lt;BR /&gt;-spencer&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;+1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I find your posts very helpful Xander &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Kudos!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 01:29:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7368#M148</guid>
      <dc:creator>TimBarnes</dc:creator>
      <dc:date>2013-11-14T01:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7369#M149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Incidently E2 looks like it might come in very handy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been wanting to learn python for ages but just never get the time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How would I go about running this code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 10:57:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7369#M149</guid>
      <dc:creator>808707</dc:creator>
      <dc:date>2013-11-20T10:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7370#M150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The code is a standalone script and you can run it from any &lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2013/06/24/choosing-the-right-python-integrated-development-environment/" rel="nofollow noopener noreferrer" target="_blank"&gt;Python IDE&lt;/A&gt;&lt;SPAN&gt;. You can also load this into the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/What_is_the_Python_window/002100000017000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;Python window&lt;/A&gt;&lt;SPAN&gt; in ArcMap. This is done with the Load command (&lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Customizing_the_Python_window/00210000001s000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;context sensitive menu&lt;/A&gt;&lt;SPAN&gt; of the Python window).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Make sure you adjust the names and paths to the datasets before you load the script into the Python window. I'm referring to the following lines of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;inputDEM = r'C:\Project\_Forums\numpy\grd\dem'
outRasE1 = r'C:\Project\_Forums\numpy\grd\dem01E1'
outRasE2 = r'C:\Project\_Forums\numpy\grd\dem01E2'
outRasAlt = r'C:\Project\_Forums\numpy\grd\dem01alt'
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:18:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7370#M150</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T20:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7371#M151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Great thanks Xander. I'll give it a go and let you know how it goes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 14:05:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7371#M151</guid>
      <dc:creator>808707</dc:creator>
      <dc:date>2013-11-21T14:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7372#M152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello. I was wondering if I could get a bit of help with this code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been trying to run it in PyScripter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm getting the following error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TypeError: unsupported operand type(s) for ^: 'int' and 'numpy.float64'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2013 10:11:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7372#M152</guid>
      <dc:creator>808707</dc:creator>
      <dc:date>2013-11-29T10:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7373#M153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello. I was wondering if I could get a bit of help with this code?&lt;BR /&gt;&lt;BR /&gt;I've been trying to run it in PyScripter.&lt;BR /&gt;&lt;BR /&gt;I'm getting the following error message:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;TypeError: unsupported operand type(s) for ^: 'int' and 'numpy.float64'&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure if this helps, but in this thread:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/54169-PyScripter-Question"&gt;http://forums.arcgis.com/threads/54169-PyScripter-Question&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;... they say that you need to use the 32 bits version of PyScripter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2013 11:42:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7373#M153</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2013-11-29T11:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7374#M154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ahh great thanks for the help Xander. I'll download the 32 bit version and see if that works.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2013 13:47:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7374#M154</guid>
      <dc:creator>808707</dc:creator>
      <dc:date>2013-11-29T13:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7375#M155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello again. It looks like I got it working. I installed the 32 bit PyScripter and got the same error again. However I realised my DEM had a cell type of float and converted it to an integer and it seems to work okay with a cell size of 10m.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However I would like to see if this will work with a cell size of 0.2m. I tried this and a memory allocation error occurs. The same happened with 1m. Is there a limit to the resolution of the raster?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This got me thinking to this part of the code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# cellsize = 10m, distance of 200m = 20, window size will be 41
# half the window size (20 = 20 pixels * 10m/pixel = 200 meters, moving window = 420 * 420)
winhalf = 20&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was wondering how you calculated that the window size will be 41? and the winhalf will equal 20?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:18:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7375#M155</guid>
      <dc:creator>808707</dc:creator>
      <dc:date>2021-12-10T20:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7376#M156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Mark,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically the initial idea was a search distance of 200m (actually 200-400m, but I wanted to keep the array small). If you have a pixels size of 10m, a distance of 200m will be 20 pixels. So twenty pixels on each side means 20 * 2 = 40. When using filters and similar calculations, one uses an impair number of pixels to have a central pixel (the one where the value will be assigned). This is why the size is 41 pixels (2 * 20 + 1) and the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;winhalf&lt;/SPAN&gt;&lt;SPAN&gt; is 20 pixels.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 13:25:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7376#M156</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2013-12-02T13:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: dem analysis</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7377#M157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Xander. Thanks very much for the information. I'll play around with this some more and see what I can do.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 13:48:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/dem-analysis/m-p/7377#M157</guid>
      <dc:creator>808707</dc:creator>
      <dc:date>2013-12-02T13:48:32Z</dc:date>
    </item>
  </channel>
</rss>

