[OSRM-talk] Restrict access to tunnels

Nikhil VJ nikhil.js at gmail.com
Wed Sep 29 04:01:50 UTC 2021


Hi Roland,

In this expression:
*if (way:get_value_by_key("tunnel") == "yes")*

Can we bring in the length of the tunnel segment?
Then we can include if it's short length and exclude if it's long length.

I'd really like to see all the attributes available to the .lua file to
play around with. If there is any such documentation, can anyone share?

--
Cheers,
Nikhil VJ
https://nikhilvj.co.in


On Wed, Sep 29, 2021 at 12:36 AM Eduardo Sánchez <esanchezansola at gmail.com>
wrote:

> Hi, thank you for your answer.
>
> I think the first option is the indicated, but taking into account
> your comments about not all the ways tagged with "tunnel" are actually
> tunnels maybe I'm adopting the penalty weight approach.
>
> Have you an idea of how to provide a penalty on the weight for the tunnels.
>
> Best regards,
> Eduardo
>
> 2021-09-28 13:03 GMT-04:00, Roland Swingler <roland at beeline.co>:
> > You _can_ do this by changing the process_way function in the profile
> > you're using. I.e. in the car.lua profile you could do something like
> >
> > if (way:get_value_by_key("tunnel") == "yes")
> > then
> >     return
> > end
> >
> > near the top of the function. Another way is to preprocess the osm file
> > with something like osmium tag-filter to exclude ways with that tag.
> >
> > However you may find that removing tunnels altogether isn't what you
> want -
> > a lot of "tunnels" are really just the underside of railway bridges where
> > the road passes underneath for example, rather than what you might think
> of
> > as a tunnel. In this case you may just want to provide a penalty on the
> > weight of the way rather than removing it completely, so it can still be
> > routed across but long tunnels will be avoided. Or if you really need to
> > strip them, maybe think about doing something with the total length of
> the
> > tunnel.
> >
> > HTH,
> > Roland
> >
> > On Tue, 28 Sept 2021 at 17:11, Eduardo Sánchez <esanchezansola at gmail.com
> >
> > wrote:
> >
> >> Hello, we are using OSRM in our project and we want to avoid the
> >> vehicles taking certain ways, specifically tunnels. Is any way to do
> >> this?
> >>
> >> Another question: it is possible to block specific ways by the name
> >> attribute?
> >>
> >> Best regards,
> >> Eduardo
> >>
> >> _______________________________________________
> >> OSRM-talk mailing list
> >> OSRM-talk at openstreetmap.org
> >> https://lists.openstreetmap.org/listinfo/osrm-talk
> >>
> >
>
> _______________________________________________
> OSRM-talk mailing list
> OSRM-talk at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/osrm-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osrm-talk/attachments/20210929/28338b17/attachment.htm>


More information about the OSRM-talk mailing list