Skip to content

Elevation API - #1777

Merged
devemux86 merged 5 commits into
mapsforge:masterfrom
Sublimis:elevation-offline-api
Feb 20, 2026
Merged

devemux86 merged 5 commits into
mapsforge:masterfrom
Sublimis:elevation-offline-api

Conversation

@Sublimis

@Sublimis Sublimis commented Feb 17, 2026 •

Copy link
Copy Markdown
Contributor

Get elevations of geographic points using offline digital elevation model data (DEM/SRTM).

Multi-threaded and fast, as most of the code is shared with hill shading.

Note: Offline terrain elevation follows the curvature of the ground and generally will not work well when used on structures that rise above the terrain, such as bridges, viaducts, or overpasses.

Example usage:

public class ElevationManager
{
  protected final ElevationAPI mElevationAPI;
  
  public ElevationManager(DemFolder demFolder)
  {
    mElevationAPI = new ElevationAPI(demFolder);
  }
  
  public double getElevation(double lat, double lon)
  {
    return mElevationAPI.getElevation(lat, lon);
  }
}

@devemux86

Copy link
Copy Markdown
Collaborator

@Sublimis Thanks, we also need methods with List<double[]> where double[] is lat,lon:

public int getElevation(final List<double[]> latLon, final double[] output)

public int getElevation(final List<double[]> latLon, final double[] output, Mode mode)

@Sublimis

Copy link
Copy Markdown
Contributor Author

There

@devemux86 devemux86 added this to the 0.28.0 milestone Feb 20, 2026
@devemux86
devemux86 merged commit 9717a1a into mapsforge:master Feb 20, 2026
1 check passed
@devemux86

Copy link
Copy Markdown
Collaborator

@Sublimis Thanks, nice work! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants