Skip to main content

Python parser for the Shuttle Radar Topography Mission elevation data

Project description

# SRTM.py

SRTM.py is a python parser for the Shuttle Radar Topography Mission elevation data.

See: [http://www2.jpl.nasa.gov/srtm/](http://www2.jpl.nasa.gov/srtm/).

## Usage:

import srtm
elevation_data = srtm.get_data()
print 'CGN Airport elevation (meters):', elevation_data.get_elevation(50.8682, 7.1377)

With get\_elevation() an elevation of the the nearest location found in the SRTM data will be given.
If you need an approximation based on nearby locations, you can use:

elevation_data.get_elevation(50.8682, 7.1377, approximate=True)

You can create elevation images with:

import srtm
geo_elevation_data = srtm.get_data()
image = geo_elevation_data.get_image((500, 500), (45, 46), (13, 14), 300)
# the image s a standard PIL object, you can save or show it:
image.show()

On every elevation requested the library will:

* Check if the SRTM file is stored locally
* If not -- download it from NASA servers
* Parse elevations from it

That's why the first run of your application will always take a few seconds.

### Example images

Istra and Trieste:

![Istra](http://tkrajina.github.io/srtm.py/istra.png)

Rio de Janeiro:

![Rio](http://tkrajina.github.io/srtm.py/rio.png)

Miami and florida:

![Miami](http://tkrajina.github.io/srtm.py/miami.png)

Sidney:

![Sidney](http://tkrajina.github.io/srtm.py/sidney.png)

## gpxelevations

gpxelevations is a utility commandline tool to add/update elevations in a GPS track file:

$ gpxelevations -h
usage: gpxelevations [-h] [-o] [-p] [-s] [-c] [-f FILE] [-v]
[gpx_files [gpx_files ...]]

Adds elevation to GPX files

positional arguments:
gpx_files GPX files

optional arguments:
-h, --help show this help message and exit
-o, --overwrite Overwrite existing elevations (otherwise will add
elevations only where not yet present)
-p, --approximate Approximate elevations with neighbour point elevations
-s, --smooth Smooth elevations
-c, --calculate Calculate elevations (but don't change the GPX file
-f FILE, --file FILE Output filename
-v, --verbose Verbose output

## License

GPX.py is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)

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

SRTM.py-0.1.2.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file SRTM.py-0.1.2.tar.gz.

File metadata

  • Download URL: SRTM.py-0.1.2.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for SRTM.py-0.1.2.tar.gz
Algorithm Hash digest
SHA256 09ae322313dc0a698b7802e79f725a2822a7ebfeb63991725333958b303d7563
MD5 4f835025542de3b1dc556862b7b0fcfd
BLAKE2b-256 6ff2b34915a0952827f48db14fee4bee3b6d30a494da03bd6ae62e244d93d394

See more details on using hashes here.

Supported by

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