<?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 Arcgis Geometry Distance crushingly slow compared to geopy Distance in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-distance-crushingly-slow-compared/m-p/781899#M1238</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;&amp;nbsp;Possibly something for Ideas, but perhaps others have input before I suggest something.&amp;nbsp;I'm calculating distances in a notebook on a Spatially Enabled Dataframe. The SDF has just over 5,300 records, SR is 4326.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using %time in Jupyter (shame you can't use magics in Pro 2.5 notebooks interface), I run the same function twice, the only difference being the code line below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcgis.geometry.distance(sr, sdf_row['SHAPE'], prev_row['SHAPE'], 9001, True)['distance']&lt;/PRE&gt;&lt;P style="color: #000000; background-color: #ffffff; border: 0px; font-size: 14px; padding: 1px 0px;"&gt;Wall time: 1h 2min&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from geopy.distance import geodesic
...
geodesic((sdf_row['SHAPE'].y, sdf_row['SHAPE'].x), (prev_row['SHAPE'].y, prev_row['SHAPE'].x)).meters&lt;/PRE&gt;&lt;P style="color: #000000; background-color: #ffffff; border: 0px; font-size: 14px; padding: 1px 0px;"&gt;Wall time: 2.46 s&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is a staggering difference. There's no difference in the results given a reasonable precision.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;count   5394.0000000000 mean      -0.0000000018 std        0.0000000030 min       -0.0000000141 25%       -0.0000000025 50%       -0.0000000006 75%        0.0000000001 max        0.0000000034 Name: diff, dtype: float64


Why is arcgis.geometry.distance so slow?

Cheers
m&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 08:50:58 GMT</pubDate>
    <dc:creator>MartinSchaefer2</dc:creator>
    <dc:date>2021-12-12T08:50:58Z</dc:date>
    <item>
      <title>Arcgis Geometry Distance crushingly slow compared to geopy Distance</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-distance-crushingly-slow-compared/m-p/781899#M1238</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;&amp;nbsp;Possibly something for Ideas, but perhaps others have input before I suggest something.&amp;nbsp;I'm calculating distances in a notebook on a Spatially Enabled Dataframe. The SDF has just over 5,300 records, SR is 4326.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using %time in Jupyter (shame you can't use magics in Pro 2.5 notebooks interface), I run the same function twice, the only difference being the code line below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcgis.geometry.distance(sr, sdf_row['SHAPE'], prev_row['SHAPE'], 9001, True)['distance']&lt;/PRE&gt;&lt;P style="color: #000000; background-color: #ffffff; border: 0px; font-size: 14px; padding: 1px 0px;"&gt;Wall time: 1h 2min&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from geopy.distance import geodesic
...
geodesic((sdf_row['SHAPE'].y, sdf_row['SHAPE'].x), (prev_row['SHAPE'].y, prev_row['SHAPE'].x)).meters&lt;/PRE&gt;&lt;P style="color: #000000; background-color: #ffffff; border: 0px; font-size: 14px; padding: 1px 0px;"&gt;Wall time: 2.46 s&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is a staggering difference. There's no difference in the results given a reasonable precision.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;count   5394.0000000000 mean      -0.0000000018 std        0.0000000030 min       -0.0000000141 25%       -0.0000000025 50%       -0.0000000006 75%        0.0000000001 max        0.0000000034 Name: diff, dtype: float64


Why is arcgis.geometry.distance so slow?

Cheers
m&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:50:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-distance-crushingly-slow-compared/m-p/781899#M1238</guid>
      <dc:creator>MartinSchaefer2</dc:creator>
      <dc:date>2021-12-12T08:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Geometry Distance crushingly slow compared to geopy Distance</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-distance-crushingly-slow-compared/m-p/1100022#M6668</link>
      <description>&lt;P&gt;I have the same issue -- any updates would be much appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 18:04:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-distance-crushingly-slow-compared/m-p/1100022#M6668</guid>
      <dc:creator>ChadPeltier</dc:creator>
      <dc:date>2021-09-20T18:04:09Z</dc:date>
    </item>
  </channel>
</rss>

