Is it possible to modify the routing weight of a unique road segment by its ID in GraphHopper?

Hi everyone,

I’m working on customizing routing weights in GraphHopper, and I want to know if it’s possible to adjust the weight of a specific, unique road segment by referencing its ID.

For example, if each road segment had a unique road_id, could I write a priority rule like this in a custom model?

{
  "priority": [
    {
      "if": "road_id == 1023453453",
      "multiply_by": 0.5
    }
  ]
}

Is there a built-in way to expose unique road IDs in GraphHopper’s encoded values, or would I need to add a custom TagParser for this?

Thanks in advance!

You can already use osm_way_id, but this is not always unique or each edge (=connection between two junctions). For unique edge IDs you would have to add a custom TagParser.