graphhopper / graphhopper

Open source routing engine for OpenStreetMap. Use it as Java library or standalone web server.

Home Page:https://www.graphhopper.com/open-source/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow to route through highway=construction

caspg opened this issue · comments

In some usecases it would be useful to treat highway=construction as accessible roads.

For example, I could use map matching API to snap some older GPX track and get OSM informations. This would allow to maintain original GPX geometry without avoiding roads under construction.

By default highway=construction shouldn't be accessible but there should be an option to change that with custom profile.

link to the forum discussion

commented

Would be adding CONSTRUCTION to RoadClass sufficient for your use case?

@karussell I think it's not enough. I had to add "construction" to allowedHighways here.

But then construction ways are included by default so they would have to be de-prioritized by default somehwere.

commented

Did you try the custom model I suggested:

{
  "priority":[
    { "if": "road_class != CONSTRUCTION", "multiply_by": "bike_priority" },
    { "if": "road_class == CONSTRUCTION", "multiply_by": "1" },
    { "else_if": "!bike_access && (!backward_bike_access || roundabout)", "multiply_by": "0" },
    { "else_if": "!bike_access && backward_bike_access", "multiply_by": "0.2" }
  ]
}

without the change to the source code in BikeCommonAccessParser.java?

@karussell without changing BikeCommonAccessParser.java it's not working.

CleanShot 2024-06-10 at 12 58 54@2x

After adding changing BikeCommonAccessParser:

CleanShot 2024-06-10 at 13 03 09@2x

commented

Can you share the custom model you used? Please note that the custom model must be used on the server-side (otherwise it won't work here but also not for map matching)

@karussell Your custom model worked server side! I need to read more about client vs server side models.

Open PR with adding CONSTRUCTION TO RoadClass?

commented

Basically with a client-side model you are adding more statements to the existing list of the server-side model (priority and speed sections separately) and so you currently cannot "unblock" roads that are blocked via the server-side model. Furthermore map matching, isochrone and spt endpoints only work with server-side models.

Open PR with adding CONSTRUCTION TO RoadClass?

👍

Thanks for the explanation. I'll prepare the PR shortly.