Changeset 8384 in josm for trunk/src/org/openstreetmap/josm/data/gpx
- Timestamp:
- 2015-05-17T15:52:24+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r8373 r8384 18 18 import org.openstreetmap.josm.data.DataSource; 19 19 import org.openstreetmap.josm.data.coor.EastNorth; 20 import org.openstreetmap.josm.tools.Utils; 20 21 21 22 /** … … 211 212 */ 212 213 public Date[] getMinMaxTimeForAllTracks() { 213 double min=1e100, max=-1e100, t; 214 double min=1e100; 215 double max=-1e100; 214 216 double now = System.currentTimeMillis()/1000.0; 215 217 for (GpxTrack trk: tracks) { 216 218 for (GpxTrackSegment seg : trk.getSegments()) { 217 219 for (WayPoint pnt : seg.getWayPoints()) { 218 t = pnt.time;220 double t = pnt.time; 219 221 if (t>0 && t<=now) { 220 222 if (t>max) max=t; … … 224 226 } 225 227 } 226 if ( min==1e100 || max==-1e100) return null;227 return new Date[]{new Date((long) (min * 1000)), new Date((long) (max * 1000)) ,};228 if (Utils.equalsEpsilon(min,1e100) || Utils.equalsEpsilon(max,-1e100)) return new Date[0]; 229 return new Date[]{new Date((long) (min * 1000)), new Date((long) (max * 1000))}; 228 230 } 229 231 … … 293 295 double C = -A * rx - B * ry; 294 296 double RSsq = A * A + B * B; 295 if ( RSsq == 0.0) {297 if (Double.doubleToRawLongBits(RSsq) == 0) { 296 298 continue; 297 299 }
Note:
See TracChangeset
for help on using the changeset viewer.