Changes between Initial Version and Version 1 of Ticket #17972
- Timestamp:
- 2019-08-04T20:30:45+02:00 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #17972
- Property Keywords hgt srtm added; HgtReader removed
-
Ticket #17972 – Description
initial v1 1 1 Sorry if I'm mistaken and this is not really a bug, but it sure looks incorrect to me... 2 2 3 In Hgtreader.java, in the elevationprofile plugin, file: josm-plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/HgtReader.java, 3 In **Hgtreader.java**, in the elevationprofile plugin, file: ''josm-plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/HgtReader.java'', 4 4 there appears to be an error. 5 5 6 Here 're the suspected lines:6 Here are the suspected lines: 7 7 8 {{{ 9 #!java 8 10 // see http://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file 9 11 double fLat = frac(coor.lat()) * SECONDS_PER_MINUTE; … … 13 15 int row = (int) Math.round(fLat * SECONDS_PER_MINUTE / HGT_RES); 14 16 int col = (int) Math.round(fLon * SECONDS_PER_MINUTE / HGT_RES); 15 17 }}} 16 18 Why are you using "SECONDS_PER_MINUTE"? lat/lons are in decimal degrees, right? So, you want to take the fractional part of the lat (or lon) and convert that to seconds. The link you referenced in the comment is converting to arc seconds. I believe you are using the wrong unit conversion. Instead of using "SECONDS_PER_MINUTE" you want to use "SECONDS_PER_DEGREE" (which is 3600). 17 19