<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 27, 2016 at 5:11 AM, Daniel Hofmann <span dir="ltr"><<a href="mailto:hofmann@mapbox.com" target="_blank">hofmann@mapbox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>When you say "should be avoided" you mean completely discarding a way going over a specific node in a single direction?<br></div><div>In that case, we support turn restrictions in the form of `fromWay,viaNode,toWay` you could try.<br></div><div><br></div><div>As in: `no_turn, fromResidential, viaHighwayNode, toResidential`<br></div><div><br>(Relevant: via-way restrictions: <a href="https://github.com/Project-OSRM/osrm-backend/issues/2681" target="_blank">https://github.com/Project-<wbr>OSRM/osrm-backend/issues/2681</a>)<br></div><div><br></div><div>Cheers,<br></div><div>Daniel J H<br></div></div><div class="gmail_extra"><br></div></blockquote><div><br></div><div>I had considered turn restrictions, but I was hoping for something a little more generalizable so that I don't have to identify specific nodes and ways in the config. For example, I'd like to tell the router to avoid a node representing the intersection of a residential way and a primary way IF the route is using the residential way. But I'd like to avoid having to identify all such instances via turn restrictions.</div><div><br></div><div>I could imagine something like the following pseudo code:</div><div><br></div><div>function crossing_penalty(entering_way, crossing_way, node)</div><div>    local entering_highway = way:get_value_by_key("highway")</div><div>    local crossing_highway = way:get_value_by_key("highway")<br></div><div>    -- get traffic signals</div><div>    local tag = node:get_value_by_key("highway")</div>    if tag and "traffic_signals" == tag then<br>        traffic_lights = true<br>    end<div>   <br></div><div>    if entering_highway == "residential" and crossing_highway == "primary" and not traffic_lights then:</div><div>        crossing_penalty = some_large_number</div></div></div></div>