Python library to get elevation data
Project description
pyhigh
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.