Skip to content
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

Merged
merged 3 commits into from
Sep 18, 2024

Conversation

gahjelle
Copy link
Contributor

See #17

Adds distance() measurement. The distance is calculated in meters per default, based on a new EARTH_RADIUS_METERS constant. The radius can also be customized in the call to distance().

Copy link
Owner

@benbovy benbovy left a 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!

Geography object
b : :py:class:`Geography` or array_like
Geography object
radius : float
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
radius : float
radius : float, optional

@gahjelle
Copy link
Contributor Author

gahjelle commented Sep 6, 2024

Thanks @benbovy I've updated the docstring.


import spherely

import pytest
earth_radius_meters = 6_371_010
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@benbovy benbovy merged commit e41dbfd into benbovy:main Sep 18, 2024
15 checks passed
@benbovy
Copy link
Owner

benbovy commented Sep 18, 2024

Many thanks @gahjelle !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants