- Timestamp:
- 2016-01-07T16:54:19+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r9248 r9338 241 241 / (trkPnt.time - oldWp.time); 242 242 velocities.add(vel); 243 if (vel > maxval) {244 maxval = vel;245 }246 if (vel < minval) {247 minval = vel;248 }249 243 } 250 244 oldWp = trkPnt; … … 252 246 } 253 247 Collections.sort(velocities); 254 minval = velocities.get(velocities.size() / 20); // 5% percentile to remove outliers 255 maxval = velocities.get(velocities.size() * 19 / 20); // 95% percentile to remove outliers 256 if (minval >= maxval) { 248 if (velocities.isEmpty()) { 257 249 velocityScale.setRange(0, 120/3.6); 258 250 } else { 251 minval = velocities.get(velocities.size() / 20); // 5% percentile to remove outliers 252 maxval = velocities.get(velocities.size() * 19 / 20); // 95% percentile to remove outliers 259 253 velocityScale.setRange(minval, maxval); 260 254 }
Note:
See TracChangeset
for help on using the changeset viewer.