﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
22596	[Patch] Elevation at current map location / Automatic download of SRTM HGT files	hhtznr	team	"**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 ''HgtReader'' with ''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.svg
* 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.

**Screenshots**
[[Image(JOSM_with_elevation_in_MapSatus.png,500)]] [[Image(JOSM_Elevation_Data_Preferences.png,400)]]"	enhancement	new	normal		Plugin elevationprofile			elevation, SRTM HGT, current map location, automatic download	OliverW
