Skip to main content

Python library to get elevation data

Project description

pyhigh

Actions Status Code Coverage 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

Linux

> sudo apt-get install gdal-bin
> pip install pyhigh

macOS

> brew install gdal
> 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

Similar to the command-line tool, the pyhigh cache can be cleared with the API function clear_cache:

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

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

pyhigh-0.0.3.tar.gz (3.5 kB view hashes)

Uploaded Source

Supported by

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