Skip to main content

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

cyvincenty-1.0.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (48.5 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

File details

Details for the file cyvincenty-1.0.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cyvincenty-1.0.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ea2a7066e0fddca230e0fb70984fe26be28e64fd33513e74e6d49dd27b152689
MD5 91b757fc5e1aca14a1800ffe2e1959a5
BLAKE2b-256 8cf610ce9d5d4197119ef69039c5e886ad15a5cdbcae6fbfc1bec393288fc2ff

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page