public class OSMReader extends Object
Constructor and Description |
---|
OSMReader(BaseGraph baseGraph,
EncodingManager encodingManager,
OSMParsers osmParsers,
OSMReaderConfig config) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptWay(ReaderWay way)
This method is called for each way during the first and second pass of the
WaySegmentParser . |
protected void |
addEdge(int fromIndex,
int toIndex,
PointList pointList,
ReaderWay way,
Map<String,Object> nodeTags)
This method is called for each segment an OSM way is split into during the second pass of
WaySegmentParser . |
com.carrotsearch.hppc.IntIntMap |
getArtificialEdgesByEdges() |
Date |
getDataDate() |
protected boolean |
isBarrierNode(ReaderNode node) |
protected boolean |
isCalculateWayDistance(ReaderWay way) |
protected void |
preprocessRelations(ReaderRelation relation)
This method is called for each relation during the first pass of
WaySegmentParser |
protected void |
preprocessWay(ReaderWay way,
WaySegmentParser.CoordinateSupplier coordinateSupplier)
This method is called for each way during the second pass and before the way is split into edges.
|
protected void |
processRelation(ReaderRelation relation,
LongToIntFunction getIdForOSMNodeId)
This method is called for each relation during the second pass of
WaySegmentParser
We use it to save the relations and process them afterwards. |
void |
readGraph() |
OSMReader |
setAreaIndex(AreaIndex<CustomArea> areaIndex)
The area index is queried for each OSM way and the associated areas are added to the way's tags
|
protected void |
setArtificialWayTags(PointList pointList,
ReaderWay way,
double distance,
Map<String,Object> nodeTags)
This method is called during the second pass of
WaySegmentParser and provides an entry point to enrich
the given OSM way with additional tags before it is passed on to the tag parsers. |
OSMReader |
setCountryRuleFactory(CountryRuleFactory countryRuleFactory) |
OSMReader |
setElevationProvider(ElevationProvider eleProvider) |
OSMReader |
setFile(File osmFile)
Sets the OSM file to be read.
|
String |
toString() |
public OSMReader(BaseGraph baseGraph, EncodingManager encodingManager, OSMParsers osmParsers, OSMReaderConfig config)
public OSMReader setFile(File osmFile)
public OSMReader setAreaIndex(AreaIndex<CustomArea> areaIndex)
public OSMReader setElevationProvider(ElevationProvider eleProvider)
public OSMReader setCountryRuleFactory(CountryRuleFactory countryRuleFactory)
public void readGraph() throws IOException
IOException
public Date getDataDate()
protected boolean acceptWay(ReaderWay way)
WaySegmentParser
. All OSM
ways that are not accepted here and all nodes that are not referenced by any such way will be ignored.protected boolean isBarrierNode(ReaderNode node)
protected boolean isCalculateWayDistance(ReaderWay way)
protected void setArtificialWayTags(PointList pointList, ReaderWay way, double distance, Map<String,Object> nodeTags)
WaySegmentParser
and provides an entry point to enrich
the given OSM way with additional tags before it is passed on to the tag parsers.protected void addEdge(int fromIndex, int toIndex, PointList pointList, ReaderWay way, Map<String,Object> nodeTags)
WaySegmentParser
.fromIndex
- a unique integer id for the first node of this segmenttoIndex
- a unique integer id for the last node of this segmentpointList
- coordinates of this segmentway
- the OSM way this segment was taken fromnodeTags
- node tags of this segment if it is an artificial edge, empty otherwiseprotected void preprocessWay(ReaderWay way, WaySegmentParser.CoordinateSupplier coordinateSupplier)
protected void preprocessRelations(ReaderRelation relation)
WaySegmentParser
protected void processRelation(ReaderRelation relation, LongToIntFunction getIdForOSMNodeId)
WaySegmentParser
We use it to save the relations and process them afterwards.public com.carrotsearch.hppc.IntIntMap getArtificialEdgesByEdges()
Copyright © 2012–2022. All rights reserved.