<?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: get vertex coordinates in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591200#M19597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Very nice - This is actually quite usefull to me - I have done some projects in the past doing network anaylysis on logging roads... And I was looking for a way to apply some factors that would describe how "difficult" the road is to manuver (road type as well as each segment's vertical/horizontal complexity). When I get back to my routing project (months away), I'll try to post some code that uses z values as well. Thanks for posting the code...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Chris! Did you ever happen to have time to update the code to take into account Z values?&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Mar 2014 20:21:38 GMT</pubDate>
    <dc:creator>JodieGosselin</dc:creator>
    <dc:date>2014-03-11T20:21:38Z</dc:date>
    <item>
      <title>get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591189#M19586</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;it's been a while since my last python scripting - now I need to solve this problem and I'm stuck &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I know it is something easy, but I can't make it work, so I'm asking for help... I want to get coordinates (X and Y) of each vertex of line - that is easy with &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Reading_geometries/002z0000001t000000/" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Reading_geometries/002z0000001t000000/&lt;/A&gt;&lt;SPAN&gt; - but in every loop I need to get coordinates of next two point as well (for making some calculations) and that is my problem....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help with this little problem please?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bart&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 10:43:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591189#M19586</guid>
      <dc:creator>J_B__K_</dc:creator>
      <dc:date>2012-02-08T10:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591190#M19587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could read the verticies into a python list... actually a series of imbedded lists. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#assuming all features are single part!!!
import arcpy
fcVertexList = []
lineFC = r"C:\temp\test.shp"
dsc = arcpy.Describe(lineFC)
shapeFieldName = dsc.ShapeFieldName
featureNumber = 0
searchRows = arcpy.SearchCursor(lineFC)
for searchRow in searchRows:
&amp;nbsp;&amp;nbsp; featureNumber = featureNumber + 1
&amp;nbsp;&amp;nbsp; fcVertexList.append([])
&amp;nbsp;&amp;nbsp; shapeObj = searchRow.getValue(shapeFieldName)
&amp;nbsp;&amp;nbsp; partObj = shapeObj.getPart(0)
&amp;nbsp;&amp;nbsp; for pointObj in partObj:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcVertexList[featureNumber - 1].append([pointObj.X, pointObj.Y])&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then it's just a simple matter of slicing a Python list:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To retreive all the verticies for the 1st feature:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; print fcVertexList[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To cound how many verticies are in the 1st feature:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; print len(fcVertexList[0])&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To retreive the first three verticies for the first feature:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; fcVertexList[0][0:3]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To retreive the next three verticies (incremented by 1 vertex) for the first feature:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; fcVertexList[0][1:4]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:23:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591190#M19587</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-12T01:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591191#M19588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Chris for your answer. I know I can store coordinates of verticies in a list and then just simply read what I want, but I was wondering if there is any "smarter" way... if it is quite a big shapefile/feature class (in my case - roads), it takes some time to write all coordinates into list and it takes quite a lot of memory. What I need is to calculate some characteristics of each line (analytical geometry - vectors and so... in my case I want to get the "angle change" of each line) and store it in new field - it should be better to calculate the characteristic directly, without writing coordinates into list, like &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;"take line - get coordinates of points 1-3 - calculate angle change - store the value - move to points 2-3 and repeat..."&lt;/SPAN&gt;&lt;SPAN&gt;... Is this possible? (Or, just to be sure - is there any better way to calculate the "angle change" of each line?:))&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 05:49:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591191#M19588</guid>
      <dc:creator>J_B__K_</dc:creator>
      <dc:date>2012-02-09T05:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591192#M19589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could use a list that only contains the 3 vertices in question. As you traverse each line, after calculating the values for each vertex, use list.pop(0) to remove the oldest vertex and list.append() to add the new. That should simplify your equations, because they will only reference list[0], list[1], and list[2].&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 11:42:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591192#M19589</guid>
      <dc:creator>BruceNielsen</dc:creator>
      <dc:date>2012-02-09T11:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591193#M19590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sure you can do it in the cursor... I guess an update cursor so you could then populate your angle statistic field value, right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It'd look something like this then:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#assuming all features are single part!!! import arcpy lineFC = r"C:\temp\test.shp" dsc = arcpy.Describe(lineFC) shapeFieldName = dsc.ShapeFieldName featureNumber = 0 updateRows = arcpy.UpdateCursor(lineFC) for updateRow in updateRows: &amp;nbsp;&amp;nbsp; vertexList = [] &amp;nbsp;&amp;nbsp; shapeObj = updateRow.getValue(shapeFieldName) &amp;nbsp;&amp;nbsp; partObj = shapeObj.getPart(0) &amp;nbsp;&amp;nbsp; for pointObj in partObj: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vertexList.append((pointObj.X, pointObj.Y)) &amp;nbsp;&amp;nbsp; vertexCount = len(vertexList) &amp;nbsp;&amp;nbsp; if vertexCount &amp;lt; 3: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break #if only two verticies in the line, break the loop since there is no "angle" to calculate &amp;nbsp;&amp;nbsp; i = 0 # &amp;nbsp;&amp;nbsp; while i + 3 &amp;lt;= vertexCount: #that is until you run out of vertex triplicate pairs to count&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x1 = vertexList&lt;I&gt;[0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y1 = vertexList&lt;I&gt;[1] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x2 = vertexList[i + 1][0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y2 = vertexList[i + 1][1] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x3 = vertexList[i + 2][0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y3 = vertexList[i + 2][1] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; funkyStat = (x1 + y2) / 1.61803399 #blah blah whatever formula &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = i + 1 &amp;nbsp;&amp;nbsp; updateRow.FUNKY_STAT = funkyStat &amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow) del updateRow, updateRows&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 16:09:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591193#M19590</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-02-09T16:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591194#M19591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Sure you can do it in the cursor... I guess an update cursor so you could then populate your angle statistic field value, right?&lt;BR /&gt;&lt;BR /&gt;It'd look something like this then:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt; &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, my funky statistic &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; is working perfectly that way... (just had a little problem with "break", but that's already solved)..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank to all of you for your help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 07:47:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591194#M19591</guid>
      <dc:creator>J_B__K_</dc:creator>
      <dc:date>2012-02-14T07:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591195#M19592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Glad it worked!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A request for you: Many of us have an interest in seeing this forum also serve as a sort of a code/algorithm library... That said, it sounds like the statistic you are calculating is some sort of "maximum angle" statistic. If so, would you mind posting your code? Even if not, it sounds interesting, and I bet a lot of people would find it useful. If not, that's okay too.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 15:06:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591195#M19592</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-02-14T15:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591196#M19593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry for late response - so much another work to do:( Ok, I understand, no problem with posting the code. Just to make it clear - it calculates "average curvature" of each line (angular change devided by length of line). I'm pretty sure there is a room for improvement in the script, I just did not have enough time to work on it...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#
# This script calculates average "curvature" of roads
#
# It takes a line feature class (with pre-added fields "angleChng" and "AvCurv"!)
# then takes the fist line
# then takes first three verticies
# and calculates the angular change of line between those three verticies
# then it loops through all verticies of the line, calculates angular changes and cumulates them
# after going through whole line, it writes down the total angular change, calculates and writes down the average curvature
# and then this is repeated for all lines in the feature class
#

import arcpy, math, datetime, numpy
from arcpy import env
print "starting"
start = datetime.datetime.now() # for calculating time of process
lineFC = r"roads.shp" # input fc - with pre-added fields "angleChng" and "AvCurv"!
dsc = arcpy.Describe(lineFC)
shapeFieldName = dsc.ShapeFieldName
updateRows = arcpy.UpdateCursor(lineFC)
for updateRow in updateRows: # looping through lines
&amp;nbsp;&amp;nbsp; vertexList = []
&amp;nbsp;&amp;nbsp; shapeObj = updateRow.getValue(shapeFieldName)
&amp;nbsp;&amp;nbsp; partObj = shapeObj.getPart(0)
&amp;nbsp;&amp;nbsp; for pointObj in partObj: 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vertexList.append((pointObj.X, pointObj.Y)) # getting coordinates of all line vertices
&amp;nbsp;&amp;nbsp; vertexCount = len(vertexList)
&amp;nbsp;&amp;nbsp; i = 0
&amp;nbsp;&amp;nbsp; angularChange=0
&amp;nbsp;&amp;nbsp; averageCurvature=0
&amp;nbsp;&amp;nbsp; while i + 3 &amp;lt;= vertexCount: # that is until you run out of vertex triplicate pairs to count 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x1 = vertexList&lt;I&gt;[0] # coordinates of three vertices
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y1 = vertexList&lt;I&gt;[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x2 = vertexList[i + 1][0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y2 = vertexList[i + 1][1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x3 = vertexList[i + 2][0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y3 = vertexList[i + 2][1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; u1=x1-x2 # vectors (BA and BC !)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; u2=y1-y2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v1=x3-x2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v2=y3-y2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cit=(u1*v1)+(u2*v2) # calculating the angle of vectors
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jmen1=math.sqrt((u1*u1)+(u2*u2))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jmen2=math.sqrt((v1*v1)+(v2*v2))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jmen=jmen1*jmen2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cosfi=cit/jmen
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fiRad=numpy.arccos(cosfi) # angle of vectors [rad]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fiGrad=fiRad*200/math.pi
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fiGrad=200-fiGrad # angle change of one segment of line [grad]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; angularChange=angularChange+fiGrad # total angle change of line
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = i + 1
&amp;nbsp;&amp;nbsp; averageCurvature=angularChange/shapeObj.length*1000 # average curvature of line = angle change in one kilometer
&amp;nbsp;&amp;nbsp; updateRow.angleChng=angularChange # adding angle change of line
&amp;nbsp;&amp;nbsp; updateRow.AvCurv=averageCurvature # adding average curvature of line
&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow)
print "Done in ",datetime.datetime.now() - start, " seconds"
del updateRows, updateRow, lineFC&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Btw.: Maybe a newbie question, but i didn't find any solution yet - Is it possible to add field into fc (with fieldName as a variable) and the to use something like updateRow.fieldName? (if using posted script, it is necessary to have "pre-added" fields - it would be much easier to add them in the beginning of the script...) Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:23:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591196#M19593</guid>
      <dc:creator>J_B__K_</dc:creator>
      <dc:date>2021-12-12T01:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591197#M19594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Very nice - This is actually quite usefull to me - I have done some projects in the past doing network anaylysis on logging roads... And I was looking for a way to apply some factors that would describe how "difficult" the road is to manuver (road type as well as each segment's vertical/horizontal complexity). When I get back to my routing project (months away), I'll try to post some code that uses z values as well. Thanks for posting the code...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 15:30:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591197#M19594</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-02-24T15:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591198#M19595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Maybe a newbie question, but i didn't find any solution yet - Is it possible to add field into fc (with fieldName as a variable) and the to use something like updateRow.fieldName? (if using posted script, it is necessary to have "pre-added" fields - it would be much easier to add them in the beginning of the script...) Thanks! &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the field is a variable, you have to use the .getValue (for read access) or .setValue (for write access) methods. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;field1 = "FIELD1"
field2 = "FIELD2"
updateRows = arcpy.UpdateCursor(fc)
for updateRow in updateRows:
&amp;nbsp;&amp;nbsp; field1Value = updateRow.getValue(field1)
&amp;nbsp;&amp;nbsp; updateRow.setValue(field2, field1Value / 2)
&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow)
del updateRow, updateRows&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:23:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591198#M19595</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-12T01:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591199#M19596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Very nice - This is actually quite usefull to me - I have done some projects in the past doing network anaylysis on logging roads... And I was looking for a way to apply some factors that would describe how "difficult" the road is to manuver (road type as well as each segment's vertical/horizontal complexity). When I get back to my routing project (months away), I'll try to post some code that uses z values as well. Thanks for posting the code...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Glad you've found it usefull! This is exactly the purpose - to make network analysis more precise by considering road´s "curvature"... I'm focusing on this theme in my diploma thesis...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for advice with adding and using fields!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 08:33:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591199#M19596</guid>
      <dc:creator>J_B__K_</dc:creator>
      <dc:date>2012-02-27T08:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591200#M19597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Very nice - This is actually quite usefull to me - I have done some projects in the past doing network anaylysis on logging roads... And I was looking for a way to apply some factors that would describe how "difficult" the road is to manuver (road type as well as each segment's vertical/horizontal complexity). When I get back to my routing project (months away), I'll try to post some code that uses z values as well. Thanks for posting the code...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Chris! Did you ever happen to have time to update the code to take into account Z values?&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 20:21:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591200#M19597</guid>
      <dc:creator>JodieGosselin</dc:creator>
      <dc:date>2014-03-11T20:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: get vertex coordinates</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591201#M19598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sadly I did not - but it would be pretty easy to include using the code example above.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In fact it could be easier, since all you really would need to calculate is slope of each segment (and then calculate a mean, or max or whatever).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It'd be even cooler to "length weight" the mean angle/slope values too...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You know - an even cooler researchy thing... Go drive around in a car with a GPS (tracking on), and build a data driven model based on actual observations (what exactly is the correlation between geometry complexity and speed). Logging roads would be way more fun than the city... Maybe get a turbo WRX or something to help with the field recon :cool:.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 21:02:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-vertex-coordinates/m-p/591201#M19598</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2014-03-11T21:02:49Z</dc:date>
    </item>
  </channel>
</rss>

