org.openstreetmap.josm.data.gpx
Class GpxData

java.lang.Object
  extended by org.openstreetmap.josm.data.gpx.WithAttributes
      extended by org.openstreetmap.josm.data.gpx.GpxData

public class GpxData
extends WithAttributes

Objects of this class represent a gpx file with tracks, waypoints and routes. It uses GPX v1.1, see the spec for details.


Field Summary
 java.lang.String creator
           
 boolean fromServer
           
static java.lang.String META_AUTHOR_EMAIL
           
static java.lang.String META_AUTHOR_LINK
           
static java.lang.String META_AUTHOR_NAME
           
static java.lang.String META_COPYRIGHT_AUTHOR
           
static java.lang.String META_COPYRIGHT_LICENSE
           
static java.lang.String META_COPYRIGHT_YEAR
           
static java.lang.String META_DESC
           
static java.lang.String META_KEYWORDS
           
static java.lang.String META_LINKS
           
static java.lang.String META_NAME
           
static java.lang.String META_PREFIX
           
static java.lang.String META_TIME
           
 java.util.Collection<GpxRoute> routes
           
 java.io.File storageFile
           
 java.util.Collection<GpxTrack> tracks
           
 java.util.Collection<WayPoint> waypoints
           
 
Fields inherited from class org.openstreetmap.josm.data.gpx.WithAttributes
attr
 
Constructor Summary
GpxData()
           
 
Method Summary
 boolean hasRoutePoints()
           
 boolean hasTrackPoints()
           
 boolean isEmpty()
           
 double length()
          calculates the sum of the lengths of all track segments
 void mergeFrom(GpxData other)
           
 Bounds recalculateBounds()
          calculates the bounding box of available data and returns it.
 
Methods inherited from class org.openstreetmap.josm.data.gpx.WithAttributes
getString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

META_PREFIX

public static final java.lang.String META_PREFIX
See Also:
Constant Field Values

META_AUTHOR_NAME

public static final java.lang.String META_AUTHOR_NAME
See Also:
Constant Field Values

META_AUTHOR_EMAIL

public static final java.lang.String META_AUTHOR_EMAIL
See Also:
Constant Field Values

META_AUTHOR_LINK

public static final java.lang.String META_AUTHOR_LINK
See Also:
Constant Field Values

META_COPYRIGHT_AUTHOR

public static final java.lang.String META_COPYRIGHT_AUTHOR
See Also:
Constant Field Values

META_COPYRIGHT_LICENSE

public static final java.lang.String META_COPYRIGHT_LICENSE
See Also:
Constant Field Values

META_COPYRIGHT_YEAR

public static final java.lang.String META_COPYRIGHT_YEAR
See Also:
Constant Field Values

META_DESC

public static final java.lang.String META_DESC
See Also:
Constant Field Values

META_KEYWORDS

public static final java.lang.String META_KEYWORDS
See Also:
Constant Field Values

META_LINKS

public static final java.lang.String META_LINKS
See Also:
Constant Field Values

META_NAME

public static final java.lang.String META_NAME
See Also:
Constant Field Values

META_TIME

public static final java.lang.String META_TIME
See Also:
Constant Field Values

storageFile

public java.io.File storageFile

fromServer

public boolean fromServer

creator

public java.lang.String creator

tracks

public final java.util.Collection<GpxTrack> tracks

routes

public final java.util.Collection<GpxRoute> routes

waypoints

public final java.util.Collection<WayPoint> waypoints
Constructor Detail

GpxData

public GpxData()
Method Detail

mergeFrom

public void mergeFrom(GpxData other)

hasTrackPoints

public boolean hasTrackPoints()

hasRoutePoints

public boolean hasRoutePoints()

isEmpty

public boolean isEmpty()

recalculateBounds

public Bounds recalculateBounds()
calculates the bounding box of available data and returns it. The bounds are not stored internally, but recalculated every time this function is called. FIXME might perhaps use visitor pattern?


length

public double length()
calculates the sum of the lengths of all track segments



JOSM