Changeset 23754 in osm for applications/editors/josm/plugins/ElevationProfile/src/org
- Timestamp:
- 2010-10-22T21:24:32+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationModel.java
r23709 r23754 145 145 } 146 146 147 setDistance(gpxData.length()); // get distance from GPX 147 148 GpxIterator.visit(gpxData, this); 148 149 -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfileBase.java
r23736 r23754 135 135 gain = 0; 136 136 lastEle = 0; 137 dist = 0.0; 138 137 139 138 for (WayPoint wayPoint : this.wayPoints) { 140 139 visit(wayPoint); … … 340 339 @Override 341 340 public double getDistance() { 342 return dist / 1000.0; // dist is in meters 341 return dist; // dist is in meters 342 } 343 344 /** 345 * Sets the distance of the elevation profile. 346 * @param dist 347 */ 348 protected void setDistance(double dist) { 349 this.dist = dist; 343 350 } 344 351 … … 489 496 } 490 497 491 / / determine distance498 /* 492 499 if (lastWayPoint != null) { 493 500 double d = wp.getCoor().greatCircleDistance(lastWayPoint.getCoor()); 494 501 dist += d; 495 } 502 }*/ 496 503 lastWayPoint = wp; 497 504 } -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java
r23750 r23754 41 41 import org.openstreetmap.josm.data.gpx.GpxData; 42 42 import org.openstreetmap.josm.gui.MapView; 43 import org.openstreetmap.josm.gui.NavigatableComponent; 43 44 import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener; 44 45 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; … … 289 290 setTitle(String.format("%s: %s", tr("Elevation Profile"), profile.getName())); 290 291 291 // TODO: Offer also ft here292 292 if (profile.hasElevationData()) { 293 minHeightLabel.setText(String.format("%d m", profile.getMinHeight())); 294 maxHeightLabel.setText(String.format("%d m", profile.getMaxHeight())); 295 avrgHeightLabel.setText(String.format("%d m", profile.getAverageHeight())); 296 elevationGainLabel.setText(String.format("%d m", profile 297 .getGain())); 293 // Show elevation data 294 minHeightLabel.setText( 295 NavigatableComponent.getSystemOfMeasurement().getDistText(profile.getMinHeight())); 296 maxHeightLabel.setText( 297 NavigatableComponent.getSystemOfMeasurement().getDistText(profile.getMaxHeight())); 298 avrgHeightLabel.setText( 299 NavigatableComponent.getSystemOfMeasurement().getDistText(profile.getAverageHeight())); 300 elevationGainLabel.setText( 301 NavigatableComponent.getSystemOfMeasurement().getDistText(profile.getGain())); 298 302 } else { // no elevation data 299 303 minHeightLabel.setText("-"); … … 312 316 313 317 totalTimeLabel.setText(String.format("%d:%d h", hours, minutes)); 314 distLabel.setText( String.format("%5.2f km",dist));318 distLabel.setText(NavigatableComponent.getSystemOfMeasurement().getDistText(dist)); 315 319 316 320 fireModelChanged();
Note:
See TracChangeset
for help on using the changeset viewer.