Changes between Initial Version and Version 1 of Ticket #17972


Ignore:
Timestamp:
2019-08-04T20:30:45+02:00 (6 years ago)
Author:
Don-vip
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17972

    • Property Keywords hgt srtm added; HgtReader removed
  • Ticket #17972 – Description

    initial v1  
    11Sorry if I'm mistaken and this is not really a bug, but it sure looks incorrect to me...
    22
    3 In Hgtreader.java, in the elevationprofile plugin,  file: josm-plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/HgtReader.java,
     3In **Hgtreader.java**, in the elevationprofile plugin,  file: ''josm-plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/HgtReader.java'',
    44there appears to be an error.
    55
    6 Here're the suspected lines:
     6Here are the suspected lines:
    77
     8{{{
     9#!java
    810        // see http://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file
    911        double fLat = frac(coor.lat()) * SECONDS_PER_MINUTE;
     
    1315        int row = (int) Math.round(fLat * SECONDS_PER_MINUTE / HGT_RES);
    1416        int col = (int) Math.round(fLon * SECONDS_PER_MINUTE / HGT_RES);
    15 
     17}}}
    1618Why 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).
    1719