<?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: Measure distance between points in a certain order? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/measure-distance-between-points-in-a-certain-order/m-p/349215#M12127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your points much be in a projected coordinate system...(eg UTM etc etc) note just the data frame.&amp;nbsp; The following field calculator function can be used with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parser&amp;nbsp; Python&lt;/P&gt;&lt;P&gt;Expression&amp;nbsp; &lt;STRONG style="font-size: 14.3999996185303px;"&gt;dist_between(!Shape!)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14.3999996185303px;"&gt;code block below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14.3999996185303px;"&gt;Ensure that the spacing is correct for the indent levels...ie use 2 spaces per level.&amp;nbsp; If your data are not projected the answers will be in fractions of degrees and worthless.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;''' input shape field: returns the distance between points and its center
dist_between(!Shape!)&amp;nbsp;&amp;nbsp;&amp;nbsp; #enter into the expression box'''
x0 = 0.0;&amp;nbsp; y0 = 0.0
def dist_between(shape):
&amp;nbsp; global x0;&amp;nbsp; global y0
&amp;nbsp; x = shape.firstpoint.X; y = shape.firstpoint.Y
&amp;nbsp; if x0 == 0.0 and y0 == 0.0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; x0 = x; y0 = y
&amp;nbsp; distance = math.sqrt((x - x0)**2 + (y - y0)**2)
&amp;nbsp; x0 = x;&amp;nbsp; y0 = y
&amp;nbsp; return distance&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 16:26:05 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-11T16:26:05Z</dc:date>
    <item>
      <title>Measure distance between points in a certain order?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/measure-distance-between-points-in-a-certain-order/m-p/349214#M12126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have points representing animal movement, each point has a date when it was captured in the field. I then created a path of movement (line) showing where the animal moved based on the date order. Now I want to measure the distance btw each date, how far the animal movement from one day to the next. I can't find a tool that will work that I know of.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2014 23:47:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/measure-distance-between-points-in-a-certain-order/m-p/349214#M12126</guid>
      <dc:creator>AngelaDwyer</dc:creator>
      <dc:date>2014-12-12T23:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Measure distance between points in a certain order?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/measure-distance-between-points-in-a-certain-order/m-p/349215#M12127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your points much be in a projected coordinate system...(eg UTM etc etc) note just the data frame.&amp;nbsp; The following field calculator function can be used with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parser&amp;nbsp; Python&lt;/P&gt;&lt;P&gt;Expression&amp;nbsp; &lt;STRONG style="font-size: 14.3999996185303px;"&gt;dist_between(!Shape!)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14.3999996185303px;"&gt;code block below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14.3999996185303px;"&gt;Ensure that the spacing is correct for the indent levels...ie use 2 spaces per level.&amp;nbsp; If your data are not projected the answers will be in fractions of degrees and worthless.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;''' input shape field: returns the distance between points and its center
dist_between(!Shape!)&amp;nbsp;&amp;nbsp;&amp;nbsp; #enter into the expression box'''
x0 = 0.0;&amp;nbsp; y0 = 0.0
def dist_between(shape):
&amp;nbsp; global x0;&amp;nbsp; global y0
&amp;nbsp; x = shape.firstpoint.X; y = shape.firstpoint.Y
&amp;nbsp; if x0 == 0.0 and y0 == 0.0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; x0 = x; y0 = y
&amp;nbsp; distance = math.sqrt((x - x0)**2 + (y - y0)**2)
&amp;nbsp; x0 = x;&amp;nbsp; y0 = y
&amp;nbsp; return distance&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:26:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/measure-distance-between-points-in-a-certain-order/m-p/349215#M12127</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T16:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Measure distance between points in a certain order?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/measure-distance-between-points-in-a-certain-order/m-p/349216#M12128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you already created a line between points. You just need to calculate line distance for each segment by "Calculate Geometry" tool in desired unit.&lt;/P&gt;&lt;P&gt;If you have polyline which is connecting consequence points, then you can split your line by "Split Line at Points" or "Split Line at Vertices" tools. Than you can calculate distance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Dec 2014 20:09:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/measure-distance-between-points-in-a-certain-order/m-p/349216#M12128</guid>
      <dc:creator>SuleymanARSLAN</dc:creator>
      <dc:date>2014-12-13T20:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Measure distance between points in a certain order?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/measure-distance-between-points-in-a-certain-order/m-p/349217#M12129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you use the "&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000003s000000"&gt;Points to Line&lt;/A&gt;" tool to create lines from your points, there is an option "Line Field (optional)" that allows you to guide the creation of the lines. In case you have 1 animal and several dates, you can create a date field that will allow the creation of a line per date. If the output is written to a file geodatabase, the output will have a length field with the length of the line (if they are in projected coordinate system as Dan indicated before). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case you have more than 1 animal, create a field that concatenate the ID of the animal and the date and use that as Line Field. This will create a line per date per animal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Dec 2014 23:02:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/measure-distance-between-points-in-a-certain-order/m-p/349217#M12129</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-12-13T23:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Measure distance between points in a certain order?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/measure-distance-between-points-in-a-certain-order/m-p/349218#M12130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all, I will try some of those suggestions!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 17:15:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/measure-distance-between-points-in-a-certain-order/m-p/349218#M12130</guid>
      <dc:creator>AngelaDwyer</dc:creator>
      <dc:date>2014-12-15T17:15:32Z</dc:date>
    </item>
  </channel>
</rss>

