-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add binding to calculate distance between two geometries #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gahjelle ! Just one nit-picking suggestion for the docstrings otherwise it all looks good!
src/accessors-geog.cpp
Outdated
Geography object | ||
b : :py:class:`Geography` or array_like | ||
Geography object | ||
radius : float |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
radius : float | |
radius : float, optional |
Thanks @benbovy I've updated the docstring. |
tests/test_accessors.py
Outdated
|
||
import spherely | ||
|
||
import pytest | ||
earth_radius_meters = 6_371_010 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not actually used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch @jorisvandenbossche
Thanks, I've removed it.
Many thanks @gahjelle ! |
See #17
Adds
distance()
measurement. The distance is calculated in meters per default, based on a newEARTH_RADIUS_METERS
constant. The radius can also be customized in the call todistance()
.