Package org.openstreetmap.josm.io
Class GpxReader
- java.lang.Object
- 
- org.openstreetmap.josm.io.GpxReader
 
- 
- All Implemented Interfaces:
- GpxConstants,- IGpxReader
 
 public class GpxReader extends java.lang.Object implements GpxConstants, IGpxReader Read a gpx file.Bounds are read, even if we calculate them, see GpxData.recalculateBounds().
 Both GPX version 1.0 and 1.1 are supported.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.openstreetmap.josm.data.gpx.GpxConstantsGpxConstants.ColorFormat
 
- 
 - 
Field SummaryFields Modifier and Type Field Description private GpxDatagpxDataThe resulting gpx dataprivate org.xml.sax.InputSourceinputSource- 
Fields inherited from interface org.openstreetmap.josm.data.gpx.GpxConstantsEXTENSION_ABBREVIATIONS, FIX_VALUES, GARMIN_COLORS, GPX_CMT, GPX_DESC, GPX_NAME, GPX_PREFIX, GPX_SRC, JOSM_CREATOR_NAME, META_AUTHOR_EMAIL, META_AUTHOR_LINK, META_AUTHOR_NAME, META_BOUNDS, META_COPYRIGHT_AUTHOR, META_COPYRIGHT_LICENSE, META_COPYRIGHT_YEAR, META_DESC, META_KEYWORDS, META_LINKS, META_NAME, META_PREFIX, META_TIME, PT_AGEOFDGPSDATA, PT_COURSE, PT_DGPSID, PT_ELE, PT_FIX, PT_GEOIDHEIGHT, PT_HDOP, PT_MAGVAR, PT_PDOP, PT_SAT, PT_STD_HDEV, PT_STD_VDEV, PT_SYM, PT_TIME, PT_TYPE, PT_VDOP, RTE_TRK_KEYS, RTKLIB_AGE, RTKLIB_Q, RTKLIB_RATIO, RTKLIB_SDE, RTKLIB_SDEU, RTKLIB_SDN, RTKLIB_SDNE, RTKLIB_SDU, RTKLIB_SDUN, WPT_KEYS, XML_URI_EXTENSIONS_DRAWING, XML_URI_EXTENSIONS_GARMIN, XML_URI_EXTENSIONS_JOSM, XML_URI_XSD, XML_XSD_EXTENSIONS_DRAWING, XML_XSD_EXTENSIONS_GARMIN, XML_XSD_EXTENSIONS_JOSM
 
- 
 - 
Constructor SummaryConstructors Constructor Description GpxReader(java.io.InputStream source)Constructs a newGpxReader, which can later parse the input stream and store the result in trackData and markerData
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description GpxDatagetGpxData()Replies the GPX data.booleanparse(boolean tryToFinish)Parse the GPX data.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.openstreetmap.josm.io.IGpxReadergetNumberOfCoordinates
 
- 
 
- 
- 
- 
Field Detail- 
inputSourceprivate final org.xml.sax.InputSource inputSource 
 
- 
 - 
Constructor Detail- 
GpxReaderpublic GpxReader(java.io.InputStream source) throws java.io.IOException Constructs a newGpxReader, which can later parse the input stream and store the result in trackData and markerData- Parameters:
- source- the source input stream
- Throws:
- java.io.IOException- if an IO error occurs, e.g. the input stream is closed.
 
 
- 
 - 
Method Detail- 
parsepublic boolean parse(boolean tryToFinish) throws org.xml.sax.SAXException, java.io.IOException Parse the GPX data.- Specified by:
- parsein interface- IGpxReader
- Parameters:
- tryToFinish- true, if the reader should return at least part of the GPX data in case of an error.
- Returns:
- true if file was properly parsed, false if there was error during parsing but some data were parsed anyway
- Throws:
- org.xml.sax.SAXException- if any SAX parsing error occurs
- java.io.IOException- if any I/O error occurs
 
 - 
getGpxDatapublic GpxData getGpxData() Description copied from interface:IGpxReaderReplies the GPX data.- Specified by:
- getGpxDatain interface- IGpxReader
- Returns:
- The GPX data
 
 
- 
 
-