Skip to main content

upoints - Modules for working with points on Earth

Introduction

upoints is a collection of GPL v3 licensed modules for working with points on Earth, or other near spherical objects. It allows you to calculate the distance and bearings between points, mangle xearth/xplanet data files, work with online UK trigpoint databases, NOAA’s weather station database and other such location databases.

Previous versions of upoints were called earth_distance, but the name was changed as it no longer reflected the majority of uses the packages was targeted at.

Requirements

upoints’s only strict requirements beyond the Python standard library are aaargh and lxml, and as such should run with Python 2.6 or newer [1]. If upoints doesn’t work with the version of Python you have installed, drop me a mail and I’ll endeavour to fix it.

The modules have been tested on many UNIX-like systems, including Linux and OS X, but it should work fine on other systems too. The modules and scripts contain a large collection of tests that can be checked with nose2.

Example

The simplest way to show how upoints works is by example, and here goes:

>>> from upoints import point
>>> Home = point.Point(52.015, -0.221)
>>> Telford = point.Point(52.6333, -2.5000)
>>> print("%d kM, with an initial bearing of %d°"
...       % (Home.distance(Telford), Home.bearing(Telford)))
169 kM, with an initial bearing of 294°

All the class definitions, methods and independent functions contain hopefully useful usage examples in the docstrings. The API documentation is built with Sphinx, and is available in doc/html/api/.

There is some accompanying text and examples for point.py, formerly edist.py, available in geolocation and path cross. More examples are available for xearth.py in xearth and path cross. Some background and more examples for trigpoints.py is online in Trigpointing and point.py. Usage examples for cities.py is available in Cities and cities.py. And finally, Pythons on a plane contains information on weather_stations.py.

Thanks

The following people have submitted patches, testing and feedback:

  • Cédric Dufour - edist.py’s CSV import, and flight plan output

  • Thomas Traber - GPX support enhancements, Points filtering, and some cool usage scenarios

  • Kelly Turner - Xearth import idea, and copious testing

  • Simon Woods - Testing

API Stability

API stability isn’t guaranteed across versions, although frivolous changes won’t be made.

When upoints 1.0 is released the API will be frozen, and any changes which aren’t backwards compatible will force a major version bump.

Limitations

The modules assume the caller will take care of significant digits, and output formatting [2]. All results are returned with whatever precision your Python install or system generates; unintuitive float representation, rounding errors, warts and all.

The reasoning is simple, the caller should always know what is required and any heuristics added to the code would be just that – guesses, which can and will be wrong.

The upoints modules do not take flattening in to account, as in calculations based in most populated areas of the earth the errors introduced by ignoring the earth’s flattening are quite small. Future versions may change if the limitation becomes an issue in real use.

Although not really a limitation one should also be careful to use data sources that are based around the same datum, and even within two data sources that use the same datum you should make sure they use the same representations. It isn’t unusual to find data sources from the USA that specify longitudes west of Greenwich as positive for example.

Bugs

If you find a bug don’t hesitate to drop me a mail preferably including a minimal testcase, or even better a patch!

Metadata

Release files for upoints 0.12.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distributions (sdists)

Source distribution for upoints 0.12.2
File Size Uploaded Provenance Actions
upoints-0.12.2.tar.gz 499.5 kB Without provenance Details for upoints-0.12.2.tar.gz
upoints-0.12.2.tar.bz2 488.2 kB Without provenance Details for upoints-0.12.2.tar.bz2

Built distribution (wheel)

Table of built distributions (wheels) for upoints 0.12.2
File Interpreter ABI Platform Actions
upoints-0.12.2-py2.py3-none-any.whl Python 2, Python 3 none any Details for upoints-0.12.2-py2.py3-none-any.whl

Total release size: 1.1 MB

Release files / upoints-0.12.2.tar.gz

Download URL upoints-0.12.2.tar.gz
Size 499.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0c63f6bec854e5118541aaa81b671d38f6051d8241a9c59aa13157d68674b33c
BLAKE2b-256 checksum
How to use checksums
25623d2930a1148bf8c08ebcedfc36d5c1f9fed2897cb6177af9ef2cb058bd4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / upoints-0.12.2.tar.bz2

Download URL upoints-0.12.2.tar.bz2
Size 488.2 kB
Tags Source
SHA-256 checksum
How to use checksums
13be0d9817ec06cae29fdf8e18bb45f97eea588bef8fde769a0a1c5c3851a55c
BLAKE2b-256 checksum
How to use checksums
2cd30fb4119b01a8329000e0f75b0890e68b9e64c44b253583f62f919e6d203e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / upoints-0.12.2-py2.py3-none-any.whl

Download URL upoints-0.12.2-py2.py3-none-any.whl
Size 72.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
932e826d310cb04e6177ee101b2eab040470334772753c62561b8e4a51bdd889
BLAKE2b-256 checksum
How to use checksums
5cb9f6a74ec75ef6c4f1f82f8b80268ab815278915ea4bcf56894bae2c925049
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for upoints 0.12.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page