All Projects → duboviy → dist

duboviy / dist

Licence: MIT license
🗺️ Python/C API extension module that computes distance between two coordinates on the world map

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to dist

erkir
Երկիր (Erkir) - a C++ library for geodesic and trigonometric calculations
Stars: ✭ 26 (+100%)
Mutual labels:  distance, coordinates
pharext
Distribute your PHP extension as self-installing phar executable
Stars: ✭ 57 (+338.46%)
Mutual labels:  extension
hypergravity
Gravity simulation in Hyper terminal
Stars: ✭ 22 (+69.23%)
Mutual labels:  extension
vscode-ascii-tree-generator
Generate ASCII tree of directories or format selected text into its corresponding "tree string" representation.
Stars: ✭ 35 (+169.23%)
Mutual labels:  extension
clever-vscode
Clever help to put vscode to the next level
Stars: ✭ 17 (+30.77%)
Mutual labels:  extension
BOSCH-GLM-rangefinder
Python script to remote control a BOSCH GLM 100C rangefinder via its Bluetooth serial interface
Stars: ✭ 41 (+215.38%)
Mutual labels:  distance-measures
wulaphp
一个有点复杂的PHP框架!
Stars: ✭ 26 (+100%)
Mutual labels:  extension
similarity measures
Quantify the difference between two arbitrary curves in space
Stars: ✭ 140 (+976.92%)
Mutual labels:  distance
prependers
Easily and cleanly extend third-party code.
Stars: ✭ 24 (+84.62%)
Mutual labels:  extension
burp-ntlm-challenge-decoder
Burp extension to decode NTLM SSP headers and extract domain/host information
Stars: ✭ 28 (+115.38%)
Mutual labels:  extension
PosDefManifold.jl
A Julia package for manipulating data in the Riemannian manifold of positive definite matrices
Stars: ✭ 23 (+76.92%)
Mutual labels:  distance
blender-importer-unity
A tool to fix orientation issues from Blender to Unity
Stars: ✭ 23 (+76.92%)
Mutual labels:  coordinates
9anime-Companion
🚀 A simple companion extension for 9anime
Stars: ✭ 83 (+538.46%)
Mutual labels:  extension
kanboard chrome extension
Kanboard Chrome Extension
Stars: ✭ 13 (+0%)
Mutual labels:  extension
github-wc-polyfill
Ensure that all GitHub and GitLab scripts required for UXP and SeaMonkey are loaded correctly
Stars: ✭ 87 (+569.23%)
Mutual labels:  extension
Flask-GraphQL-Auth
(UNMAINTAINED. FEEL FREE TO FORK) 🐍A Pythonic way to provide JWT authentication for Flask-GraphQL
Stars: ✭ 64 (+392.31%)
Mutual labels:  extension
sqlops-widgets
SQL Operations Studio Dashboard Widgets - including Always ON
Stars: ✭ 22 (+69.23%)
Mutual labels:  extension
1click-webpage-screenshot
Entire page Screenshot extension for Google Chrome. I'm developing open source extension for Google Chrome. All extension are free for use. Let's make Chrome great again!
Stars: ✭ 432 (+3223.08%)
Mutual labels:  extension
EPPlus.DataExtractor
EPPlus extension that make easier to extract POCO from excel tables
Stars: ✭ 65 (+400%)
Mutual labels:  extension
guillotine
Guillotine is a gnome extension designed for efficiently carrying out executions of commands from a customizable menu. Simply speaking: it is a highly customizable menu that enables you to launch commands and toggle services.
Stars: ✭ 28 (+115.38%)
Mutual labels:  extension

logo dist

by Eugene Duboviy

Build Status Codacy Badge Code Health PyPI Open Source Love PRs & Issues Welcome Awesome

Python/C API extension module that computes distance between two coordinates on the world map.

Why?

As more and more apps are using maps, the more demand for geolocation capabilities increase. Geolocation is about the reporting of your location to other users, as well as associating real-world locations (such as landmarks) to your location. This repo helps to accurately calculate the distance between two locations and presents a time efficient practical solution, that is almost 3 times faster than similar fast pure python implementation.

Installation

python setup.py install

Or using alternative command:

pip install https://github.com/duboviy/dist/archive/master.zip

Input and output data

The dist function accepts four float parameters:

  • lat1, lon1: The Latitude and Longitude of point 1 (in decimal degrees)
  • lat2, lon2: The Latitude and Longitude of point 2 (in decimal degrees)

The unit of measurement in which result is calculated is kilometers. [float]

Usage

>>> import dist
>>> dist.compute(10.1, 12.1, 10.1, 10.1)
218.933532715

Performance / speed comparison

This Python/C API Extension module is in ~ 3 times faster than similar fast pure python implementation. You can use performance test to compare speed with fast pure python implementation, just run nose test runner:

>>> nosetests
ext_time: 2.46785402298 pure_py_time: 7.49713611603

Python Versions

Checked under following Python versions:

  • 2.6
  • 2.7
  • 3.3
  • 3.4
  • 3.5
  • 3.6

What does it use inside? What kind of formula implementation is used?

Module accounts the curvature of the Earth when calculating large distances on the world map. If the Earth were flat, calculating the distance between two points would be very simple as for a straight line. The Haversine formula is used in current implementation, it includes a constant that represents the radius of the Earth. The Haversine formula is not 100% accurate because the Earth is not a perfect sphere. However, the Haversine gives a good enough approximation for most applications that use geolocation.

License

MIT licensed library. See LICENSE.txt for details.

Contributing

If you have suggestions for improving the dist, please open an issue or pull request on GitHub.

Badges

forthebadge forthebadge forthebadge forthebadge

forthebadge forthebadge forthebadge forthebadge

Open Source Love

forthebadge


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].