<?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: Calculate the distance between two sequential points in wkid 4326 (WGS84 Geographic)? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-the-distance-between-two-sequential/m-p/1548071#M89101</link>
    <description>&lt;P&gt;&amp;nbsp; I am also open to using Arcade or any other code solutions!&lt;/P&gt;</description>
    <pubDate>Fri, 11 Oct 2024 15:29:04 GMT</pubDate>
    <dc:creator>AustinLewis</dc:creator>
    <dc:date>2024-10-11T15:29:04Z</dc:date>
    <item>
      <title>Calculate the distance between two sequential points in EPSG 4326 (WGS84 Geographic)?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-the-distance-between-two-sequential/m-p/1548070#M89100</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a feature class of points representing positions that are ordered in such that they are chronological. The feature class is in WGS 84 geographic as it is part of a larger global dataset.&amp;nbsp; I am trying to calculate the geodesic distance between each point and the previous point in the field calculator. My problem is all the tools I can find/think (ex. point.distanceTo()) of are only appropriate for a planar projected dataset. Does anyone now a way of doing this? Eventually, I will use this distance to calculate speed.&lt;/P&gt;&lt;P&gt;What I have now would would for a projected&amp;nbsp; dataset. I will show that below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# In the field calculator
distance(!Shape!)

# In the code block
i=0
def distance(shape):
    global prev_point
    global i
    point = arcpy.PointGeometry(shape.getPart(0))
    if i &amp;gt; 0:
        distance = point.distanceTo(prev_point)
    else:
        distance = 0
    i+=1
    prev_point = point
    return distance
     &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 15:43:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-the-distance-between-two-sequential/m-p/1548070#M89100</guid>
      <dc:creator>AustinLewis</dc:creator>
      <dc:date>2024-10-11T15:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the distance between two sequential points in wkid 4326 (WGS84 Geographic)?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-the-distance-between-two-sequential/m-p/1548071#M89101</link>
      <description>&lt;P&gt;&amp;nbsp; I am also open to using Arcade or any other code solutions!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 15:29:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-the-distance-between-two-sequential/m-p/1548071#M89101</guid>
      <dc:creator>AustinLewis</dc:creator>
      <dc:date>2024-10-11T15:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the distance between two sequential points in EPSG 4326 (WGS84 Geographic)?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-the-distance-between-two-sequential/m-p/1548154#M89109</link>
      <description>&lt;P&gt;I have found my issue. I needed specify the spatial reference frame when generating my point object. Additionally, I used "angleAndDistanceTo() instead of distanceTo(), as it has the option of using the 'GEODESIC' method. I believed I used something like the code below.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# In the field calculator
distance(!Shape!)

# In the code block
i=0
def distance(shape):
    global prev_point
    global i
    spref = arcpy.SpatialReference(3426)
    point = arcpy.PointGeometry(shape.getPart(0),spref)
    if i &amp;gt; 0:
        angle, distance = point.angleAndDistanceTo(prev_point,'GEODESIC')
    else:
        distance = 0
    i+=1
    prev_point = point
    return distance&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 19:05:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-the-distance-between-two-sequential/m-p/1548154#M89109</guid>
      <dc:creator>AustinLewis</dc:creator>
      <dc:date>2024-10-11T19:05:46Z</dc:date>
    </item>
  </channel>
</rss>

