1

I found this : https://github.com/karussell/graphhopper-osm-id-mapping/blob/master/src/main/java/com/graphhopper/osmidexample/MyGraphHopper.java

// Set
long pointer = 8L * edgeId;
edgeMapping.ensureCapacity(pointer + 8L);

edgeMapping.setInt(pointer, bitUtil.getIntLow(osmWayId));
edgeMapping.setInt(pointer + 4, bitUtil.getIntHigh(osmWayId));


// 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

user163695
  • 13
  • 3
  • As this is a duplicate this is answered here instead: https://discuss.graphhopper.com/t/how-to-use-dataaccess-to-store-long-int-map-in-graphhopper/624 – Karussell Apr 01 '16 at 15:47

0 Answers0