GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - GeospatialPython/srtm.py: Geo elevation data parser for "The Shuttle Radar Topography Mission" data

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

92 Commits
92 Commits

Folders and files

NameName
Last commit message
Last commit date
sample_files
sample_files
 
 
srtm
srtm
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
NOTICE.txt
NOTICE.txt
 
 
README.md
README.md
 
 
TODO.md
TODO.md
 
 
gpx_sample_images.py
gpx_sample_images.py
 
 
gpxelevations
gpxelevations
 
 
makefile
makefile
 
 
sample_images.py
sample_images.py
 
 
setup.py
setup.py
 
 
test.py
test.py
 
 

Repository files navigation

SRTM.py

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

See: http://www2.jpl.nasa.gov/srtm/.

You can see SRTM.py in action on Trackprofiler (online GPS track editor and organizer).

Usage:

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

GPS Tracks

You can add elevations for all points in a GPS track with:

import srtm
import gpxpy
gpx = gpxpy.parse(open('your-gpx-file.gpx'))
elevation_data = srtm.get_data()
elevation_data.add_elevations(gpx)

But this is raw SRTM data. If you need some approximations, you can try with:

import srtm.gpx
import gpxpy
gpx = gpxpy.parse(open('your-gpx-file.gpx'))
elevation_data = srtm.get_data()
elevation_data.add_elevations(gpx, smooth=True)

The result on a graph:

GPX elevations

In gray is the original elevation (taken with an android smartphone). Blue is raw-srtm-data elevations, in red is the smoothed (approximated) srtm data.

You need gpxpy installed in order for this feature to work.

Elevation images

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 and store locally (in ~/.elevations)
  • 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

Rio de Janeiro:

Rio

Miami and florida:

Miami

Sidney:

Sidney

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

SRTM.py is licensed under the Apache License, Version 2.0

About

Geo elevation data parser for "The Shuttle Radar Topography Mission" data

Resources

Readme
Apache-2.0 license
Activity

Stars

9 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.