Class GpxImporter
java.lang.Object
org.openstreetmap.josm.gui.io.importexport.FileImporter
org.openstreetmap.josm.gui.io.importexport.GpxImporter
- All Implemented Interfaces:
Comparable<FileImporter>
File importer allowing to import GPX files (*.gpx/gpx.gz files).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUtility class containing imported GPX and marker layers, and a task to run after they are added to MapView. -
Field Summary
Fields inherited from class org.openstreetmap.josm.gui.io.importexport.FileImporter
filter, options -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdds the specified GPX and marker layers to Map.mainstatic ExtensionFileFilterReturns a GPX file filter (*.gpx and *.gpx.gz files).voidimportData(File file, ProgressMonitor progressMonitor) Needs to be implemented if isBatchImporter() returns false.static GpxImporter.GpxImporterDataloadLayers(InputStream is, File associatedFile, String gpxLayerName, ProgressMonitor progressMonitor) Replies the new GPX and marker layers corresponding to the specified GPX file.static GpxImporter.GpxImporterDataloadLayers(GpxData data, boolean parsedProperly, String gpxLayerName) Replies the new GPX and marker layers corresponding to the specified GPX data.Methods inherited from class org.openstreetmap.josm.gui.io.importexport.FileImporter
acceptFile, compareTo, getPriority, importData, importDataHandleExceptions, importDataHandleExceptions, isBatchImporter, isEnabled, setEnabled, setOptions
-
Constructor Details
-
GpxImporter
public GpxImporter()Constructs a newGpxImporter.
-
-
Method Details
-
getFileFilter
Returns a GPX file filter (*.gpx and *.gpx.gz files).- Returns:
- a GPX file filter
-
importData
Description copied from class:FileImporterNeeds to be implemented if isBatchImporter() returns false.- Overrides:
importDatain classFileImporter- Parameters:
file- file to importprogressMonitor- progress monitor- Throws:
IOException- if any I/O error occurs
-
addLayers
Adds the specified GPX and marker layers to Map.main- Parameters:
data- The layers to add- See Also:
-
loadLayers
public static GpxImporter.GpxImporterData loadLayers(GpxData data, boolean parsedProperly, String gpxLayerName) Replies the new GPX and marker layers corresponding to the specified GPX data.- Parameters:
data- The GPX dataparsedProperly- True if GPX data has been properly parsed byGpxReader.parse(boolean)gpxLayerName- The GPX layer name- Returns:
- the new GPX and marker layers corresponding to the specified GPX data, to be used with
addLayers(org.openstreetmap.josm.gui.io.importexport.GpxImporter.GpxImporterData) - See Also:
-
loadLayers
public static GpxImporter.GpxImporterData loadLayers(InputStream is, File associatedFile, String gpxLayerName, ProgressMonitor progressMonitor) throws IOException Replies the new GPX and marker layers corresponding to the specified GPX file.- Parameters:
is- input stream to GPX dataassociatedFile- GPX filegpxLayerName- The GPX layer nameprogressMonitor- The progress monitor- Returns:
- the new GPX and marker layers corresponding to the specified GPX file
- Throws:
IOException- if an I/O error occurs
-