Skip to main content

pyhigh

Actions Status License: MIT PyPI version

pyhigh is a Python package for accessing elevation data, which is retrieved from a USGS dataset. The package uses caching to avoid unecessary downloads from the USGS dataset, but please respect their download policies.

Installation

> pip install pyhigh

Usage

Command-line utility

The pyhigh Python package includes a command-line tool of the same name to retreive the elevation at a particular latitude and longitude:

> pyhigh --lat 36.52011 --lon -118.671
1884

As necessary, files will be download from a USGS dataset and cache in the folder pyhigh/pyhigh/.cache. To clear this cache, use the --clean argument:

> pyhigh --clean

Python API

The get_elevation function returns the elevation, in meters, at the given latitude and longitude.

>>> from pyhigh import get_elevation
>>> get_elevation(lat=36.52011, lon=-118.671)
1884

It is also possible to request a bunch elevations for a bunch of latitudes and longitudes at once. The result returned is a NumPy array of elevations.

>>> from pyhigh import get_elevation_batch
>>> get_elevation_batch([(36.52011, -118.671),
...                      (36.62011, -118.771)])
array([1884., 2438.])

This is more efficient than individual calls to get_elevation because elevation reads are pooled together to avoid reading the same *.hgt file multiple times.

Finally, the pyhigh cache of *.hgt files can be cleared with the API function clear_cache:

>>> from pyhigh import clear_cache
>>> clear_cache()

Metadata

Release files for pyhigh 0.0.6

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

Source distribution (sdist)

Source distribution for pyhigh 0.0.6
File Size Uploaded
pyhigh-0.0.6.tar.gz 5.5 kB Details

Release files / pyhigh-0.0.6.tar.gz

Download URL pyhigh-0.0.6.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e10df65fc0ca79a57cb8f0cb10b4a6fefa19b2c4e5d28a1c46cb6b4e37f48be8
BLAKE2b-256 checksum
How to use checksums
db8bf8101acb032d7a9c1bd5023678831ff04edaf2d42ad78d0deca1b89ed805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.0.6 This release

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

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