Ignore:
Timestamp:
2010-11-02T23:16:43+01:00 (14 years ago)
Author:
oliverw
Message:

Bugfix ##5598: Plugin crashed when GPX data contain anonymous time stamps or no elevation data.

Location:
applications/editors/josm/plugins/ElevationProfile
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/ElevationProfile/images

    • Property svn:ignore
      •  

        old new  
        11Screenshot.png
         2
         3EelvationProfile-Icon.png
         4
         5Thumbs.db
  • applications/editors/josm/plugins/ElevationProfile/images/dialogs

    • Property svn:ignore set to
      Thumbs.db
  • applications/editors/josm/plugins/ElevationProfile/images/layer

    • Property svn:ignore set to
      Thumbs.db
  • applications/editors/josm/plugins/ElevationProfile/images/mapmode

    • Property svn:ignore set to
      Thumbs.db
  • applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfileBase.java

    r23976 r24033  
    126126                        return;
    127127
    128                 start = new Date();
     128                start = new Date();             
    129129                end = new Date(0L);
    130130                this.minHeight = Integer.MAX_VALUE;
     
    136136                for (WayPoint wayPoint : this.wayPoints) {
    137137                        visit(wayPoint);
     138                }
     139               
     140                if (this.minHeight == Integer.MAX_VALUE && this.maxHeight == Integer.MIN_VALUE) {
     141                        // file does not contain elevation data at all
     142                        minHeight = 0;
     143                        maxHeight = 0;
     144                        setMinWayPoint(wayPoints.get(0));
     145                        setMaxWayPoint(wayPoints.get(n-1));
     146                }               
     147               
     148                if (start.after(end) || start.equals(end)) {
     149                        // GPX does not contain time stamps -> use sequential order
     150                        setStart(wayPoints.get(0));
     151                        setEnd(wayPoints.get(n-1));
    138152                }
    139153               
Note: See TracChangeset for help on using the changeset viewer.