Custom edge weights from external data in GraphHopper 4.0

I suggest to create a new EncodedValue that you fill with the value of your choice (name it e.g. myweight) and then consider this value in the custom model via

"priority": [
{ "if": "myweight < 0.5",
  "multiply_by": 0.3 
}]

For this there is usually no need to touch FlagEncoders or Weighting code.

Regarding the custom models see the documentation and this blog post.

See also e.g. this discussion.

1 Like