<?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 Intersection a stream with a DEM in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/intersection-a-stream-with-a-dem/m-p/186907#M2629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure I'm approaching this correctly as I've found nothing so far Googling.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyways, I'm trying to determine the slope of a stream (actually, a series of polyline segments making up a stream).&amp;nbsp; I've gone the ArcHydro route, but the results I'm getting from the assign stream slope are relative, whereas if I used a DEM they might be a bit more static.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, my question is, what's the best way to intersect a stream (or any series of polylines) with a DEM to give the stream XYZ attributes?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jacques&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Nov 2010 14:33:13 GMT</pubDate>
    <dc:creator>JacquesTardie</dc:creator>
    <dc:date>2010-11-22T14:33:13Z</dc:date>
    <item>
      <title>Intersection a stream with a DEM</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/intersection-a-stream-with-a-dem/m-p/186907#M2629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure I'm approaching this correctly as I've found nothing so far Googling.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyways, I'm trying to determine the slope of a stream (actually, a series of polyline segments making up a stream).&amp;nbsp; I've gone the ArcHydro route, but the results I'm getting from the assign stream slope are relative, whereas if I used a DEM they might be a bit more static.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, my question is, what's the best way to intersect a stream (or any series of polylines) with a DEM to give the stream XYZ attributes?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jacques&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Nov 2010 14:33:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/intersection-a-stream-with-a-dem/m-p/186907#M2629</guid>
      <dc:creator>JacquesTardie</dc:creator>
      <dc:date>2010-11-22T14:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection a stream with a DEM</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/intersection-a-stream-with-a-dem/m-p/186908#M2630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There are some different thoughts on the subject:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Get the elevations of just the Start and End nodes (FeatureVerticesToPoints_management tool and then ExtractValueToPoints_sa tool)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Get the elevations of all the vertices (FeatureVerticesToPoints_management tool and then ExtractValueToPoints_sa tool) - This is a bit more involved...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Rasterize the stream layer, derive a slope grid, and then use the ZonalStatistics tool (MEAN) to get the mean slope for each stream segment. AThis is probably the easiest, but again is the mean slope, not really THE slope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could also mix it up a bit and get the MIN and MAX elevations for each stream segment zone using the ZonalStatistics tool, and then derive slope similar to #1.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Nov 2010 19:42:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/intersection-a-stream-with-a-dem/m-p/186908#M2630</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-22T19:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection a stream with a DEM</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/intersection-a-stream-with-a-dem/m-p/186909#M2631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think that you are after the stream gradient. The gradient is defined as the ratio of drop per unit distance. This is just like the rise/run slope calculation but is ordered along the stream reach. The mean slope will not give you this. Being the dinosaur that I am I only have code to do this in Workstation ArcInfo but as William Huber pointed out, there is a legacy of threads that discuss this in the old knowledge base. Just in case you are willing to work in ArcInfo, I attached the AML code. The input is a line coverage with an attribute that defines the stream reach and a DEM. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;/*&amp;nbsp;&amp;nbsp; Program: GRADIENT.AML
/*&amp;nbsp;&amp;nbsp; Purpose: Calculates the gradient of a line coverage based on elevation
/*===================================================================================
/*&amp;nbsp; Usage: GRADIENT &amp;lt;COVER&amp;gt; &amp;lt;GRID&amp;gt; &amp;lt;SUMITEM&amp;gt; &amp;lt;OUTITEM&amp;gt;
/*
/*&amp;nbsp; Arguments: COVER - Line cover to calculate gradient.
/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GRID - Elevation grid.
/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUMITEM - INFO item in line cover to summarize gradients by.
/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUTITEM - Item in coverage INFO file to hold gradient value.
/*===================================================================================
/* Calls: MUST BE RUN FROM ARC (Calls ARCPLOT, GRID, and TABLES)
/*===================================================================================
/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jeffrey Evans - Senior Landscape Ecologist
/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The Nature Conservancy, Central Science
/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Laramie, WY
/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jeffrey_evans@tnc.org
/*===================================================================================
&amp;amp;args cov grid item infoitem

&amp;amp;if [show PROGRAM] &amp;lt;&amp;gt; ARC &amp;amp;then
&amp;nbsp; &amp;amp;return &amp;amp;inform CAN ONLY BE RUN FROM ARC

&amp;amp;if [NULL %cov%] = .TRUE. &amp;amp;then
&amp;nbsp; &amp;amp;return &amp;amp;inform Usage: GRADIENT &amp;lt;COVER&amp;gt; &amp;lt;GRID&amp;gt; &amp;lt;SUMITEM&amp;gt; &amp;lt;OUTITEM&amp;gt;

&amp;amp;if [NULL %grid%] = .TRUE. &amp;amp;then
&amp;nbsp; &amp;amp;return &amp;amp;inform Usage: GRADIENT &amp;lt;COVER&amp;gt; &amp;lt;GRID&amp;gt; &amp;lt;SUMITEM&amp;gt; &amp;lt;OUTITEM&amp;gt;

&amp;amp;if [NULL %item%] = .TRUE. &amp;amp;then
&amp;nbsp; &amp;amp;return &amp;amp;inform Usage: GRADIENT &amp;lt;COVER&amp;gt; &amp;lt;GRID&amp;gt; &amp;lt;SUMITEM&amp;gt; &amp;lt;OUTITEM&amp;gt;

&amp;amp;if [NULL %infoitem%] = .TRUE. &amp;amp;then
&amp;nbsp; &amp;amp;return &amp;amp;inform Usage: GRADIENT &amp;lt;COVER&amp;gt; &amp;lt;GRID&amp;gt; &amp;lt;SUMITEM&amp;gt; &amp;lt;OUTITEM&amp;gt;

&amp;amp;if [iteminfo %cov%.aat -info %infoitem% -exists] = .TRUE. &amp;amp;then
&amp;nbsp; &amp;amp;return &amp;amp;inform Item [upcase %infoitem%] already exist!

&amp;amp;if [exists %grid% -grid] = .FALSE. &amp;amp;then
&amp;nbsp; &amp;amp;return &amp;amp;inform Grid [upcase %grid%] does not exist!

&amp;amp;if [iteminfo %cov%.aat -info %item% -exists] = .FALSE. &amp;amp;then
&amp;nbsp; &amp;amp;return &amp;amp;inform Item [upcase %item%] does not exist!

&amp;amp;if [exists %cov% -cover] = .FALSE. &amp;amp;then
&amp;nbsp; &amp;amp;return &amp;amp;inform Coverage [upcase %cov%] does not exist!

&amp;amp;if [exists %cov% -line] = .FALSE. &amp;amp;then
&amp;nbsp; &amp;amp;return &amp;amp;inform [upcase %cov%] does not appear to be a line coverage or lacks topology!

&amp;amp;s tmp1 [scratchname -prefix xx1]
&amp;amp;s tmp2 [scratchname -prefix xx2]
&amp;amp;s tmp3 [scratchname -prefix xx3]
&amp;amp;s tmp4 [scratchname -prefix xx4]

/*===================================================================================
&amp;amp;TYPE /&amp;amp; CREATING BASE FILES FOR GRADIENT CALCULATION /&amp;amp;
/*===================================================================================

NODEPOINT %cov% %tmp1%
BUILD %tmp1% point

/*===================================================================================
&amp;amp;TYPE /&amp;amp; GENERATING ELEVATION VALUES FOR EACH NODE /&amp;amp;
/*===================================================================================

additem %tmp1%.pat %tmp1%.pat %grid% 4 12 f 3
display 0
ARCPLOT
&amp;amp;messages &amp;amp;off
cursor ptcur declare %tmp1% points rw
cursor ptcur open
&amp;amp;echo &amp;amp;off
&amp;amp;do &amp;amp;while %:ptcur.aml$next%
&amp;nbsp; &amp;amp;s temp [show cellvalue %grid% [show select %tmp1% point 1 xy]]
&amp;nbsp; &amp;amp;if [type %temp%] = 1 &amp;amp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;s :ptcur.%grid% -9999
&amp;nbsp; &amp;amp;else
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;s :ptcur.%grid% %temp%
&amp;nbsp; cursor ptcur next
&amp;amp;end
QUIT
&amp;amp;messages &amp;amp;on

/*===================================================================================
&amp;amp;TYPE /&amp;amp; RELATING LINE COVERAGE TO POINT SAMPLES /&amp;amp;
/*===================================================================================

PULLITEMS %cov%.aat %tmp2%
FNODE#
TNODE#
LENGTH
%item%
END

TABLES
ADDITEM %tmp2% RISE 4 6 F 3

SEL %tmp2%
RELATE ADD
R1
%tmp1%.PAT
INFO
FNODE#
%tmp1%#
ORDERED
RO
R2
%tmp1%.PAT
INFO
TNODE#
%tmp1%#
ORDERED
RO
[UNQUOTE ' ']

/*===================================================================================
&amp;amp;TYPE /&amp;amp; CALCULATING RISE FOR EACH ARC /&amp;amp;
/*===================================================================================

SEL %tmp2%
RESELECT R1//%grid% &amp;gt; R2//%grid%
CALCULATE RISE = R1//%grid% - R2//%grid%
NSELECT %tmp2%
CALCULATE RISE = R2//%grid% - R1//%grid%

/*===================================================================================
&amp;amp;TYPE /&amp;amp; SUMARIZING LENGTH AND RISE BY [upcase %item%] /&amp;amp;
/*===================================================================================

SEL %tmp2%
STATISTICS %item% %tmp3%
SUM LENGTH
SUM RISE
END

ADDITEM %tmp3% %infoitem% 4 6 F 3

/*===================================================================================
&amp;amp;TYPE /&amp;amp; CALCULATING GRADIENT /&amp;amp;
/*===================================================================================

SEL %tmp3%
CALCULATE %infoitem% = SUM-RISE / SUM-LENGTH * 100
QUIT

/*===================================================================================
&amp;amp;TYPE /&amp;amp; ADDING [upcase %infoitem%] TO [upcase %cov%] /&amp;amp;
/*===================================================================================

PULLITEMS %tmp3% %tmp3%
%item%
%infoitem%
END

JOINITEM %cov%.aat %tmp3% %cov%.aat %item%

/*===================================================================================
&amp;amp;TYPE /&amp;amp; CLEANING UP /&amp;amp;
/*===================================================================================

KILL %tmp1% all
KILLINFO (!%tmp2% %tmp3%!)
RELATE DROP
r1
r2
[UNQUOTE ' ']&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:27:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/intersection-a-stream-with-a-dem/m-p/186909#M2631</guid>
      <dc:creator>JeffreyEvans</dc:creator>
      <dc:date>2021-12-11T09:27:55Z</dc:date>
    </item>
  </channel>
</rss>

