public class GpxData extends WithAttributes
Modifier and Type | Class and Description |
---|---|
static class |
GpxData.LinesIterator
Iterates over all track segments and then over all routes.
|
Modifier and Type | Field and Description |
---|---|
java.lang.String |
creator |
boolean |
fromServer |
java.util.Collection<GpxRoute> |
routes |
java.io.File |
storageFile |
java.util.Collection<GpxTrack> |
tracks |
java.util.Collection<WayPoint> |
waypoints |
attr
JOSM_EXTENSIONS_NAMESPACE_URI, META_AUTHOR_EMAIL, META_AUTHOR_LINK, META_AUTHOR_NAME, META_COPYRIGHT_AUTHOR, META_COPYRIGHT_LICENSE, META_COPYRIGHT_YEAR, META_DESC, META_EXTENSIONS, META_KEYWORDS, META_LINKS, META_NAME, META_PREFIX, META_TIME, WPT_KEYS
Constructor and Description |
---|
GpxData() |
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<java.util.Collection<WayPoint>> |
getLinesIterable(boolean[] trackVisibility)
Iterate over all track segments and over all routes.
|
java.util.Date[] |
getMinMaxTimeForAllTracks()
Returns minimum and maximum timestamps for all tracks
Warning: there are lot of track with broken timestamps,
so we just ingore points from future and from year before 1970 in this method
works correctly @since 5815
|
static java.util.Date[] |
getMinMaxTimeForTrack(GpxTrack trk)
returns minimum and maximum timestamps in the track
|
boolean |
hasRoutePoints() |
boolean |
hasTrackPoints() |
boolean |
isEmpty() |
double |
length()
calculates the sum of the lengths of all track segments
|
void |
mergeFrom(GpxData other) |
WayPoint |
nearestPointOnTrack(EastNorth P,
double tolerance)
Makes a WayPoint at the projection of point P onto the track providing P is less than
tolerance away from the track
|
Bounds |
recalculateBounds()
calculates the bounding box of available data and returns it.
|
void |
resetEastNorthCache() |
addExtension, get, getCollection, getString, put
public java.io.File storageFile
public boolean fromServer
public java.lang.String creator
public GpxData()
public boolean hasTrackPoints()
public boolean hasRoutePoints()
public boolean isEmpty()
public Bounds recalculateBounds()
public double length()
public static java.util.Date[] getMinMaxTimeForTrack(GpxTrack trk)
trk
- track to analyzepublic java.util.Date[] getMinMaxTimeForAllTracks()
public WayPoint nearestPointOnTrack(EastNorth P, double tolerance)
P
- : the point to determine the projection fortolerance
- : must be no further than this from the trackpublic java.lang.Iterable<java.util.Collection<WayPoint>> getLinesIterable(boolean[] trackVisibility)
trackVisibility
- An array indicating which tracks should be
included in the iteration. Can be null, then all tracks are included.public void resetEastNorthCache()