I need to store an edgeId-osmWayId Map during import from OSM file, to use it during routing. Is it possible? Any suggestion?
Asked
Active
Viewed 398 times
1 Answers
0
You could store this information to a map while import. As it grows really big I suggest using a preallocated long-array with as many entries as there are edges. E.g. use a custom encoder:
CarFlagEncoder carEncoder = new CarFlagEncoder(5, 5, 3) {
@Override
public void applyWayTags(OSMWay way, EdgeIteratorState edge) {
ghEdgeIdToOSMWayIdMap[edge.getEdge()] = way.getId();
super.applyWayTags(way, edge);
}
};
setEncodingManager(new EncodingManager(carEncoder, ...));

Karussell
- 17,085
- 16
- 97
- 197
I create my map in this way :
[code] protected void storeOsmWayID( int edgeId, long osmWayId ) { if (getOsmWayIdSet().contains(osmWayId)) { getEdgeIdToOsmWayIdMap().put(edgeId, osmWayId); } // Creo associazione tra edgeId e osmWayId osmEdgeIdOsmWayIdMap.put(edgeId, osmWayId); }[code]
but i have no idea how to store it in my graph and use it during routing. E.g. in a custom Weighting. – Antonio Grimaldi Apr 07 '15 at 13:39