<?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: how to calculate the distance between two points using python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32079#M2536</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you mention Network Analyst, would you please clarify whether you require the distance between points along a line (e.g. along a winding road), or the straight-line distance between pairs of points?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 May 2015 20:08:06 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2015-05-06T20:08:06Z</dc:date>
    <item>
      <title>how to calculate the distance between two points using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32074#M2531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello everyone, I am a newbie on python. I am stuck by the calculation of distance between two points along a given line. My primary task is to calculate the distance among different points respectively and make some comparison.&amp;nbsp; And I don't want to use network analyst. Any helps would be appreciated.Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2015 14:28:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32074#M2531</guid>
      <dc:creator>mikebei</dc:creator>
      <dc:date>2015-05-05T14:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the distance between two points using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32075#M2532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not to answer your question directly, but to throw you in the deep end..&amp;nbsp; you need to study how python interacts with arcmap, through the arcpy module.&amp;nbsp; Begin exploring the &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/What_is_ArcPy/000v000000v7000000/"&gt;arcpy functions and classes section &lt;/A&gt;of the help files and the code snippets.&amp;nbsp; Of course you will have to determine whether you want the distances between just points that could form a line, the vertices of a polyline,&amp;nbsp; point(s) you wish to put along a polyline, etc&lt;/P&gt;&lt;P&gt;EDIT&lt;/P&gt;&lt;P&gt;And there were some suggestions on here as well &lt;A href="http://gis.stackexchange.com/questions/145117/how-to-calculate-the-distance-between-two-points-using-python" title="http://gis.stackexchange.com/questions/145117/how-to-calculate-the-distance-between-two-points-using-python"&gt;how to calculate the distance between two points using python - Geographic Information Systems Stack Exchange&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2015 14:51:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32075#M2532</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-05-05T14:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the distance between two points using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32076#M2533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Check out the Polyline object, specifically the measureOnLine method:&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Polyline/018z00000008000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#/Polyline/018z00000008000000/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give you the measure of the point &lt;STRONG&gt;on the line&lt;/STRONG&gt;, from the start of the line. Repeat for both points and find the difference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2015 15:16:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32076#M2533</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-05-05T15:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the distance between two points using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32077#M2534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To calculate distance between two points, you could just do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import math
def calculateDistance(x1,y1,x2,y2):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return dist
print calculateDistance(x1, y1, x2, y2)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it is along a line, you could just split the line with the points and use the length of the line for that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:16:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32077#M2534</guid>
      <dc:creator>CarlSunderman</dc:creator>
      <dc:date>2021-12-10T21:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the distance between two points using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32078#M2535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a GitHub for finding the distance between two points using great circle distance:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://gist.github.com/gabesmed/1826175" title="https://gist.github.com/gabesmed/1826175"&gt;great circle distance in python&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's also geopy, which has built-in methods:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pypi.python.org/pypi/geopy" title="https://pypi.python.org/pypi/geopy"&gt;geopy 1.10.0 : Python Package Index&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You wouldn't even need to use ArcGIS to figure this out if you simply have a csv of point pairs to conduct the calculation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 19:09:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32078#M2535</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2015-05-06T19:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the distance between two points using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32079#M2536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you mention Network Analyst, would you please clarify whether you require the distance between points along a line (e.g. along a winding road), or the straight-line distance between pairs of points?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 20:08:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32079#M2536</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-05-06T20:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the distance between two points using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32080#M2537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a good and important clarification... At least for the examples I gave, they are only valid for calculating distances "as the crow flies" between two given points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 20:17:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32080#M2537</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2015-05-06T20:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the distance between two points using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32081#M2538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is the question of the week everywhere&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.stackexchange.com/questions/146277/calculating-the-shortest-distance-along-a-given-line-using-python" title="http://gis.stackexchange.com/questions/146277/calculating-the-shortest-distance-along-a-given-line-using-python"&gt;Calculating the shortest distance along a given line using python - Geographic Information Systems Stack Exchange&lt;/A&gt; &lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.stackexchange.com/questions/145117/how-to-calculate-the-distance-between-two-points-using-python" title="http://gis.stackexchange.com/questions/145117/how-to-calculate-the-distance-between-two-points-using-python"&gt;how to calculate the distance between two points using python - Geographic Information Systems Stack Exchange&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 00:41:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32081#M2538</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-05-07T00:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate the distance between two points using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32082#M2539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carl, many thanks for your hint. your kindness will be well rewarded &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 11:56:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-calculate-the-distance-between-two-points/m-p/32082#M2539</guid>
      <dc:creator>mikebei</dc:creator>
      <dc:date>2015-05-08T11:56:50Z</dc:date>
    </item>
  </channel>
</rss>

