Cython implementation of Vincenty distance.
Project description
Cyvincenty
A fast Cython implementation of the Vincenty algorithm for calculating the distance in kilometers between 2 co-ordinates.
This module is heavily inspired by uvincenty and vincenty. It is just as fast if not slightly faster than uvincenty which is a pure C Python extension despite being written in Python! (technically Cython).
Installation
pip install cyvincenty
Usage
>> from cyvincenty import vincenty
>> boston = (42.3541165, -71.0693514)
>> newyork = (40.7791472, -73.9680804)
>> vincenty(*boston, *newyork)
Benchmarks
Using ipython
>> import cyvincenty
>> import uvincenty
>> import vincenty
>> import geopy.distance
>> boston = (42.3541165, -71.0693514)
>> newyork = (40.7791472, -73.9680804)
>> %timeit uvincenty.vincenty(*boston, *newyork)
744 ns ± 2.58 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)
>> %timeit cyvincenty.vincenty(*boston, *newyork)
736 ns ± 2.82 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)
>> %timeit vincenty.vincenty(boston, newyork)
10.2 µs ± 60.1 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)
>> %timeit geopy.distance.geodesic(boston, newyork)
191 µs ± 1.52 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file cyvincenty-1.0.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: cyvincenty-1.0.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 48.5 kB
- Tags: CPython 3.10, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea2a7066e0fddca230e0fb70984fe26be28e64fd33513e74e6d49dd27b152689 |
|
MD5 | 91b757fc5e1aca14a1800ffe2e1959a5 |
|
BLAKE2b-256 | 8cf610ce9d5d4197119ef69039c5e886ad15a5cdbcae6fbfc1bec393288fc2ff |