Changeset 29876 in osm for applications


Ignore:
Timestamp:
2013-08-25T20:26:56+02:00 (11 years ago)
Author:
oliverw
Message:
  • Read elevation data from external HGT file
  • Code cleanup
  • Changed icons slightly
Location:
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfilePlugin.java

    r29874 r29876  
    4848            e1.printStackTrace();
    4949        }
     50       
     51        getPluginDir();
    5052    }
    5153
  • applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/WayPointHelper.java

    r29874 r29876  
    2121import java.util.Locale;
    2222
     23import org.openstreetmap.josm.Main;
    2324import org.openstreetmap.josm.data.gpx.WayPoint;
    2425
     
    4142        };
    4243       
     44       
     45       
    4346        /**
    4447         * The name of the elevation height of a way point.
     
    4952               
    5053        private static GeoidCorrectionKind geoidKind = GeoidCorrectionKind.None;
    51 
     54       
     55        /** The HGT reader instance. */
     56        private static HgtReader hgt = new HgtReader();
     57       
    5258        /**
    5359         * Gets the current mode of GEOID correction.
     
    217223        private static double getInternalElevation(WayPoint wpt) {
    218224                if (wpt != null) {
     225                        // Try to read data from SRTM file
     226                        // TODO: Option to switch this off
     227                        double eleHgt = hgt.getElevationFromHgt(wpt.getCoor());
     228                       
     229                        if (!Double.isNaN(eleHgt)) {                       
     230                            return eleHgt;
     231                        }
     232                   
    219233                        if (!wpt.attr.containsKey(HEIGHT_ATTRIBUTE)) {
    220234                                return 0;
  • applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileLayer.java

    r29874 r29876  
    222222        // plain way point by default
    223223        ElevationWayPointKind kind = ElevationWayPointKind.Plain;
    224         System.out.println("Slope: " + slope + "%");
    225224       
    226225        // check, if we passed an elevation level
Note: See TracChangeset for help on using the changeset viewer.