<?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: Distance between start- and end-points in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430782#M14460</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have the coordinates of the points (P1, P2) then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d = Math.sqrt(Math.Pow(P1.x - p2.X, 2) + Math.Pow(P1.y - P2.y, 2))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Aug 2014 23:57:25 GMT</pubDate>
    <dc:creator>RiyasDeen</dc:creator>
    <dc:date>2014-08-12T23:57:25Z</dc:date>
    <item>
      <title>Distance between start- and end-points</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430781#M14459</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;How do I measure the distance between the start and end points of a line?&amp;nbsp; So not the length of the line itself, but the straight line distance between the two points?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Mike.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Aug 2014 23:22:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430781#M14459</guid>
      <dc:creator>MikeLouwrens</dc:creator>
      <dc:date>2014-08-12T23:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between start- and end-points</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430782#M14460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have the coordinates of the points (P1, P2) then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d = Math.sqrt(Math.Pow(P1.x - p2.X, 2) + Math.Pow(P1.y - P2.y, 2))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Aug 2014 23:57:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430782#M14460</guid>
      <dc:creator>RiyasDeen</dc:creator>
      <dc:date>2014-08-12T23:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between start- and end-points</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430783#M14461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to calculate this for a line feature class you can follow these steps - not sure if there is a simpler way but it works &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Make sure you have a unique field that identifies each line, for example copy the object id into a new field called LineID.&lt;/LI&gt;&lt;LI&gt;Add the following fields to your data: StartX, StartY, EndX, EndY,&amp;nbsp; LineDist (all double field type)&lt;/LI&gt;&lt;LI&gt;Open the attribute table, right-click on the new field headers and use the Calculate Geometry option to populate the fields (X Coordinate of Line Start, Y Coordinate of Line Start, etc)&lt;/LI&gt;&lt;LI&gt;From the attribute table Export the data as PointData and add it to the map (this makes the next step easier).&lt;/LI&gt;&lt;LI&gt;Go to File &amp;gt; Add Data &amp;gt; Add XY Data and select your PointData table.&lt;/LI&gt;&lt;LI&gt;Set your X and Y from your StartX and StartY.&lt;/LI&gt;&lt;LI&gt;When the layer is added, right click on it and export the point feature class as StartPoints.&lt;/LI&gt;&lt;LI&gt;Repeat steps 5-7 to create the EndPoints feature class.&lt;/LI&gt;&lt;LI&gt;Use the Merge tool to combine StartPoints and EndPoints into a single AllPoints feature class.&lt;/LI&gt;&lt;LI&gt;Use the Points to Line tool to create lines from your points. Select LinePoints as your input, specify an output feature class and make sure to select LineID as your Line Field parameter.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you should have a new feature class with straight lines between your original start and end points. Open the attribute table and the lengths are all there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can join this data back to your original line feature class using the LineID and calculate LineDist = Shape_Length (from the join data).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 00:48:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430783#M14461</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-08-13T00:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between start- and end-points</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430784#M14462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Riyas Deen wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;If you have the coordinates of the points (P1, P2) then.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;d = Math.sqrt(Math.Pow(P1.x - p2.X, 2) + Math.Pow(P1.y - P2.y, 2))&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'm sorry, but where do I input that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Mike.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 00:57:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430784#M14462</guid>
      <dc:creator>MikeLouwrens</dc:creator>
      <dc:date>2014-08-13T00:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between start- and end-points</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430785#M14463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Owen Earley wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;If you want to calculate this for a line feature class you can follow these steps - not sure if there is a simpler way but it works &lt;SPAN class="emoticon-inline emoticon_happy" style="height: 16px; width: 16px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Make sure you have a unique field that identifies each line, for example copy the object id into a new field called LineID.&lt;/LI&gt;
&lt;LI&gt;Add the following fields to your data: StartX, StartY, EndX, EndY,&amp;nbsp; LineDist (all double field type)&lt;/LI&gt;
&lt;LI&gt;Open the attribute table, right-click on the new field headers and use the Calculate Geometry option to populate the fields (X Coordinate of Line Start, Y Coordinate of Line Start, etc)&lt;/LI&gt;
&lt;LI&gt;From the attribute table Export the data as PointData and add it to the map (this makes the next step easier).&lt;/LI&gt;
&lt;LI&gt;Go to File &amp;gt; Add Data &amp;gt; Add XY Data and select your PointData table.&lt;/LI&gt;
&lt;LI&gt;Set your X and Y from your StartX and StartY.&lt;/LI&gt;
&lt;LI&gt;When the layer is added, right click on it and export the point feature class as StartPoints.&lt;/LI&gt;
&lt;LI&gt;Repeat steps 5-7 to create the EndPoints feature class.&lt;/LI&gt;
&lt;LI&gt;Use the Merge tool to combine StartPoints and EndPoints into a single AllPoints feature class.&lt;/LI&gt;
&lt;LI&gt;Use the Points to Line tool to create lines from your points. Select LinePoints as your input, specify an output feature class and make sure to select LineID as your Line Field parameter.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Now you should have a new feature class with straight lines between your original start and end points. Open the attribute table and the lengths are all there. &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;You can join this data back to your original line feature class using the LineID and calculate LineDist = Shape_Length (from the join data).&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK I see how that works &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; I'm hoping for something with fewer steps, however if it comes to it I can use this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Mike.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 00:58:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430785#M14463</guid>
      <dc:creator>MikeLouwrens</dc:creator>
      <dc:date>2014-08-13T00:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between start- and end-points</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430786#M14464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below function lets you calculate the shortest distance between start and end point of a line as an attribute column in arcmap. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;def CalculateDistance(shape):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; startPoint = shape.firstPoint&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; endPoint = shape.lastPoint&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; return math.sqrt( math.pow( startPoint.X - endPoint.X, 2 ) + math.pow( startPoint.Y - endPoint.Y, 2 ))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/3397_Untitled.png" style="width: 620px; height: 496px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 01:25:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430786#M14464</guid>
      <dc:creator>RiyasDeen</dc:creator>
      <dc:date>2014-08-13T01:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between start- and end-points</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430787#M14465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you, that does exactly what I'm after &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much appreciated,&lt;/P&gt;&lt;P&gt;Mike.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 01:31:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430787#M14465</guid>
      <dc:creator>MikeLouwrens</dc:creator>
      <dc:date>2014-08-13T01:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between start- and end-points</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430788#M14466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very nice - this works great and is very simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The results are identical to my long-winded process. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 01:41:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430788#M14466</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-08-13T01:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between start- and end-points</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430789#M14467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to add, you can avoid doing the math by hand using arcpy's &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/PointGeometry/018z00000039000000/"&gt;PointGeomtry &lt;/A&gt;objects and distanceTo().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14086452425964830 jive_text_macro" jivemacro_uid="_14086452425964830"&gt;
&lt;P&gt;&lt;STRONG&gt;def CalculateDistance(shape):&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return arcpy.PointGeometry(shape.firstPoint).distanceTo(arcpy.PointGeometry(shape.lastPoint))&lt;/STRONG&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 18:16:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/distance-between-start-and-end-points/m-p/430789#M14467</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2014-08-21T18:16:57Z</dc:date>
    </item>
  </channel>
</rss>

