public class GpxImporter extends FileImporter
Modifier and Type | Class and Description |
---|---|
static class |
GpxImporter.GpxImporterData
Utility class containing imported GPX and marker layers, and a task to run after they are added to MapView.
|
filter
Constructor and Description |
---|
GpxImporter()
Constructs a new
GpxImporter . |
Modifier and Type | Method and Description |
---|---|
static void |
addLayers(GpxImporter.GpxImporterData data)
Adds the specified GPX and marker layers to Map.main
|
static ExtensionFileFilter |
getFileFilter()
Returns a GPX file filter (*.gpx and *.gpx.gz files).
|
void |
importData(java.io.File file,
ProgressMonitor progressMonitor)
Needs to be implemented if isBatchImporter() returns false.
|
static GpxImporter.GpxImporterData |
loadLayers(GpxData data,
boolean parsedProperly,
java.lang.String gpxLayerName,
java.lang.String markerLayerName)
Replies the new GPX and marker layers corresponding to the specified GPX data.
|
static GpxImporter.GpxImporterData |
loadLayers(java.io.InputStream is,
java.io.File associatedFile,
java.lang.String gpxLayerName,
java.lang.String markerLayerName,
ProgressMonitor progressMonitor)
Replies the new GPX and marker layers corresponding to the specified GPX file.
|
acceptFile, compareTo, getPriority, importData, importDataHandleExceptions, importDataHandleExceptions, isBatchImporter, isEnabled, setEnabled
public GpxImporter()
GpxImporter
.public static ExtensionFileFilter getFileFilter()
public void importData(java.io.File file, ProgressMonitor progressMonitor) throws java.io.IOException
FileImporter
importData
in class FileImporter
file
- file to importprogressMonitor
- progress monitorjava.io.IOException
- if any I/O error occurspublic static void addLayers(GpxImporter.GpxImporterData data)
data
- The layers to addloadLayers(org.openstreetmap.josm.data.gpx.GpxData, boolean, java.lang.String, java.lang.String)
public static GpxImporter.GpxImporterData loadLayers(GpxData data, boolean parsedProperly, java.lang.String gpxLayerName, java.lang.String markerLayerName)
data
- The GPX dataparsedProperly
- True if GPX data has been properly parsed by GpxReader.parse(boolean)
gpxLayerName
- The GPX layer namemarkerLayerName
- The marker layer nameaddLayers(org.openstreetmap.josm.gui.io.importexport.GpxImporter.GpxImporterData)
addLayers(org.openstreetmap.josm.gui.io.importexport.GpxImporter.GpxImporterData)
public static GpxImporter.GpxImporterData loadLayers(java.io.InputStream is, java.io.File associatedFile, java.lang.String gpxLayerName, java.lang.String markerLayerName, ProgressMonitor progressMonitor) throws java.io.IOException
is
- input stream to GPX dataassociatedFile
- GPX filegpxLayerName
- The GPX layer namemarkerLayerName
- The marker layer nameprogressMonitor
- The progress monitorjava.io.IOException
- if an I/O error occurs