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, processWaysAfterParsingprotected 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
XMLStreamExceptionprotected void parse() throws XMLStreamException
XMLStreamExceptionprotected void parseRoot() throws XMLStreamException
XMLStreamExceptionprivate void parseOsm() throws XMLStreamException
XMLStreamExceptionprivate void parseBounds(String generator) throws XMLStreamException
XMLStreamExceptionprotected Node parseNode() throws XMLStreamException
XMLStreamExceptionprotected Way parseWay() throws XMLStreamException
XMLStreamExceptionprivate long parseWayNode(Way w) throws XMLStreamException
XMLStreamExceptionprotected Relation parseRelation() throws XMLStreamException
XMLStreamExceptionprivate RelationMemberData parseRelationMember(Relation r) throws XMLStreamException
XMLStreamExceptionprivate void parseChangeset(Long uploadChangesetId) throws XMLStreamException
XMLStreamExceptionprivate void parseTag(Tagged t) throws XMLStreamException
XMLStreamExceptionprotected void parseUnknown(boolean printWarning) throws XMLStreamException
XMLStreamExceptionprotected void parseUnknown() throws XMLStreamException
XMLStreamExceptionprivate void jumpToEnd(boolean printWarning) throws XMLStreamException
XMLStreamExceptionprivate void jumpToEnd() throws XMLStreamException
XMLStreamExceptionprivate User createUser(String uid, String name) throws XMLStreamException
XMLStreamExceptionprivate void readCommon(PrimitiveData current) throws XMLStreamException
XMLStreamExceptionprivate long getLong(String name) throws XMLStreamException
XMLStreamExceptionprotected DataSet doParseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException
IllegalDataExceptionpublic 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