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 install : installs the package locally

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


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/])


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


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:


  • 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.

Files for tupu, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size tupu-0.1.0-py2.py3-none-any.whl (9.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size tupu-0.1.0-py3-none-any.whl (9.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size tupu-0.1.0.tar.gz (8.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page