pypi_packages: datasette-haversine
This data as json
name | summary | classifiers | description | author | author_email | description_content_type | home_page | keywords | license | maintainer | maintainer_email | package_url | platform | project_url | project_urls | release_url | requires_dist | requires_python | version | yanked | yanked_reason |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
datasette-haversine | Datasette plugin that adds a custom SQL function for haversine distances | [] | # datasette-haversine [](https://pypi.org/project/datasette-haversine/) [](https://github.com/simonw/datasette-haversine/releases) [](https://github.com/simonw/datasette-haversine/actions?query=workflow%3ATest) [](https://github.com/simonw/datasette-haversine/blob/main/LICENSE) 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](https://github.com/mapado/haversine) library. ## haversine() to calculate distances ```sql 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: - `ft` for feet - `m` for meters - `in` for inches - `mi` for miles - `nmi` for nautical miles - `km` for kilometers (the default) ```sql select haversine(lat1, lon1, lat2, lon2, 'mi'); ``` | Simon Willison | text/markdown | https://github.com/simonw/datasette-haversine | Apache License, Version 2.0 | https://pypi.org/project/datasette-haversine/ | https://pypi.org/project/datasette-haversine/ | {"Homepage": "https://github.com/simonw/datasette-haversine"} | https://pypi.org/project/datasette-haversine/0.2/ | ["datasette", "haversine", "pytest ; extra == 'test'"] | 0.2 | 0 |