Opened 3 years ago
Last modified 20 months ago
#22596 new enhancement
[Patch] Elevation at current map location / Automatic download of SRTM HGT files — at Version 1
Reported by: | hhtznr | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin elevationprofile | Version: | |
Keywords: | elevation, SRTM HGT, current map location, automatic download | Cc: | OliverW |
Description (last modified by )
What?
I wrote this patch, which will display the elevation at the current location on the map next to the coordinates in the MapStatus line. Optionally, the necessary SRTM HGT files providing the elevation can automatically be downloaded, if they are missing on disk.
Why?
This is typical functionality in most map applications, but it is missing in JOSM. Elevation at the current map location (mouse pointer) can be useful in determining the proper direction of waterways, the location of summits etc.
How does it work?
It builds on HgtReader from ElevationProfile plugin written by Oliver Wieland. HgtReader checks whether the HGT file covering the current map location is available on disk. If so, it reads it into memory and determines the elevation at the current location.
I extended HgtReaderwith HgtDownloader, which will download any missing HGT file in a background thread from NASA's Land Processes Distributed Active Archive Center (LP DAAC) at https://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL3.003/2000.02.11/.
I created a preferences tab, where the elevation feature can be enabled and where optional auto-downloading can turned on.
Why not as plugin?
I did not see a way, how to feed the current map location (mouse pointer) into a plugin.
What's the content of the patch?
New files:
- src/org/openstreetmap/josm/data/elevation/ElevationHelper.java (from Oliver Wieland)
- src/org/openstreetmap/josm/data/elevation/HgtDownloader.java
- src/org/openstreetmap/josm/data/elevation/HgtDownloadListener.java
- src/org/openstreetmap/josm/data/elevation/HgtPreferences.java
- src/org/openstreetmap/josm/data/elevation/HgtReader.java (builds on Oliver Wieland)
- src/org/openstreetmap/josm/data/elevation/gpx/GeoidCorrectionKind.java (from Oliver Wieland)
- src/org/openstreetmap/josm/gui/preferences/elevation/HgtPreference.java
- src/org/openstreetmap/josm/gui/preferences/elevation/HgtPreferencesPanel.java
- resources/images/preferences/elevation.avg
- resources/images/statusline/ele.svg
Updated files:
- src/org/openstreetmap/josm/gui/MapStatus.java
- src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
What next?
I would appreciate it, if the demonstrated functionality could be integrated into mainline JOSM.
Change History (5)
by , 3 years ago
Attachment: | JOSM_18616_Elevation_git_diff.txt added |
---|
by , 3 years ago
Attachment: | JOSM_18616_Elevation_new_updated_src_files.tar.gz added |
---|
Archive with new and updated source files
by , 3 years ago
Attachment: | JOSM_with_elevation_in_MapSatus.png added |
---|
Screenshot of elevation information in MapStatus line
by , 3 years ago
Attachment: | JOSM_Elevation_Data_Preferences.png added |
---|
Screenshot of elevation data preferences tab
comment:1 by , 3 years ago
Description: | modified (diff) |
---|
Git diff of elevation patch