<?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: how to create own surface profile service? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195849#M6700</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I also would like to know how it's done? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems no one from ESRI interested in this subject.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Dec 2011 13:49:40 GMT</pubDate>
    <dc:creator>SertaçTAKIL</dc:creator>
    <dc:date>2011-12-28T13:49:40Z</dc:date>
    <item>
      <title>how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195842#M6693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;The GPservice used to get surface profile in ESRI samples is " &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/GPServer/ProfileService" rel="nofollow" target="_blank"&gt;http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/GPServer/ProfileService&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do i create my own service to get the same result with my data than ESRI sample data.. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or is it possible to get surface profile from my data using esri's profileservice? cos when i tried i ended up getting errors. im confused whether its my data or service.. im using DEM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;could somebody please give solution for this please. Im totaly messed up.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Apr 2010 08:53:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195842#M6693</guid>
      <dc:creator>Divyaprasad</dc:creator>
      <dc:date>2010-04-30T08:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195843#M6694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to create my own service as well.&amp;nbsp; Any word on this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 15:47:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195843#M6694</guid>
      <dc:creator>AndrewRettig</dc:creator>
      <dc:date>2010-05-04T15:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195844#M6695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;why is it that whenever a question is posted on surface elevation profile service creation for oneself,&amp;nbsp; there is no answer !!! i mean is it something which is not possible ?? kindly acknowledge..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 May 2010 16:45:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195844#M6695</guid>
      <dc:creator>Divyaprasad</dc:creator>
      <dc:date>2010-05-20T16:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195845#M6696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am also very interested to create my own surface profile GPService.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did anyone get some more information here?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 09:15:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195845#M6696</guid>
      <dc:creator>StefanP__Jung</dc:creator>
      <dc:date>2010-11-12T09:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195846#M6697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i just have to chime in as well. this would be nice to know.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2011 15:22:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195846#M6697</guid>
      <dc:creator>GeraldLee__GISP</dc:creator>
      <dc:date>2011-03-01T15:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195847#M6698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to know how to use ESRI's profile service using javascript.&amp;nbsp; I am actually trying to create a slope calculator.&amp;nbsp; However to try to answer other questions.&amp;nbsp; I would think you could create a geometry service (which usually accounts for x,y coordinates and then be able to calculate a z value at that point based on your data)&amp;nbsp; In a profile your line would have several x,y coordinates and calculate the z values at each one of those x,y points.&amp;nbsp; The result would be your profile.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now anyone know how to write javascript to use ESRI's profile service using Javascript API?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2011 14:21:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195847#M6698</guid>
      <dc:creator>dcopple</dc:creator>
      <dc:date>2011-03-02T14:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195848#M6699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;TTT!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would also like to see an answer to this. Is ESRI actively ignoring these?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 20:54:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195848#M6699</guid>
      <dc:creator>SeanCook</dc:creator>
      <dc:date>2011-11-09T20:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195849#M6700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I also would like to know how it's done? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems no one from ESRI interested in this subject.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 13:49:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195849#M6700</guid>
      <dc:creator>SertaçTAKIL</dc:creator>
      <dc:date>2011-12-28T13:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195850#M6701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ditto,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;come on esri .. chime in for f(**( sake ... even if the answer is no.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 05:02:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195850#M6701</guid>
      <dc:creator>IainCampion</dc:creator>
      <dc:date>2012-02-29T05:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195851#M6702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I managed to hack this together at one point, but found it was too slow for a web service.&amp;nbsp; I rewrote the script using gdal for raster access and it was hundreds of times faster.&amp;nbsp; The code for the arcpy script is below, with an example output graph.&amp;nbsp; The commented code was for grabbing points from a feature set (for a toolbox or gp service).&amp;nbsp; This ugly, but it works.&amp;nbsp; disclaimer: This is hacked, old and ugly.&amp;nbsp; sorry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
from polyline import *
import matplotlib.pyplot as plt

def fetch_cell_value(x, y):
&amp;nbsp;&amp;nbsp;&amp;nbsp; xy_string = "{0} {1}".format(x, y)
&amp;nbsp;&amp;nbsp;&amp;nbsp; band = "1"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.GetCellValue_management(r, xy_string, band)
&amp;nbsp;&amp;nbsp;&amp;nbsp; results = arcpy.GetMessages()
&amp;nbsp;&amp;nbsp;&amp;nbsp; lines = results.split('\n')
&amp;nbsp;&amp;nbsp;&amp;nbsp; value = float(lines[2])
&amp;nbsp;&amp;nbsp;&amp;nbsp; return value

#for arc script
#fs = arcpy.GetParameter(0)
#rows = arcpy.SearchCursor(fs)

# Assume feature set has only one feature and one shape.
#row = rows.next()
#shape = row.getValue("SHAPE")
#arcpoints = shape.getPart(0)

#points = list()
#for p in arcpoints:
#&amp;nbsp;&amp;nbsp;&amp;nbsp; points.append([p.X, p.Y])

raster = "c:/data/someraster.tif"
r = arcpy.Raster(raster)

#test points
points = [[290626.474, 4875792.8594],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [282358.29,4863026.666],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [297836.3843, 4870699.62]]

p = poly_line(points)

n_points = 100
#if p.length() / n_points &amp;lt; cell_size:
#&amp;nbsp;&amp;nbsp;&amp;nbsp; skip = cell_size
#else:
#&amp;nbsp;&amp;nbsp;&amp;nbsp; skip = int(p.length() / n_points)
skip = p.length() / n_points

dists = list()
i = 0
while i * skip &amp;lt; p.length():
&amp;nbsp;&amp;nbsp;&amp;nbsp; dists.append(i * skip)
&amp;nbsp;&amp;nbsp;&amp;nbsp; i += 1

values = list()
for d in dists:
&amp;nbsp;&amp;nbsp;&amp;nbsp; x,y = p.d_line(d)
&amp;nbsp;&amp;nbsp;&amp;nbsp; v = fetch_cell_value(x,y)
&amp;nbsp;&amp;nbsp;&amp;nbsp; values.append(v)
print("Time:{0}".format(time.clock() - start))

plt.plot(dists, values)
plt.xlabel("Distance (m)")
plt.ylabel("Elevation (m)")
plt.title("Elevation Profile")
plt.grid(True)
plt.show()
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The poly_line is a little class I wrote to handle densifying lines.&amp;nbsp; It assumes euclidean geometry (planar) so doesn't handle earth curvature.&amp;nbsp; You could probably use some type of densify function for an arc type polyline and use the points in the shape.&amp;nbsp; I didn't try it.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;poly_line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import math

##
# Class representing a segment of a polyline
#
class segment:
&amp;nbsp;&amp;nbsp;&amp;nbsp; p1 = [0,0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; p2 = [0,0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; ##
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @brief Construct a segment
&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self, p1, p2):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.p1 = p1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.p2 = p2
&amp;nbsp;&amp;nbsp;&amp;nbsp; ##
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @brief Get the length of the segment
&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @todo Test for /0
&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp; def length(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = self.p2[0] - self.p1[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b = self.p2[1] - self.p1[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l = math.hypot(a,b)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return l
&amp;nbsp;&amp;nbsp;&amp;nbsp; ##
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @brief Get the slope of the segment
&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @todo Test for /0
&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp; def m(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = self.p2[1] - self.p1[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b = self.p2[0] - self.p1[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m = a / b
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return m
&amp;nbsp;&amp;nbsp;&amp;nbsp; ##
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @brief Get the y intercept of the segment
&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @return y intercept
&amp;nbsp;&amp;nbsp;&amp;nbsp; def b(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b = self.p2[1] - (self.m() * self.p2[0])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return b
&amp;nbsp;&amp;nbsp;&amp;nbsp; ##
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @brief Get the coordinate of a point some distance from point 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @param d distance from point 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @return x and y coordinate
&amp;nbsp;&amp;nbsp;&amp;nbsp; def d_line(self, d):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if d == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.p1[0], self.p1[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if d &amp;gt; self.length():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return None
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m = self.m()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; u = d / math.sqrt(m * m + 1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.p2[0] &amp;lt; self.p1[0]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; u = -u
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v = (m * d) / math.sqrt(m * m + 1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.p2[1] &amp;lt; self.p1[1]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v = -v
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (self.p1[0] + u, self.p1[1] + v)
##
# Class representing a polyline composed of segments
#
# @see segment
#
class poly_line:
&amp;nbsp;&amp;nbsp;&amp;nbsp; segments = list()
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self, points):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range(len(points) - 1):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s = segment(points&lt;I&gt;, points[i+1])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.segments.append(s)
&amp;nbsp;&amp;nbsp;&amp;nbsp; ##
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @brief Get the length of all the segments
&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @return total length
&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp; def length(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l = 0.0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for s in self.segments:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l += s.length()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return l
&amp;nbsp;&amp;nbsp;&amp;nbsp; ##
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @brief Get the coordinate of a point some distance from the polyline 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # origin
&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @param d distance from the origin
&amp;nbsp;&amp;nbsp;&amp;nbsp; # @return x and y coordinate for the point
&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp; def d_line(self, d):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if d == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.segments[0].d_line(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l = 0.0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for s in self.segments:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if l &amp;gt;= d:
&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; break
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dd = d - l
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l += s.length()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; seg = s
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return seg.d_line(dd)
&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just ran it and wrote the attached output, but no guarentees it will work for anyone.&amp;nbsp; I think that the service ESRI wrote used lower level raster access, because of it's speed.&amp;nbsp; I got comparable speed with the gdal version. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry if I didn't help, but it is possible.&amp;nbsp; I stopped working on it, but it may help others.&amp;nbsp; I will watch the thread and try to answer questions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;kss&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:47:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195851#M6702</guid>
      <dc:creator>KyleShannon</dc:creator>
      <dc:date>2021-12-11T09:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195852#M6703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just found this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.forumsig.org/archive/index.php/t-28565.html"&gt;http://www.forumsig.org/archive/index.php/t-28565.html&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;related to the initial question of using your own data.&amp;nbsp;&amp;nbsp; I haven't delved in yet, but will be in the future...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Karen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 17:00:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195852#M6703</guid>
      <dc:creator>KarenRobine</dc:creator>
      <dc:date>2012-05-08T17:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195853#M6704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Im only seeing this thread now - there are a lot of solutions to this problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course everyone has seen the SOE which is available as a sample from the Applications Prototype lab:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Configurable SOE: &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=3b65b141041044ca97d83eb8264da08c"&gt;http://www.arcgis.com/home/item.html?id=3b65b141041044ca97d83eb8264da08c&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Basic Viewer to go with the SOE: &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/apps/OnePane/basicviewer/profile.html"&gt;http://www.arcgis.com/apps/OnePane/basicviewer/profile.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;kss has a nice script to perform this analysis above. (also using matplotlib to draw the output). This should work real well at 10.0 but be sure to install matplotlib on your server machine. At 10.1 matplotlib comes with ArcGIS (Desktop and Server)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;New at 10.1 is a tool "Stack Profile". This tool produces a table of X,Y,Z and optional graph output. Please note that the graphing component is not supported in Server, so you can use the tool to produce your table of X,Y,Z.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resourcesbeta.arcgis.com/en/help/main/10.1/index.html#//00q9000000mm000000"&gt;http://resourcesbeta.arcgis.com/en/help/main/10.1/index.html#//00q9000000mm000000&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;I've attached a HTML file which consumes the "Stack Profile" service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically it allows you to draw a line on a map, and looks for the result table. It builds up some arrays and plots the chart. (Makes use of JavaScript API 2.7)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Make use to update the references to your server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note, the attached web page and the one referenced above are pretty similar to each other and one could extend/modify either page to suit individual needs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The difference is how you "draw" the profile : does the service create an image, or does the client render an image with X,Y,Z information?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 17:41:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195853#M6704</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2012-05-08T17:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195854#M6705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Kevin:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much for the response. That 10.1 tool looks interesting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But back to the question at hand:&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We are looking for a way to replace the data utilized in the SOE, or the ProfileService (at &lt;/SPAN&gt;&lt;A href="http://samplesserver2.arcgisonline.com/arcgis/services"&gt;http://samplesserver2.arcgisonline.com/arcgis/services&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Elevation/ESRI_Elevation_World)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I also checked out: &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://sampleserver4.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/MapServer"&gt;http://sampleserver4.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/MapServer&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;and it looks like the data it uses for this is a Global Elevations layer, which doesn't look to be quite precise enough for my purposes. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The SOE that's at &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/gallery/file/arcobjects-net-api/details?entryID=87BEC705-1422-2418-34B5-308930DE323A"&gt;http://resources.arcgis.com/gallery/file/arcobjects-net-api/details?entryID=87BEC705-1422-2418-34B5-308930DE323A&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;may handle this, but the source provided is in Java (and I haven't researched the code enough yet to see if it supports what I'm asking, or if its only a client app).&amp;nbsp; So am wondering if that's the only solution for the problem?&amp;nbsp; (ps. would be nice to get the model associated with the ProfileService?)..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 18:32:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195854#M6705</guid>
      <dc:creator>KarenRobine</dc:creator>
      <dc:date>2012-05-08T18:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195855#M6706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Karen,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the instructions to the SOE setup it explains you attach the SOE to a map service with a single band raster layer which will act as your elevation service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So yes, you can and must use your own data to set it up. The SOE gets tied to that map service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;SETUP&lt;BR /&gt;1) Create a Map Document (mxd) with at least one elevation layer; the elevation layer must be a single band raster layer.&amp;nbsp; Other types of layers are ok to use because the SOE will only expose a resource for the single band raster layers.&lt;BR /&gt;&lt;BR /&gt;2) Publish the Map Document as a Map Service and then stop the map service after it has been successfully published.&lt;BR /&gt;&lt;BR /&gt;3) Right-click on the map service and select �??Service Properties�??.&amp;nbsp; In the �??Map Service Properties�?? dialog, select the �??Capabilities�?? tab.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;4) From the list of capabilities, check on the new �??Get Elevations�?? capability and click the OK button.&lt;BR /&gt;&lt;BR /&gt;5) Start the map service.&lt;BR /&gt;&lt;BR /&gt;6) Go to the Services Directory admin page and clear the REST cache.&lt;BR /&gt;&lt;BR /&gt;7) Navigate to the Services Directory page of the Map Service and you�??ll now see the Elevations SOE listed at the bottom of the page in the �??SUPPORTED EXTENSIONS�?? section.&amp;nbsp; Follow the available links to view the available REST resources and operations for the Elevations SOE.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Note, the SOE is custom code: there is no "model" which produces the result. The code (I could only imagine) would be something similar to the code in the above Python script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 18:43:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195855#M6706</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2012-05-08T18:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195856#M6707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Kevin.. That's perfect..&amp;nbsp; Should have read those direction first before responding&amp;nbsp; (oops)...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I get to see if the Elevation layer can be a WCS type of layer (which is what ours will be)..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 18:48:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195856#M6707</guid>
      <dc:creator>KarenRobine</dc:creator>
      <dc:date>2012-05-08T18:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195857#M6708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Also, is there a .NET version of that same SOE out there anywhere?&amp;nbsp; The only source for the SOE is a Java-based version. All the rest of the stuff in that .zip file are clients.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 20:02:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195857#M6708</guid>
      <dc:creator>KarenRobine</dc:creator>
      <dc:date>2012-05-08T20:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195858#M6709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to second Karen's request for .NET source code for the elevation profile SOE if it exists.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 21:05:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195858#M6709</guid>
      <dc:creator>DrewDowling</dc:creator>
      <dc:date>2012-05-08T21:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195859#M6710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;news: esri is coming out with the new version x 10.1 and the included source net and java&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;here you can see my preview beta &lt;/SPAN&gt;&lt;A href="http://sit.sistemigis.it/Samples/Elevations/"&gt;http://sit.sistemigis.it/Samples/Elevations/&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;however you download esri version ...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 14:47:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195859#M6710</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2013-02-06T14:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195860#M6711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;news: esri is coming out with the new version x 10.1 and the included source net and java&lt;BR /&gt;here you can see my preview beta &lt;A href="http://sit.sistemigis.it/Samples/Elevations/"&gt;http://sit.sistemigis.it/Samples/Elevations/&lt;/A&gt;&lt;BR /&gt;however you download esri version ...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now you can download new version 10.1 soe elevations:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=60bf17f2d59441839135adc25654a7d9"&gt;http://www.arcgis.com/home/item.html?id=60bf17f2d59441839135adc25654a7d9&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 16:15:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195860#M6711</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2013-04-09T16:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to create own surface profile service?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195861#M6712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working with ArcGIS 10.1 and I'm using the stack profile tool in the python script. It is working perfectly fine but the sampling distance used to get the values is by default the raster pixel size. For me, it is 25.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I want it to be a configurable parameter while using this stack profile tool. The python script for this tool doesn't have an input option as such for the sampling distance. The current inputs I'm using are the polyline i'm drawing and the raster.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know if there is any alternative for this through the python script?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 05:08:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-create-own-surface-profile-service/m-p/195861#M6712</guid>
      <dc:creator>PranaviGaddipati</dc:creator>
      <dc:date>2013-08-27T05:08:44Z</dc:date>
    </item>
  </channel>
</rss>

