Skip to main content

Fast geodesic distances between sets

Project description

tupu - Fast geodesic distances in Python

This is a personal project centered around geodesic distances. Its goal is to be able to quickly compute, for every coordinate in a list:

  • Distances to a given point (e.g. distances from each point to NYC)
  • Nearest neighbors: distances to the closest point in another list (e.g. distances from each point to a city), and the identity of such point
  • Number of neighbors: number of points of another list within a certain distance or buffer.

Dev Install

After cloning the repo and opening the panflute folder:

python setup.py install : installs the package locally

python setup.py develop : installs locally with a symlink so changes are automatically updated

Usage

From Python:

import tupu
# TODO...

From the command line:

tupu some_cities.csv?id=uid --output=augmented.tsv --distance=dist_ny,40.7143,-74.0060

(See also [examples/README.md])

Dependencies:

Why "tupu"?

Tupu was one of the Inca measures of distance, equivalent to about 130 cm. I would have preferred to use "topo", but it's already a quite popular name on Github, and has other meanings.

Gordon McEwan, "The Incas: New Perspectives", p.179 Gordon McEwan, "The Incas: New Perspectives", p.179

Text

Jerry D. Moore, "Incidence of Travel: Recent Journeys in Ancient South America", p.208

Why not geopandas, etc.?

Earlier tests deemed them too slow/complicated, but there might be workarounds. EG:

https://stackoverflow.com/questions/54804073/how-can-i-accelerate-a-geopandas-spatial-join/54804074#54804074

Limitations

  • Not parallelized, although that should be trivial
  • Not Cython, although most of the heavy load is already in C.
  • Only deals with points, not with lines/polygons
  • Currently only stores distance to closest city (although allowing more is trivial)
  • Currently does not compute number of points within a given distance (although allowing more is trivial)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tupu-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tupu-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

tupu-0.1.0-py2.py3-none-any.whl (9.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file tupu-0.1.0.tar.gz.

File metadata

  • Download URL: tupu-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0

File hashes

Hashes for tupu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eaf634cd3697e2b053311b522589fa1982b4795f7e7570c0c2d3834732308134
MD5 bb5197a3ca4f7f0834b38ed383927a79
BLAKE2b-256 76f836c0cc7994f93a75c53ada950176b69563049eb46225db88cc5a0552048f

See more details on using hashes here.

File details

Details for the file tupu-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tupu-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0

File hashes

Hashes for tupu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 074e469604d7ce4684493c5557a87d52d69b881420a52c11ceb57b96f1d12cca
MD5 3148fd303e0038c3681bedd6493b54ca
BLAKE2b-256 0dff5025601c8ea0301d43c0347417c9863a23446381840c59f561f216e8aa8a

See more details on using hashes here.

File details

Details for the file tupu-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: tupu-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0

File hashes

Hashes for tupu-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 54334e46fd57b791c1ced6d19d705c3e9b4e1295afbc48dd2de23a1550939bed
MD5 ef581073b2854d17d4d43196684d11f0
BLAKE2b-256 915494632329ae6bb3f064cf43aacea0a372f17be256f61a7bab883529821691

See more details on using hashes here.

Supported by

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