// Get
long pointer = 8L * internalEdgeId;
return bitUtil.combineIntsToLong(edgeMapping.getInt(pointer), edgeMapping.getInt(pointer + 4L));
In this sample, it use DataAccess to store EdgeId(Int) → OSMWayId(Long) mapping, however I want to do it conversely, use OSMWayId(Long) as Key, EdgeId(Int) as Value and store it into DataAccess, but no idea how to, can anyone help ? thanks
If you intend to map OSM IDs to internal IDs then you should not use the DataAccess as you’ll get huge holes wasting lots of memory. Instead use some external storage like MapDB, a simple HashMap or our more memory efficient map implementation for special cases used in OSMReader for this task. All depending on your requirements.
Sorry for duplicated post,
I just want to save what I import, exactly same as your sample but use osm way id (long) as key and edge id (int) as value, because I use osm way id to lookup the road is exist in my map and do the mapping if possible, not all data.
Is there any way to do it ? Many thanks