<?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: Selecting points from a raster  that have a 20m height difference within a distance of 100m in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11426#M938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An image of what you are working with would help.&amp;nbsp; I don't understand you wanting to draw a line between the max and min, since they are values for a block and not the actual location of where they occur... that is a totally different process&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 May 2018 09:07:08 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2018-05-02T09:07:08Z</dc:date>
    <item>
      <title>Selecting points from a raster  that have a 20m height difference within a distance of 100m</title>
      <link>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11423#M935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a digital elevation model and&amp;nbsp; i want&amp;nbsp; to select&amp;nbsp; the&amp;nbsp; maximum and&amp;nbsp; minimum&amp;nbsp; values within&amp;nbsp; a distance&amp;nbsp; of 100m . I want&amp;nbsp; to use&amp;nbsp; numpy array to&amp;nbsp; raster&amp;nbsp; function&amp;nbsp; to&amp;nbsp; convert&amp;nbsp; my raster&amp;nbsp; to an&amp;nbsp; array .&amp;nbsp;&lt;/P&gt;&lt;P&gt;(1) From the&amp;nbsp; array&amp;nbsp; i want&amp;nbsp; to create&amp;nbsp; a search window of&amp;nbsp; 100m x 100m&amp;nbsp; and&amp;nbsp; select&amp;nbsp; a the maximum and&amp;nbsp; minimm values&amp;nbsp; in the window&lt;/P&gt;&lt;P&gt;(2) I want&amp;nbsp; to assign a value of 1&amp;nbsp; to the maximum values and 2&amp;nbsp; to the minimum value&amp;nbsp; if&amp;nbsp; the&amp;nbsp; difference between the 2 is greater&amp;nbsp; tha&amp;nbsp; 20m&amp;nbsp;&lt;/P&gt;&lt;P&gt;(3) All other values&amp;nbsp; that are&amp;nbsp; not the maximum or minimum should be assign to zero&amp;nbsp;&lt;/P&gt;&lt;P&gt;(4) If the&amp;nbsp; values&amp;nbsp; do not&amp;nbsp; meet the creteria, convert all the&amp;nbsp; values&amp;nbsp; to zero&amp;nbsp;&lt;/P&gt;&lt;P&gt;NB. The&amp;nbsp; window&amp;nbsp; should&amp;nbsp; be non_ overlapping so&amp;nbsp; as to get a unique&amp;nbsp; combination of the max a nd min value .&lt;/P&gt;&lt;P&gt;I want&amp;nbsp; to do this for my project&amp;nbsp; of selecting&amp;nbsp; a head of 20m over a distance&amp;nbsp; of 100m and within 50m of the&amp;nbsp; river created from a DEM&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANK YOU&amp;nbsp; FOR&amp;nbsp; ATTENDING TO MY QUESTION .. YO&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 18:57:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11423#M935</guid>
      <dc:creator>SimbarasheKapfumo</dc:creator>
      <dc:date>2018-05-01T18:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting points from a raster  that have a 20m height difference within a distance of 100m</title>
      <link>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11424#M936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will be multistep&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;use block statistics&amp;nbsp;&lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/block-statistics.htm"&gt;http://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/block-statistics.htm&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;use a circular or square block if you can live with a root 2 discrepency&lt;/LI&gt;&lt;LI&gt;get the range... BUT this will not give you what you want since one cell of a value can influence the range.&lt;/LI&gt;&lt;LI&gt;alternately, get the minority (generally the lowest in the block)&lt;/LI&gt;&lt;LI&gt;then get the majority&lt;/LI&gt;&lt;LI&gt;from the latter two rasters, determine the range and those areas that differ by more than 200 will be your area&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest using FocalStatistics even though the neighborhoods overlap&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 22:02:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11424#M936</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-05-01T22:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting points from a raster  that have a 20m height difference within a distance of 100m</title>
      <link>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11425#M937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you for your time . I tried block and focal statistics . the problem is i get clustered results. when i want to draw lines between the maximum and minimum points in each grid it becomes more difficult . my goal is to convert the maximum and minimum points in a block to points the draw a&amp;nbsp;polyline between the two points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2018 09:02:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11425#M937</guid>
      <dc:creator>SimbarasheKapfumo</dc:creator>
      <dc:date>2018-05-02T09:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting points from a raster  that have a 20m height difference within a distance of 100m</title>
      <link>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11426#M938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An image of what you are working with would help.&amp;nbsp; I don't understand you wanting to draw a line between the max and min, since they are values for a block and not the actual location of where they occur... that is a totally different process&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2018 09:07:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11426#M938</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-05-02T09:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting points from a raster  that have a 20m height difference within a distance of 100m</title>
      <link>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11427#M939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="258" src="https://community.esri.com/legacyfs/online/405493_pastedImage_1.png" width="355" /&gt;&lt;/P&gt;&lt;P&gt;with reference to the image&amp;nbsp; above, i want to select my maximum point as the weir and the minimum is the powerhouse. the difference between these two points should be &amp;lt;= 100m. My goal is to select maximum points that intersect with the river in a block(100 x 100). if a maximum point does, then i automatically create a polyline (penstock) from the maximum point to the corresponding minimum point. If i use block and or focal statistics i get clusters of these points. it will be difficult for me to determine whether the maximum point lies withing the river .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2018 11:07:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11427#M939</guid>
      <dc:creator>SimbarasheKapfumo</dc:creator>
      <dc:date>2018-05-02T11:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting points from a raster  that have a 20m height difference within a distance of 100m</title>
      <link>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11428#M940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need the elevation of the origin point or the destination point.&amp;nbsp; If you have blocks that indicate the desired elevation difference, your next step is to extract those blocks to find the location of the min and max location.&amp;nbsp; The problem you would now face is that the min and max could be beside one another. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the weir needs to be located on the river, you might just consider extracting the elevation data using a river polyline and look at the elevation profile in 2D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2018 11:44:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11428#M940</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-05-02T11:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting points from a raster  that have a 20m height difference within a distance of 100m</title>
      <link>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11429#M941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you want to have a look at&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/hydrologic-analysis-sample-applications.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/hydrologic-analysis-sample-applications.htm"&gt;Hydrologic analysis sample applications—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;. You can determine the streams based on your DEM/DTM and convert the streams to 3D and analyze from which point you have&amp;nbsp; a drop of more than 20m in less than 100m distance. This would require some scripting, but it is feasible.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 13:02:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11429#M941</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-05-03T13:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting points from a raster  that have a 20m height difference within a distance of 100m</title>
      <link>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11430#M942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you for the suggestion . the scripting part is the one that i want . so far i have created a fishnet of polygons that intersect the river. i then used zonal statistics to to find the maximum and minimum points within each fishnet polygon. since there might be more than one maximum or minimum point in each fishnet polygon, i then used CentralFeature_stats tool to find the central point. below is the code i wrote. my problem now is the new appended feature class is not populating with values.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;import &lt;/SPAN&gt;arcpy

&lt;SPAN style="color: #808080;"&gt;# getting inputs from the directory
&lt;/SPAN&gt;index = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;r'C:\Users\PC\Documents\ArcGIS\Default.gdb\Clip_index'
&lt;/SPAN&gt;point = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;r'C:\Users\PC\Documents\ArcGIS\Default.gdb\cell_point'
&lt;/SPAN&gt;centre_pnts = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;r'C:\Users\PC\Documents\ArcGIS\Default.gdb\centre_cells'
&lt;/SPAN&gt;all_points = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;r'C:\Users\PC\Documents\ArcGIS\Default.gdb'
&lt;/SPAN&gt;outname = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"cnt_pnts"
&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# allowing overwriting
&lt;/SPAN&gt;arcpy.env.overwriteOutput = &lt;SPAN style="color: #000080;"&gt;True
&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;#creating a feature class
&lt;/SPAN&gt;arcpy.MakeFeatureLayer_management(index,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'index_lyr'&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;#--------------------------------------------------
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;#creating an empty point feature
&lt;/SPAN&gt;empty = arcpy.CreateFeatureclass_management(all_points,outname,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'POINT'&lt;/SPAN&gt;,point)

&lt;SPAN style="color: #808080;"&gt;# using the search cursor to find the most central point in a grid
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;#-----------------------------------------------------------------
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;with &lt;/SPAN&gt;arcpy.da.SearchCursor(index,[&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"PageNumber"&lt;/SPAN&gt;]) &lt;SPAN style="color: #000080; font-weight: bold;"&gt;as &lt;/SPAN&gt;index_cur:
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;index_cur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# starting from PageNumber 20
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;row[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;] &amp;gt;= &lt;SPAN style="color: #0000ff;"&gt;20&lt;/SPAN&gt;:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'index_lyr'&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'ADD_TO_SELECTION'&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"PageNumber = {}"&lt;/SPAN&gt;.format(row[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(point, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'point_lyr'&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByLocation_management(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'point_lyr'&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'WITHIN'&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'index_lyr'&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CentralFeature_stats(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'point_lyr'&lt;/SPAN&gt;, centre_pnts, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'EUCLIDEAN_DISTANCE'&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(centre_pnts,empty, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'TEST'&lt;/SPAN&gt;)

thank you all for you help&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:29:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-points-from-a-raster-that-have-a-20m/m-p/11430#M942</guid>
      <dc:creator>SimbarasheKapfumo</dc:creator>
      <dc:date>2021-12-10T20:29:16Z</dc:date>
    </item>
  </channel>
</rss>

