Datasette plugin that adds a custom SQL function for haversine distances
Project description
datasette-haversine
Datasette plugin that adds a custom SQL function for haversine distances
Install this plugin in the same environment as Datasette to enable the haversine() SQL function.
$ pip install datasette-haversine
The plugin is built on top of the haversine library.
haversine() to calculate distances
select haversine(lat1, lon1, lat2, lon2);
This will return the distance in kilometers between the point defined by (lat1, lon1) and the point defined by (lat2, lon2).
Custom units
By default haversine() returns results in km. You can pass an optional third argument to get results in a different unit:
ftfor feetmfor metersinfor inchesmifor milesnmifor nautical mileskmfor kilometers (the default)
select haversine(lat1, lon1, lat2, lon2, 'mi');
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datasette_haversine-0.1-py3-none-any.whl.
File metadata
- Download URL: datasette_haversine-0.1-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2496d53a3c99b15a75fdb5df3d6cd32c692c2e61b9fd58a26c4e4ca4c921ac44
|
|
| MD5 |
87420a5929cf6a368905c15b78e4fed0
|
|
| BLAKE2b-256 |
1a5c0dd7c88dc0e6cbaa1a1bfe6bfbc878e5b311d1402ec1bea43ad673d5b741
|