Changeset 9234 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r9078 r9234 11 11 import java.awt.RenderingHints; 12 12 import java.awt.Stroke; 13 import java.util.ArrayList; 13 14 import java.util.Collection; 15 import java.util.Collections; 14 16 import java.util.Date; 15 17 import java.util.List; … … 224 226 if (colorModeDynamic) { 225 227 if (colored == ColorMode.VELOCITY) { 228 final List<Double> velocities = new ArrayList<>(); 226 229 for (Collection<WayPoint> segment : data.getLinesIterable(null)) { 227 230 if (!forceLines) { … … 236 239 double vel = c.greatCircleDistance(oldWp.getCoor()) 237 240 / (trkPnt.time - oldWp.time); 241 velocities.add(vel); 238 242 if (vel > maxval) { 239 243 maxval = vel; … … 246 250 } 247 251 } 252 Collections.sort(velocities); 253 minval = velocities.get(velocities.size() / 20); // 5% percentile to remove outliers 254 maxval = velocities.get(velocities.size() * 19 / 20); // 95% percentile to remove outliers 248 255 if (minval >= maxval) { 249 256 velocityScale.setRange(0, 120/3.6);
Note:
See TracChangeset
for help on using the changeset viewer.