<?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: Start and End Points of a line (Field Calculator) in Python Snippets Questions</title>
    <link>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818687#M332</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is built-in as a tool, open your table and check out Calculate field tool options, one of which allows you to calculate polyline properties&lt;/P&gt;&lt;P&gt;​&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Using_the_Calculate_Field_tool/005s00000029000000/"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#/Using_the_Calculate_Field_tool/005s00000029000000/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Apr 2015 01:20:28 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2015-04-28T01:20:28Z</dc:date>
    <item>
      <title>Start and End Points of a line (Field Calculator)</title>
      <link>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818686#M331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm interested in calculating the start and end points of a line in the field calculator. I've researched several boards and I cannot come up with code that successfully calculates the geometry. Does anyone have any ideas? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 01:07:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818686#M331</guid>
      <dc:creator>JessicaKnapp</dc:creator>
      <dc:date>2015-04-28T01:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Start and End Points of a line (Field Calculator)</title>
      <link>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818687#M332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is built-in as a tool, open your table and check out Calculate field tool options, one of which allows you to calculate polyline properties&lt;/P&gt;&lt;P&gt;​&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Using_the_Calculate_Field_tool/005s00000029000000/"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#/Using_the_Calculate_Field_tool/005s00000029000000/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 01:20:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818687#M332</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-04-28T01:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Start and End Points of a line (Field Calculator)</title>
      <link>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818688#M333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jessica,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could add a new field in attribute table and use &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//005s00000027000000"&gt;Calculate Geometry&lt;/A&gt; to get the desired geometric properties.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/91166_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 06:14:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818688#M333</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2015-04-28T06:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Start and End Points of a line (Field Calculator)</title>
      <link>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818689#M334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At 10.0 and above you have to use Python to do geometry calculations with the Field Calculator.&amp;nbsp; The calculation to extract the Start point coordinates is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;!Shape.FirstPoint.X! (or Y, Z, or M)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The End point coordinates is similar:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;!Shape.LastPoint.X! (or Y, Z or M)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See my &lt;A _jive_internal="true" href="https://community.esri.com/message/176978#176978"&gt;responses in this thread&lt;/A&gt; for more geometry options.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2015 12:55:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818689#M334</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2015-06-05T12:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Start and End Points of a line (Field Calculator)</title>
      <link>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818690#M335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is an older thread, but since I just had to do this for one of my scripts, I thought I would share the code I used.&amp;nbsp; In my case, I already created a fishnet, as polylines that are clipped by a study area, and then converted&amp;nbsp; the "multipart" segments to "singlepart" (so each segment in separate) ...but it should be able to work with any line.&amp;nbsp; I addfields called x1, y1, x2, y2 for my needs...but you can name whatever works for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fishnetFC =&amp;nbsp; r"C:\Prep.gdb\FishnetIntersect_L_single"

ptFields = [["X1", "!SHAPE.firstPoint.X!"], ["Y1", "!SHAPE.firstPoint.Y!"], ["X2", "!SHAPE.lastPoint.X!"], ["Y2", "!SHAPE.lastPoint.Y!"]]
for field in ptFields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print("adding field {0}...".format(field[0]))
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(fishnetFC, field[0], "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print("&amp;nbsp; calcing field {0} to be {1}".format(field[0], field[1]))
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management(fishnetFC, field[0], field[1], "PYTHON_9.3" )&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In any case Jessica, you should mark helpful comments as such, and either mark this as "assumed answered" or the answer that best solved your issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:41:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818690#M335</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-12T09:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Start and End Points of a line (Field Calculator)</title>
      <link>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818691#M336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have marked the answer of Rebecca as the correct answer since it was place in Python snippets and code was requested, although the other answers are very good ones too, since you don't need code to do this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 12:29:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/start-and-end-points-of-a-line-field-calculator/m-p/818691#M336</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-01-14T12:29:53Z</dc:date>
    </item>
  </channel>
</rss>

