public class OsmImporter extends FileImporter
Modifier and Type | Class and Description |
---|---|
static class |
OsmImporter.OsmImporterData
Utility class containing imported OSM layer, and a task to run after it is added to MapView.
|
Modifier and Type | Field and Description |
---|---|
static ExtensionFileFilter |
FILE_FILTER
The OSM file filter (*.osm and *.xml files).
|
filter
Constructor and Description |
---|
OsmImporter()
Constructs a new
OsmImporter . |
OsmImporter(ExtensionFileFilter filter)
Constructs a new
OsmImporter with the given extension file filter. |
Modifier and Type | Method and Description |
---|---|
protected OsmDataLayer |
createLayer(DataSet dataSet,
java.io.File associatedFile,
java.lang.String layerName) |
protected java.lang.Runnable |
createPostLayerTask(DataSet dataSet,
java.io.File associatedFile,
java.lang.String layerName,
OsmDataLayer layer) |
void |
importData(java.io.File file,
ProgressMonitor progressMonitor)
Imports OSM data from file
|
protected void |
importData(java.io.InputStream in,
java.io.File associatedFile,
ProgressMonitor pm)
Imports OSM data from stream
|
OsmImporter.OsmImporterData |
loadLayer(java.io.InputStream in,
java.io.File associatedFile,
java.lang.String layerName,
ProgressMonitor progressMonitor)
Load osm data layer from InputStream.
|
protected DataSet |
parseDataSet(java.io.InputStream in,
ProgressMonitor progressMonitor) |
acceptFile, compareTo, getPriority, importData, importDataHandleExceptions, importDataHandleExceptions, isBatchImporter, isEnabled, setEnabled
public static final ExtensionFileFilter FILE_FILTER
public OsmImporter()
OsmImporter
.public OsmImporter(ExtensionFileFilter filter)
OsmImporter
with the given extension file filter.filter
- The extension file filterpublic void importData(java.io.File file, ProgressMonitor progressMonitor) throws java.io.IOException, IllegalDataException
importData
in class FileImporter
file
- file to read data fromprogressMonitor
- handler for progress monitoring and cancelingjava.io.IOException
- if any I/O error occursIllegalDataException
- if invalid data is readprotected void importData(java.io.InputStream in, java.io.File associatedFile, ProgressMonitor pm) throws IllegalDataException
in
- input streamassociatedFile
- filename of data (layer name will be generated from name of file)pm
- handler for progress monitoring and cancelingIllegalDataException
- if an error was found while parsing the OSM datapublic OsmImporter.OsmImporterData loadLayer(java.io.InputStream in, java.io.File associatedFile, java.lang.String layerName, ProgressMonitor progressMonitor) throws IllegalDataException
in
- input streamassociatedFile
- filename of data (can be null
if the stream does not come from a file)layerName
- name of generated layerprogressMonitor
- handler for progress monitoring and cancelingIllegalDataException
- if an error was found while parsing the OSM dataprotected DataSet parseDataSet(java.io.InputStream in, ProgressMonitor progressMonitor) throws IllegalDataException
IllegalDataException
protected OsmDataLayer createLayer(DataSet dataSet, java.io.File associatedFile, java.lang.String layerName)
protected java.lang.Runnable createPostLayerTask(DataSet dataSet, java.io.File associatedFile, java.lang.String layerName, OsmDataLayer layer)