<?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: Create Neighborhood with Numpy array to calculate slope in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/create-neighborhood-with-numpy-array-to-calculate/m-p/410153#M13911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perhaps use the SciPy NDImage package to implement your slope algorithm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.filters.generic_filter.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.filters.generic_filter.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i.e&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import scipy.ndimage

def CustomSlope(numpy_array):
&amp;nbsp;&amp;nbsp; #Do something

slope = scipy.ndimage.generic_filter(elevation_array, CustomSlope, size=(5,5))
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:38:06 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2021-12-11T18:38:06Z</dc:date>
    <item>
      <title>Create Neighborhood with Numpy array to calculate slope</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-neighborhood-with-numpy-array-to-calculate/m-p/410152#M13910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am hoping someone has experience with creating a neighborhood to calculate the slope for each pixel in a raster.&amp;nbsp; I can easily convert the raster to an array and then do a calculation and convert back to a raster.&amp;nbsp; However, I have no experience in creating a 5x5 neighborhood to calculate the slope in numpy or if this is even possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help or resources would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Nov 2010 00:56:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-neighborhood-with-numpy-array-to-calculate/m-p/410152#M13910</guid>
      <dc:creator>AndrewRettig</dc:creator>
      <dc:date>2010-11-15T00:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create Neighborhood with Numpy array to calculate slope</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-neighborhood-with-numpy-array-to-calculate/m-p/410153#M13911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perhaps use the SciPy NDImage package to implement your slope algorithm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.filters.generic_filter.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.filters.generic_filter.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i.e&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import scipy.ndimage

def CustomSlope(numpy_array):
&amp;nbsp;&amp;nbsp; #Do something

slope = scipy.ndimage.generic_filter(elevation_array, CustomSlope, size=(5,5))
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:38:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-neighborhood-with-numpy-array-to-calculate/m-p/410153#M13911</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-12-11T18:38:06Z</dc:date>
    </item>
  </channel>
</rss>

