Changeset 941 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2008-09-10T00:30:56+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r813 r941 307 307 } 308 308 } 309 if (earliest != null && latest != null){309 if (earliest != null && latest != null) { 310 310 DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT); 311 311 info.append(tr("Timespan: ") + df.format(new Date((long)(earliest.time * 1000))) + " - " … … 362 362 ********** STEP 1 - GET CONFIG VALUES ************************** 363 363 ****************************************************************/ 364 Long startTime = System.currentTimeMillis();364 // Long startTime = System.currentTimeMillis(); 365 365 Color neutralColor = Main.pref.getColor(marktr("gps point"), "layer "+name, Color.GRAY); 366 366 boolean forceLines = Main.pref.getBoolean("draw.rawgps.lines.force"); // also draw lines between points belonging to different segments … … 397 397 ****************************************************************/ 398 398 if (!computeCacheInSync) { // don't compute if the cache is good 399 WayPoint oldWp = null;400 for (GpxTrack trk : data.tracks) {399 WayPoint oldWp = null; 400 for (GpxTrack trk : data.tracks) { 401 401 if (!forceLines) { // don't draw lines between segments, unless forced to 402 402 oldWp = null; 403 }404 for (Collection<WayPoint> segment : trk.trackSegs) {405 for (WayPoint trkPnt : segment) {403 } 404 for (Collection<WayPoint> segment : trk.trackSegs) { 405 for (WayPoint trkPnt : segment) { 406 406 if (Double.isNaN(trkPnt.latlon.lat()) || Double.isNaN(trkPnt.latlon.lon())) { 407 continue;407 continue; 408 408 } 409 409 if (oldWp != null) { 410 double dist = trkPnt.latlon.greatCircleDistance(oldWp.latlon);411 double dtime = trkPnt.time - oldWp.time;412 double vel = dist/dtime;410 double dist = trkPnt.latlon.greatCircleDistance(oldWp.latlon); 411 double dtime = trkPnt.time - oldWp.time; 412 double vel = dist/dtime; 413 413 414 414 if (!colored) { … … 424 424 } else { 425 425 trkPnt.drawLine = false; 426 }426 } 427 427 } else { // make sure we reset outdated data 428 428 trkPnt.speedLineColor = colors[255]; -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r805 r941 371 371 } 372 372 WayPoint wpt = new WayPoint(n.coor); 373 if(n.timestamp != null) 373 if (n.timestamp != null) 374 { 374 375 wpt.attr.put("time", n.timestamp); 376 wpt.setTime(); 377 } 375 378 trkseg.add(wpt); 376 379 } 377 380 } 381 382 // what is this loop meant to do? it creates waypoints but never 383 // records them? 378 384 for (Node n : data.nodes) { 379 385 if (n.incomplete || n.deleted || doneNodes.contains(n)) continue; 380 386 WayPoint wpt = new WayPoint(n.coor); 381 if (n.timestamp != null)387 if (n.timestamp != null) { 382 388 wpt.attr.put("time", n.timestamp); 389 wpt.setTime(); 390 } 383 391 if (n.keys != null && n.keys.containsKey("name")) { 384 392 wpt.attr.put("name", n.keys.get("name"));
Note:
See TracChangeset
for help on using the changeset viewer.