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)

>> cyvincenty(*boston, *newyork)

Benchmarks

from cyvincenty import vincenty
import uvincenty
from vincenty import vincenty
import geopy.distance

boston = (42.3541165, -71.0693514)
newyork = (40.7791472, -73.9680804)

%timeit uvincenty.vincenty(*boston, *newyork)

%timeit cyvincenty(*boston, *newyork)

%timeit vincenty(boston, newyork)

%timeit geopy.distance.geodesic(boston, newyork)

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.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (58.0 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

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