public class OsmReader extends AbstractReader
Modifier and Type | Class and Description |
---|---|
private static class |
OsmReader.OsmParsingException |
Modifier and Type | Field and Description |
---|---|
protected boolean |
cancel |
protected XMLStreamReader |
parser |
static List<OsmServerReadPostprocessor> |
postprocessors
Used by plugins to register themselves as data postprocessors.
|
ds, externalIdMap, relations, uploadChangeset, ways
Modifier | Constructor and Description |
---|---|
protected |
OsmReader()
constructor (for private and subclasses use only)
|
Modifier and Type | Method and Description |
---|---|
private User |
createUser(String uid,
String name) |
static void |
deregisterPostprocessor(OsmServerReadPostprocessor pp)
deregister a postprocessor previously registered with registerPostprocessor
|
protected DataSet |
doParseDataSet(InputStream source,
ProgressMonitor progressMonitor) |
private long |
getLong(String name) |
private void |
jumpToEnd() |
private void |
jumpToEnd(boolean printWarning)
When cursor is at the start of an element, moves it to the end tag of that element.
|
protected void |
parse() |
private void |
parseBounds(String generator) |
private void |
parseChangeset(Long uploadChangesetId) |
static DataSet |
parseDataSet(InputStream source,
ProgressMonitor progressMonitor)
Parse the given input source and return the dataset.
|
protected Node |
parseNode() |
private void |
parseOsm() |
protected Relation |
parseRelation() |
private RelationMemberData |
parseRelationMember(Relation r) |
protected void |
parseRoot() |
private void |
parseTag(Tagged t) |
protected void |
parseUnknown() |
protected void |
parseUnknown(boolean printWarning) |
protected Way |
parseWay() |
private long |
parseWayNode(Way w) |
private void |
readCommon(PrimitiveData current)
Read out the common attributes and put them into current OsmPrimitive.
|
static void |
registerPostprocessor(OsmServerReadPostprocessor pp)
register a new postprocessor
|
protected void |
setParser(XMLStreamReader parser) |
protected void |
throwException(String msg) |
getDataSet, prepareDataSet, processChangesetAfterParsing, processNodesAfterParsing, processRelationsAfterParsing, processWaysAfterParsing
protected XMLStreamReader parser
protected boolean cancel
public static List<OsmServerReadPostprocessor> postprocessors
protected OsmReader()
public static void registerPostprocessor(OsmServerReadPostprocessor pp)
public static void deregisterPostprocessor(OsmServerReadPostprocessor pp)
protected void setParser(XMLStreamReader parser)
protected void throwException(String msg) throws XMLStreamException
XMLStreamException
protected void parse() throws XMLStreamException
XMLStreamException
protected void parseRoot() throws XMLStreamException
XMLStreamException
private void parseOsm() throws XMLStreamException
XMLStreamException
private void parseBounds(String generator) throws XMLStreamException
XMLStreamException
protected Node parseNode() throws XMLStreamException
XMLStreamException
protected Way parseWay() throws XMLStreamException
XMLStreamException
private long parseWayNode(Way w) throws XMLStreamException
XMLStreamException
protected Relation parseRelation() throws XMLStreamException
XMLStreamException
private RelationMemberData parseRelationMember(Relation r) throws XMLStreamException
XMLStreamException
private void parseChangeset(Long uploadChangesetId) throws XMLStreamException
XMLStreamException
private void parseTag(Tagged t) throws XMLStreamException
XMLStreamException
protected void parseUnknown(boolean printWarning) throws XMLStreamException
XMLStreamException
protected void parseUnknown() throws XMLStreamException
XMLStreamException
private void jumpToEnd(boolean printWarning) throws XMLStreamException
XMLStreamException
private void jumpToEnd() throws XMLStreamException
XMLStreamException
private User createUser(String uid, String name) throws XMLStreamException
XMLStreamException
private void readCommon(PrimitiveData current) throws XMLStreamException
XMLStreamException
private long getLong(String name) throws XMLStreamException
XMLStreamException
protected DataSet doParseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException
IllegalDataException
public static DataSet parseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException
source
- the source input stream. Must not be null.progressMonitor
- the progress monitor. If null, NullProgressMonitor.INSTANCE
is assumedIllegalDataException
- thrown if the an error was found while parsing the data from the sourceIllegalArgumentException
- thrown if source is null