JOSM/Plugins/Elevation

From OpenStreetMap Wiki
< JOSM‎ | Plugins
Jump to navigation Jump to search

The JOSM plugin Elevation displays terrain elevation at the mouse location on the map and provides an optional elevation visualization layer to display contour lines, hillshade and an elevation raster.

JOSM with Elevation plugin: Overview of features

It is designed to use publicly available elevation data from NASA's Shuttle Radar Topography Mission (SRTM). It can be configured to automatically download SRTM elevation data as needed. For this, a free NASA Earthdata user account has to be registered.

Configuration

Preferences dialog

  1. From the JOSM menu bar, select Edit -> Preferences.
  2. In the opened preferences dialog, select the tab Elevation Data.
  3. Adapt the configuration to your needs.
  4. Click the OK button at the bottom.
Elevation Data preferences

Configuration options

Option Default Description
Enable Use of Elevation Data true Can be used to disable the plugin without the need to uninstall it.
Preferred SRTM Type SRTM1 The preferred type of SRTM data, either SRTM1 or SRTM3.
Elevation Value Interpolation bilinear The type of value interpolation from the SRTM elevation raster data, either bilinear interpolation or none. With bilinear, the elevation value at a map coordinate will be interpolated from the four closest elevation raster values. With none, the elevation value with the raster coordinate which is closest to the map coordinate will be picked.
Max. Size of In-Memory Tile Cache 128 The maximum size (MiB) of the cache storing used SRTM tiles in RAM. By practical considerations, the cache size should be set such that at least four SRTM tiles can be stored in RAM.
Enable Elevation Visualization Layer true Enables a specialized map layer which can display elevation contour lines, hillshade and an elevation raster computed from SRTM data.
Layer Rendering Map Size Limit 0.1 Limit value of latitude or longitude (arc degrees) covered by the map view, where, if exceeded, elevation data caching as well as contour line and hillshade rendering will be temporarily switched off to avoid excessive CPU and memory usage.
Contour Line Isostep 10 Step between adjacent elevation contour lines (meters).
Contour Line Stroke Width 1 Width of the stroke used to draw elevation contour lines (px).
Contour Line Color #D2B473 Color of elevation contour lines.
Hillshade Illumination Source Altitude 45 The angle of the hillshade illumination source above the horizon in the range from 0 (horizon) to 90° (overhead).
Hillshade Illumination Source Azimuth 315 (NW) Anglular direction of the hillshade illumination source (N: 0, E: 90°, S: 180°, W: 270°).
Enable Automatic Downloading of Elevation Data false If disabled, elevation in a map area can only be displayed if appropriate SRTM files have been manually downloaded prior to launching JOSM.
Use Password Authentication false Use Earthdata credentials for authorization of SRTM file downloads.
Use Authorization Bearer Token true Use an Earthdata authorization bearer token for authorization of SRTM file downloads.
Earthdata User Name "" Valid Earthdata user name required to authorize automatic downloads if password authentication is selected.
Earthdata Password "" Valid Earthdata password required to authorize automatic downloads if password authentication is selected.
Earthdata Authorization Bearer Token "" Valid Earthdata authorization bearer token required to authorize automatic downloads if this authentication option is selected.

Elevation visualization layer

The Elevation plugin adds a specialized map layer which can display:

In the layer manager, right click on the elevation visualization layer opens a context menu which allows enabling and disabling the options as desired.

Elevation layer: Elevation visualization options in the layer manager

The layer can be re-added via Imagery -> Add elevation layer.

SRTM elevation data

General

SRTM elevation data is subdivided into tiles, each covering 1° in longitude and 1° in latitude. The tiles are identified by the latitude and longitude of their south west (lower left) corner.

There are two relevant types of tiles: SRTM1 and SRTM3.

  • SRTM1 tiles contain elevation data sampled at 1 arc-second and have an uncompressed size of about 25 MiB.
  • SRTM3 tiles contain elevation data sampled at 3 arc-seconds and have an uncompressed size of about 3 MiB.

For more detailed information see NASA's SRTM user guide.

Downloading SRTM elevation data

General

SRTM elevation data files provided by NASA are compressed and have the extension .hgt.zip.

  • SRTM1 files can be downloaded from [1].
  • SRTM3 files can be downloaded from [2].

Authorization of downloads

For downloading of files being authorized, NASA requires you to to register an Earthdata user account (free of charge) at Earthdata Login User Registration.

Manual download

Upon manual download of SRTM files, you will be prompted your Earthdata user name and password.

Manually downloaded SRTM files need to be placed in the subdirectory elevation/SRTM of the JOSM cache directory. Under Linux, the JOSM cache directory should be located at $HOME/.cache/JOSM. It may be necessary to create both subdirectories elevation/SRTM.

Downloaded SRTM files may not be uncompressed or renamed. Otherwise they will not be recognized by the plugin.

Automatic download

NASA Earthdata Login: Generate Token
NASA Earthdata Login: Applications

To enable automatic download by the Elevation plugin, you can use your Earthdata credentials (user name and password). Alternatively you can use an Earthdata authorization bearer token.

In each case, this information needs to be entered in the Elevation plugin preferences.

If you decide for the authorization bearer token, do the following to generate a token:

  1. Log into your Earthdata user account.
  2. Click on the menu option Generate Token.
  3. Click on the button GENERATE TOKEN.

As soon as the token was generated, click on SHOW TOKEN or the copy to clipboard option to copy the token. Copy the token into the appropriate text field of the Elevation plugin preferences and save it by clicking OK.

The token has an expiration date. Therefore, it will need to be recreated and reentered from time to time. A dialog will be shown if downloading of SRTM data fails due to an authorization error.

Note: It may be necessary to add LP DAAC Data Pool to the list of Approved Applications.

Source code

The source code can be obtained from JOSM Elevation Plugin on GitHub.