public class WaySegmentParser extends Object
The OSM file is read twice. The first time we ignore OSM nodes and only determine the OSM node IDs at which accepted ways are intersecting. During the second pass we split the OSM ways at intersections, introduce the artificial segments and pass the way information along with the corresponding nodes to a given callback.
We assume a strict order of the OSM file: nodes, ways, then relations.
The main difficulty is that the OSM ID range is very large (64bit integers) and to be able to provide the full
node information for each segment we have to efficiently store the node data temporarily. This is addressed by
OSMNodeData
.
Modifier and Type | Class and Description |
---|---|
static class |
WaySegmentParser.Builder |
static interface |
WaySegmentParser.CoordinateSupplier |
static interface |
WaySegmentParser.EdgeHandler |
static interface |
WaySegmentParser.RelationProcessor |
static interface |
WaySegmentParser.WayPreprocessor |
Modifier and Type | Method and Description |
---|---|
Date |
getTimeStamp() |
protected OSMInput |
openOsmInputFile(File osmFile) |
void |
readOSM(File osmFile) |
public void readOSM(File osmFile)
osmFile
- the OSM file to parse, supported formats include .osm.xml, .osm.gz and .xml.pbfpublic Date getTimeStamp()
protected OSMInput openOsmInputFile(File osmFile) throws XMLStreamException, IOException
XMLStreamException
IOException
Copyright © 2012–2022. All rights reserved.