<?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 How to use ArcPy Geometry MeasureOnLine in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-geometry-measureonline/m-p/466292#M36448</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've found the following forum post &lt;A _jive_internal="true" href="https://community.esri.com/thread/102954"&gt;https://community.esri.com/thread/102954&lt;/A&gt; where the geometry method measureOnLine was used. I'm trying to determine how to use the same method for calculating the chainage (accumulated distance) along a cross-section polyline. I need to extract the profile of each cross-section into a point feature class based on the position of the vertices within each cross-section polyline. I would like to end up with a point feature class with the following fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ID (Cross-Section)&lt;/LI&gt;&lt;LI&gt;Z (Elevation)&lt;/LI&gt;&lt;LI&gt;Chainage (Distance m from start of polyline)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The chainage will be the accumulative distance (i.e. XS point 1 = 0 ; XS point 2 = 20m ; XS point 3 = 35m etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use the polyline Z Feature Class to generate a pointGeometry Object and iterate through each point that will be used as the point for the measureOnLine method against the original Polyline Feature Class. The determined length (Chainage) will be inserted (i.e. InsertCursor) with the Point Object ; ID (Cross Section Field) and Chainage into a newly generated feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still very new to ArcPy and Python and battling to figure out how to iterate through the PointGeometry from the Polyline to use the measureOnline method and then insert the Point Geometry ; ID ; Chainage into a new Feature Class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help in getting going will trully be appreciated. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter Wilson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Aug 2014 19:50:01 GMT</pubDate>
    <dc:creator>PeterWilson</dc:creator>
    <dc:date>2014-08-14T19:50:01Z</dc:date>
    <item>
      <title>How to use ArcPy Geometry MeasureOnLine</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-geometry-measureonline/m-p/466292#M36448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've found the following forum post &lt;A _jive_internal="true" href="https://community.esri.com/thread/102954"&gt;https://community.esri.com/thread/102954&lt;/A&gt; where the geometry method measureOnLine was used. I'm trying to determine how to use the same method for calculating the chainage (accumulated distance) along a cross-section polyline. I need to extract the profile of each cross-section into a point feature class based on the position of the vertices within each cross-section polyline. I would like to end up with a point feature class with the following fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ID (Cross-Section)&lt;/LI&gt;&lt;LI&gt;Z (Elevation)&lt;/LI&gt;&lt;LI&gt;Chainage (Distance m from start of polyline)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The chainage will be the accumulative distance (i.e. XS point 1 = 0 ; XS point 2 = 20m ; XS point 3 = 35m etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use the polyline Z Feature Class to generate a pointGeometry Object and iterate through each point that will be used as the point for the measureOnLine method against the original Polyline Feature Class. The determined length (Chainage) will be inserted (i.e. InsertCursor) with the Point Object ; ID (Cross Section Field) and Chainage into a newly generated feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still very new to ArcPy and Python and battling to figure out how to iterate through the PointGeometry from the Polyline to use the measureOnline method and then insert the Point Geometry ; ID ; Chainage into a new Feature Class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help in getting going will trully be appreciated. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter Wilson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 19:50:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-arcpy-geometry-measureonline/m-p/466292#M36448</guid>
      <dc:creator>PeterWilson</dc:creator>
      <dc:date>2014-08-14T19:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ArcPy Geometry MeasureOnLine</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-geometry-measureonline/m-p/466293#M36449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;OL&gt;&lt;LI&gt;Use feature vertices to point tool for converting all vertices of your polyline to point feature class &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000003p000000" title="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000003p000000"&gt;ArcGIS Desktop&lt;/A&gt;‌&lt;/LI&gt;&lt;LI&gt;Use Add XY Coordinates tool &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000032000000" title="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000032000000"&gt;ArcGIS Desktop&lt;/A&gt;‌. This will add XY coordinates as well as Z values.&lt;/LI&gt;&lt;LI&gt;Use search cursor to iterate through point FC created in step 2.&lt;/LI&gt;&lt;LI&gt;Use ORIG_FID on the point feature class to search your polyline,&lt;/LI&gt;&lt;LI&gt;Use Point FC shape as point input for &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;measureOnLine method. You got your chainage here.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Update your Point feature with chainage.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Alternatively:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Use Create routes tool to create an M aware polyline from your Z polyline. &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//003m00000005000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//003m00000005000000"&gt;ArcGIS Help 10.1&lt;/A&gt;‌, set measure source as length.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Now your polyline has both Z and M (which is distance from start of the line)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Use feature vertices to point tool for converting all vertices of your polyline to point feature class &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000003p000000" title="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000003p000000"&gt;ArcGIS Desktop&lt;/A&gt;‌&lt;/LI&gt;&lt;LI&gt;Use Add XY Coordinates tool &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000032000000" title="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000032000000"&gt;ArcGIS Desktop&lt;/A&gt;‌. This will add XY coordinates as well as Z and M values.&lt;/LI&gt;&lt;LI&gt;You got what you wanted, all these can be done through model builder and you export it out as python script if you want.&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 15:34:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-arcpy-geometry-measureonline/m-p/466293#M36449</guid>
      <dc:creator>RiyasDeen</dc:creator>
      <dc:date>2014-08-15T15:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ArcPy Geometry MeasureOnLine</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-geometry-measureonline/m-p/466294#M36450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are interested in Python, let's throw in some Python code. I haven't tested the code, since the measureOnLine method was introduced at 10.2.1 and I have a lower version here. The rest of the code seems to work though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the code below:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Lines 5 and 6 define the path to you input 3D lines and output points (which will be created in the process)&lt;/LI&gt;&lt;LI&gt;Lines 9 to 12 define the column names. fld_ID should point at an existing field in you input featureclass, which will be transferred to the output points&lt;/LI&gt;&lt;LI&gt;Lines 18 and 19 read some properties of the input featureclass, used to create the output pointfeatureclass and the ID field&lt;/LI&gt;&lt;LI&gt;Lines 22 till 28 will create the empty point featureclass&lt;/LI&gt;&lt;LI&gt;Lines 31 till 34 will add the output fields to the point featureclass&lt;/LI&gt;&lt;LI&gt;lines 40 and 42 define the insert cursor (points) and search cursor (lines)&lt;/LI&gt;&lt;LI&gt;Rest of the lines perform a loop through the points of each part of the polyline, and determine the values you're interested in&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it works for you, good luck, Xander&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14081217715582020 jive_text_macro" jivemacro_uid="_14081217715582020"&gt;
&lt;P&gt;import arcpy, os&lt;/P&gt;
&lt;P&gt;arcpy.env.overwriteOutput = True&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# featureclasses&lt;/P&gt;
&lt;P&gt;fc_in = r"D:\Xander\GeoNet\3Dlines2Points\test.gdb\my3Dlines"&lt;/P&gt;
&lt;P&gt;fc_out = r"D:\Xander\GeoNet\3Dlines2Points\test.gdb\myPoints"&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# fields&lt;/P&gt;
&lt;P&gt;fld_ID = "ID" # ID of Cross-Section in line featureclass&lt;/P&gt;
&lt;P&gt;fld_Number = "Number" # just to add a number to the points&lt;/P&gt;
&lt;P&gt;fld_Z = "Z" # Elevation&lt;/P&gt;
&lt;P&gt;fld_Chainage = "Chainage" # Distance m from start of polyline&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# fields for search cursor on input lines&lt;/P&gt;
&lt;P&gt;flds_in = ("SHAPE@", fld_ID)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# get some input data to create the output&lt;/P&gt;
&lt;P&gt;sr = arcpy.Describe(fc_in).spatialReference&lt;/P&gt;
&lt;P&gt;ofld_ID = arcpy.ListFields(fc_in, fld_ID)[0]&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# create the output featureclass&lt;/P&gt;
&lt;P&gt;geometry_type = "POINT"&lt;/P&gt;
&lt;P&gt;template = ""&lt;/P&gt;
&lt;P&gt;has_m = "DISABLED" # you could enable M values...&lt;/P&gt;
&lt;P&gt;has_z = "ENABLED"&lt;/P&gt;
&lt;P&gt;ws_path, fc_out_name = os.path.split(fc_out)&lt;/P&gt;
&lt;P&gt;arcpy.CreateFeatureclass_management(ws_path, fc_out_name,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometry_type, template, has_m, has_z, sr)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# add the fields to the point featureclass&lt;/P&gt;
&lt;P&gt;arcpy.AddField_management(fc_out, fld_ID, ofld_ID.type)&lt;/P&gt;
&lt;P&gt;arcpy.AddField_management(fc_out, fld_Number, "LONG")&lt;/P&gt;
&lt;P&gt;arcpy.AddField_management(fc_out, fld_Z, "DOUBLE")&lt;/P&gt;
&lt;P&gt;arcpy.AddField_management(fc_out, fld_Chainage, "DOUBLE" )&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# fields for insert cursor on output points&lt;/P&gt;
&lt;P&gt;flds_out = ("SHAPE@", fld_ID, fld_Number, fld_Z, fld_Chainage)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# start insert cursor for output points&lt;/P&gt;
&lt;P&gt;with arcpy.da.InsertCursor(fc_out, flds_out) as curs_out:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # start search cursor on lines&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(fc_in, flds_in) as curs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in curs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number = 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyline = row[0]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line_ID = row[1]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for part in polyline:&lt;/P&gt;
&lt;P&gt;&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; for pnt in part:&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number += 1&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if pnt:&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ptGeom = arcpy.PointGeometry(pnt, sr)&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chainage = polyline.measureOnLine(ptGeom)&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elevation = pnt.Z&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curs_out.insertRow((ptGeom, line_ID, number, elevation, chainage))&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 17:03:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-arcpy-geometry-measureonline/m-p/466294#M36450</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-08-15T17:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ArcPy Geometry MeasureOnLine</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-geometry-measureonline/m-p/466295#M36451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was just thinking, I don't need the 10.2.1 functionality to do this. It is also possible to something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14081227436673376" jivemacro_uid="_14081227436673376"&gt;
&lt;P&gt;# start insert cursor for output points&lt;/P&gt;
&lt;P&gt;with arcpy.da.InsertCursor(fc_out, flds_out) as curs_out:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # start search cursor on lines&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(fc_in, flds_in) as curs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in curs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number = 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyline = row[0]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line_ID = row[1]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chainage = 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for part in polyline:&lt;/P&gt;
&lt;P&gt;&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; for pnt in part:&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number += 1&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if pnt:&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ptGeom = arcpy.PointGeometry(pnt, sr)&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if number &amp;gt; 1:&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chainage += ptGeom.distanceTo(prev_pnt)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # chainage = polyline.measureOnLine(ptGeom)&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elevation = pnt.Z&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curs_out.insertRow((ptGeom, line_ID, number, elevation, chainage))&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prev_pnt = ptGeom&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It uses the distanceTo on the point geometry to sum the traveled distance on the line...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 17:13:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-arcpy-geometry-measureonline/m-p/466295#M36451</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-08-15T17:13:15Z</dc:date>
    </item>
  </channel>
</rss>

