Arcgis Geometry Distance crushingly slow compared to geopy Distance

488
1
04-09-2020 03:48 AM
MartinSchaefer2
New Contributor

Hi,

 Possibly something for Ideas, but perhaps others have input before I suggest something. I'm calculating distances in a notebook on a Spatially Enabled Dataframe. The SDF has just over 5,300 records, SR is 4326. 

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: 

arcgis.geometry.distance(sr, sdf_row['SHAPE'], prev_row['SHAPE'], 9001, True)['distance']

Wall time: 1h 2min

from geopy.distance import geodesic
...
geodesic((sdf_row['SHAPE'].y, sdf_row['SHAPE'].x), (prev_row['SHAPE'].y, prev_row['SHAPE'].x)).meters

Wall time: 2.46 s

That is a staggering difference. There's no difference in the results given a reasonable precision.

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
1 Reply
ChadPeltier
New Contributor II

I have the same issue -- any updates would be much appreciated. 

0 Kudos