Package: elevation
Global geographic elevation data made easy.
Elevation provides easy download, cache and access of the global datasetsSRTM 30m Global 1 arc second V003elaborated by NASA and NGA hosted onAmazon S3andSRTM 90m Digital Elevation Database v4.1elaborated by CGIAR-CSI.Note that any download policies of the respective providers apply.InstallationInstall thelatest version of Elevationfrom the Python Package Index:$ pip install elevationThe following dependencies need to be installed and working:GNU makecurlunzipgunzipGDAL command line toolsThe following command runs some basic checks and reports common issues:$ eio selfcheck
Your system is ready.GNU make, curl and unzip come pre-installed with most operating systems.
The best way to install GDAL command line tools varies across operating systems
and distributions, please refer to theGDAL install documentation.Note that starting fromelevationv1.1 only Python 3 is officially supported.
To get the last version sporting Python 2 support please usepip install elevation=1.0.6.Command line usageIdentify the geographic bounds of the area of interest and fetch the DEM with theeiocommand.
For example to clip the SRTM 30m DEM of Rome, around 41.9N 12.5E, to theRome-30m-DEM.tiffile:$ eio clip -o Rome-30m-DEM.tif --bounds 12.35 41.8 12.65 42For the SRTM 90m DEM use:$ eio --product SRTM3 clip -o Rome-90m-DEM.tif --bounds 12.35 41.8 12.65 42The--boundsoption accepts latitude and longitude coordinates
(more precisely in geodetic coordinates in the WGS84 reference system EPSG:4326 for those who care)
given asleft bottom right topsimilarly to theriocommand formrasterio.If you have installed the packagesrasterioandfionayou can clip a DEM on the same extent of any other geospatial data source supported by GDAL and OGR,
for example if you have a georeference imageMyImage.tifyou can clip the corresponding DEM with:$ eio clip -o MyImage-DEM.tif --reference MyImage.tif  # enable with: $ pip install rasterioThe--referenceoption can take also verctor data as input:$ eio clip -o MyShapefile-DEM.tif --reference MyShapefile.shp  # enable with: $ pip install fionaThe first time an area is accessed Elevation downloads the data tiles from the USGS or CGIAR-CSI servers and
caches them in GeoTiff compressed formats,
subsequent accesses to the same and nearby areas are much faster.Theclipsub-command doesn’t allow automatic download of a large amount of DEM tiles,
please refer to the upstream providers’ websites to learn the preferred procedures for bulk download.To clean up stale temporary files and fix the cache in the event of a server error use:$ eio cleanCommand line referenceTheeiocommand as the following sub-commands and options:$ Usage: eio [OPTIONS] COMMAND [ARGS]...

Options:
  --version                Show the version and exit.
  --product [SRTM1|SRTM3]  DEM product choice.  [default: SRTM1]
  --cache_dir DIRECTORY    Root of the DEM cache folder.  [default:
                           /Users/amici/Library/Caches/elevation]
  --help                   Show this message and exit.

Commands:
  clean      Clean up the product cache from temporary files.
  clip       Clip the DEM to given bounds.
  distclean  Remove the product cache entirely.
  info       Show info about the product cache.
  seed       Seed the DEM to given bounds.
  selfcheck  Audit the system for common issues.Theclipsub-command:$ eio clip --help
Usage: eio clip [OPTIONS]

Options:
  -o, --output PATH     Path to output file. Existing files will be
                        overwritten.  [default: out.tif]
  --bounds FLOAT...     Output bounds in 'left bottom right top' order.
  -m, --margin TEXT     Decimal degree margin added to the bounds. Use '%' for
                        percent margin.  [default: 0]
  -r, --reference TEXT  Use the extent of a reference GDAL/OGR data source as
                        output bounds.
  --help                Show this message and exit.Defaults can be defined by setting environment variables prefixed withEIO,
e.g.EIO_PRODUCT=SRTM3andEIO_CLIP_MARGIN=10%.Python APIEvery command has a corresponding API function in theelevationmodule:>>> import elevation
>>> # clip the SRTM1 30m DEM of Rome and save it to Rome-DEM.tif
>>> elevation.clip(bounds=(12.35, 41.8, 12.65, 42), output='Rome-DEM.tif')
>>> # clean up stale temporary files and fix the cache in the event of a server error
>>> elevation.clean()Project resourcesDocumentationhttp://elevation.bopen.euSupporthttps://stackoverflow.com/search?q=python+elevationDevelopmenthttps://github.com/bopen/elevationDownloadhttps://pypi.org/project/elevationCode qualityContributingContributions are very welcome. Please see theCONTRIBUTINGdocument for
the best way to help.
If you encounter any problems, please file an issue along with a detailed description.Authors:B-Open Solutions srl -@bopen-http://bopen.euAlessandro Amici -@alexamiciLicenseElevation is free and open source software
distributed under the terms of theApache License, Version 2.0.