openrouteservice icon indicating copy to clipboard operation
openrouteservice copied to clipboard

Avoid Features and Snapping

Open Chwiggy opened this issue 3 months ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Feature/Enhancement Proposal

it would be really nice if one could exclude ferry routes and other commonly avoided features from snapping too and not just routing. Similar to the the flag that the directions endpoint offers.

{"options":{"avoid_features":["ferries"]}

If I want to snap to the routing graph, but want to avoid ferries in routing it doesn't help me if the snap endpoint snaps to an edge of the routing graph that's a ferry route.

Notably snapping to a ferry route is maybe a bit of a useless snap even if one is inclined to use it as part of a route. After all the ferry is not a permanent feature, and boarding a ferry mid transit is usually either frowned upon as a case of piracy or reserved for pilots or emergency situations.

Additional context

This crops up as an issue for climate action navigator code: https://gitlab.heigit.org/climate-action/utilities/mobility-tools/-/issues/1

Possible Implementation

No response

Forum Topic Link

No response

Chwiggy avatar Sep 30 '25 11:09 Chwiggy

Thanks for the idea! This sounds quite useful and should be relatively straightforward to implement. Note that the directions endpoint already works that way, for example compare the following query with and without avoid = highways set.

Image Image

aoles avatar Sep 30 '25 11:09 aoles

Although I agree that it should be easy, I vote for not re-implementing the old static mechanism for this endpoint, but direcly employ custom profiles. If we are lucky it already works on 9.4.

sfendrich avatar Oct 01 '25 07:10 sfendrich