<!DOCTYPE html><html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  </head>
  <body>
    <p>Hi Florian,</p>
    <p>I understand your problem, but personally I'd not be in favor of
      such an approach (and not only bcs of "don't tag for the router").
      The effect it would have in a particular routing engine would be
      similar to today: it depends. So it wouldn't make things more
      consistent and you'd still find the same problems you have today.
      But more importantly, this seems like a very heavily subjective
      choice to make for a single mapper who has no idea how exactly
      that extra cost is implemented in any engine, which is eventually
      what he'd like to get out of it.<br/>
    </p>
    <p>IMO this needs to be solved with conventional tagging and/or
      heuristics (increase penalty to switch to lower hierarchy roads,
      less turns or such). I'm missing the argument why you think those
      routes are bad. I guess it's because they're taking a shortcut on
      lower-level roads instead of staying on the high-level roads?
      Sounds similar to dive-bombs (classic: during congestion, take the
      off-ramp only to join the highway 1 km further on the on-ramp,
      just to save 5 mins of the traffic jam). Essentially that IS the
      cheapest route, but you (and me too) consider it asocial behavior
      to have through traffic take those residential roads just to save
      2 seconds. So we'd need to cost those way segments more or the
      transition onto those. </p>
    <p>That can be done in various ways. Either one can set a (pretty
      hard IMO) "destination" tag there so thru traffic is penalized or
      even disallowed. But that would probably clash with the legal
      situation of those roads and mappers would hate it as it's again
      "tagged for the router". Ideally routing engines try their best to
      avoid those dive bombs. I didn't really look into all Valhalla
      code regarding this specifically. Rather than here on the (pretty
      inactive) OSRM dev list, I'd encourage you to open an issue with
      Valhalla, I know we've had similar issues and solved some of them,
      but for sure the discussion would be livelier (no offense).<br/>
    </p>
    <p>All the best<br/>
      Nils<br/>
    </p>
    <div class="moz-cite-prefix">On 11.12.23 12:53, Florian Lohoff
      wrote:<br/>
    </div>
    <blockquote type="cite" cite="mid:20231211115326.3qeoxnjq27l3ach3@pax.zz.de">
      <pre class="moz-quote-pre" wrap="">Hi,

Prolog:
Discuss a generic tag for reducing/increasing route-weights/costs regardless
of other tags.


For 10 years i am running Routing Quality Assurance by calculating
routes every 30 minutes and watching their changes over time.

When i add regions to that monitoring i typically go through
and fix "static errors" where road taggings cause small side roads
to be used as shortcuts.

Most of the time fixing tagging on the roads and the shortcut fixes
the issue. I typically tag maxspeed, lanes, surface, lane_markings etc.

But sometimes i have cases where these tags are not sufficient and i
dont get the relative weight of the routes to the higher class
road network.

I am missing a generic tag to influence routing in ways like "dont use
this road as a through road although legally allowed" e.g. make it
more expensive in routing.

Examples:

The route uses "Im Kracht" where it should stay on K22 and L775:
<a class="moz-txt-link-freetext" href="https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=52.2340%2C8.5138%3B52.2381%2C8.4837#map=15/52.2354/8.4993&layers=N">https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=52.2340%2C8.5138%3B52.2381%2C8.4837#map=15/52.2354/8.4993&layers=N</a>

The route uses "Westerweg" but it should stay on K27, L876, L803:
<a class="moz-txt-link-freetext" href="https://www.openstreetmap.org/directions?engine=graphhopper_car&route=52.2803%2C8.6965%3B52.2890%2C8.7094#map=15/52.2825/8.7106&layers=N">https://www.openstreetmap.org/directions?engine=graphhopper_car&route=52.2803%2C8.6965%3B52.2890%2C8.7094#map=15/52.2825/8.7106&layers=N</a>


Dont get into discussions why one engine gets it and the other doesnt.
We are not talking about routing engine/profile comparisons. I can
create such a problem in ANY engine and profile just depending on the
geometries and tags understood in one or the other engine/profile.


So my idea would be to create a tag like **relative_route_cost=** or
the like which is a float between 0 and 2 where "1" is "use the route
weight calculated from your route engines physical tag analysis".

So

0 -> decrease cost of this road to "0%"
1 -> Let the cost be the cost of the engines tag analysis
2 -> double the cost of the engines tag analysis

This would allow us to directly influence the usage of "shortcuts" or
through roads used "accidentally".

I would like to not create "routing engine specific" tags like
**osrm:relative_weight=** or something.

Thoughts?

Flo
--
Florian Lohoff                                                     <a class="moz-txt-link-abbreviated" href="mailto:f@zz.de">f@zz.de</a>
  Any sufficiently advanced technology is indistinguishable from magic.
_______________________________________________
OSRM-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OSRM-talk@openstreetmap.org">OSRM-talk@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/osrm-talk">https://lists.openstreetmap.org/listinfo/osrm-talk</a>
</pre>
    </blockquote>
    <div class="moz-signature">-- <br/>
      <div style="display: flex; width: 400px">
        <div>
          <svg version="1.1" id="Ebene_1" x="0px" y="0px" width="107" height="145" viewBox="0 0 298.609 367.9741" enable-background="new 0 0 1477.066 298.589" xml:space="preserve" sodipodi:docname="logo_vertical.svg" inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)" inkscape:export-filename="logo_vertical_500px.png" inkscape:export-xdpi="160.74532" inkscape:export-ydpi="160.74532" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
            <defs id="defs37">
              <linearGradient inkscape:collect="always" xlink:href="#SVGID_1_" id="linearGradient1079" gradientUnits="userSpaceOnUse" x1="62.258801" y1="168.34959" x2="163.1813" y2="287.9039"></linearGradient>
              <linearGradient inkscape:collect="always" xlink:href="#SVGID_2_" id="linearGradient1081" gradientUnits="userSpaceOnUse" x1="244.2188" y1="298.7417" x2="175.01579" y2="95.458099"></linearGradient>
              <linearGradient inkscape:collect="always" xlink:href="#SVGID_1_" id="linearGradient1083" gradientUnits="userSpaceOnUse" x1="62.258801" y1="168.34959" x2="163.1813" y2="287.9039"></linearGradient>
              <linearGradient inkscape:collect="always" xlink:href="#SVGID_2_" id="linearGradient1085" gradientUnits="userSpaceOnUse" x1="244.2188" y1="298.7417" x2="175.01579" y2="95.458099"></linearGradient>
              <linearGradient inkscape:collect="always" xlink:href="#SVGID_1_" id="linearGradient1087" gradientUnits="userSpaceOnUse" x1="62.258801" y1="168.34959" x2="163.1813" y2="287.9039"></linearGradient>
              <linearGradient inkscape:collect="always" xlink:href="#SVGID_2_" id="linearGradient1089" gradientUnits="userSpaceOnUse" x1="244.2188" y1="298.7417" x2="175.01579" y2="95.458099"></linearGradient>
              <linearGradient inkscape:collect="always" xlink:href="#SVGID_1_" id="linearGradient1091" gradientUnits="userSpaceOnUse" x1="62.258801" y1="168.34959" x2="163.1813" y2="287.9039"></linearGradient>
              <linearGradient inkscape:collect="always" xlink:href="#SVGID_2_" id="linearGradient1093" gradientUnits="userSpaceOnUse" x1="244.2188" y1="298.7417" x2="175.01579" y2="95.458099"></linearGradient>
            </defs>
            <sodipodi:namedview id="namedview35" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" showgrid="false" inkscape:zoom="0.63574531" inkscape:cx="398.74459" inkscape:cy="284.70521" inkscape:window-width="1687" inkscape:window-height="1367" inkscape:window-x="57" inkscape:window-y="0" inkscape:window-maximized="0" inkscape:current-layer="Ebene_1"></sodipodi:namedview>
            <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="62.258801" y1="168.34959" x2="163.1813" y2="287.9039">
              <stop offset="0" style="stop-color: #4c5fe9" id="stop2"></stop>
              <stop offset="1" style="stop-color: #4c5fe9; stop-opacity: 0.2" id="stop4"></stop> </linearGradient>
            <linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="244.2188" y1="298.7417" x2="175.01579" y2="95.458099">
              <stop offset="0" style="stop-color: #9943f5" id="stop9"></stop>
              <stop offset="0.3444" style="stop-color: #824bf1" id="stop11"></stop>
              <stop offset="1" style="stop-color: #4c5fe9" id="stop13"></stop>
            </linearGradient>
            <g id="g199">
              <path fill="url(#SVGID_1_)" d="M 149.302,298.589 C 66.978,298.589 0,231.608 0,149.284 0,108.157 16.734,70.846 43.74,43.812 l 35.662,35.666 c -17.869,17.9 -28.941,42.589 -28.941,69.806 0,20.17 1.791,41.41 37.839,82.979 l 0.094,0.105 c 4.858,5.609 10.339,11.562 16.502,17.949 z" id="path7" style="fill: url(#linearGradient1079)"></path>
              <path fill="url(#SVGID_2_)" d="m 298.609,149.284 c 0,82.324 -66.98,149.305 -149.308,149.305 l 44.404,-48.271 c 6.171,-6.387 11.644,-12.34 16.514,-17.949 l 0.091,-0.105 c 36.049,-41.568 37.838,-62.809 37.838,-82.979 0,-27.247 -11.086,-51.947 -28.993,-69.853 -17.885,-17.889 -42.6,-28.971 -69.854,-28.971 -27.251,0 -51.967,11.082 -69.85,28.971 -0.02,0.018 -0.031,0.033 -0.051,0.047 L 43.74,43.812 C 70.77,16.75 108.11,0 149.302,0 231.629,0 298.609,66.964 298.609,149.284 Z" id="path16" style="fill: url(#linearGradient1081)"></path>
            </g>
            <g id="g215">
              <path fill="url(#SVGID_1_)" d="M 149.302,298.589 C 66.978,298.589 0,231.608 0,149.284 0,108.157 16.734,70.846 43.74,43.812 l 35.662,35.666 c -17.869,17.9 -28.941,42.589 -28.941,69.806 0,20.17 1.791,41.41 37.839,82.979 l 0.094,0.105 c 4.858,5.609 10.339,11.562 16.502,17.949 z" id="path211" style="fill: url(#linearGradient1083)"></path>
              <path fill="url(#SVGID_2_)" d="m 298.609,149.284 c 0,82.324 -66.98,149.305 -149.308,149.305 l 44.404,-48.271 c 6.171,-6.387 11.644,-12.34 16.514,-17.949 l 0.091,-0.105 c 36.049,-41.568 37.838,-62.809 37.838,-82.979 0,-27.247 -11.086,-51.947 -28.993,-69.853 -17.885,-17.889 -42.6,-28.971 -69.854,-28.971 -27.251,0 -51.967,11.082 -69.85,28.971 -0.02,0.018 -0.031,0.033 -0.051,0.047 L 43.74,43.812 C 70.77,16.75 108.11,0 149.302,0 231.629,0 298.609,66.964 298.609,149.284 Z" id="path213" style="fill: url(#linearGradient1085)"></path>
            </g>
            <g id="g239">
              <path fill="url(#SVGID_1_)" d="M 149.302,298.589 C 66.978,298.589 0,231.608 0,149.284 0,108.157 16.734,70.846 43.74,43.812 l 35.662,35.666 c -17.869,17.9 -28.941,42.589 -28.941,69.806 0,20.17 1.791,41.41 37.839,82.979 l 0.094,0.105 c 4.858,5.609 10.339,11.562 16.502,17.949 z" id="path235" style="fill: url(#linearGradient1087)"></path>
              <path fill="url(#SVGID_2_)" d="m 298.609,149.284 c 0,82.324 -66.98,149.305 -149.308,149.305 l 44.404,-48.271 c 6.171,-6.387 11.644,-12.34 16.514,-17.949 l 0.091,-0.105 c 36.049,-41.568 37.838,-62.809 37.838,-82.979 0,-27.247 -11.086,-51.947 -28.993,-69.853 -17.885,-17.889 -42.6,-28.971 -69.854,-28.971 -27.251,0 -51.967,11.082 -69.85,28.971 -0.02,0.018 -0.031,0.033 -0.051,0.047 L 43.74,43.812 C 70.77,16.75 108.11,0 149.302,0 231.629,0 298.609,66.964 298.609,149.284 Z" id="path237" style="fill: url(#linearGradient1089)"></path>
            </g>
            <g id="g263">
              <path fill="url(#SVGID_1_)" d="M 149.302,298.589 C 66.978,298.589 0,231.608 0,149.284 0,108.157 16.734,70.846 43.74,43.812 l 35.662,35.666 c -17.869,17.9 -28.941,42.589 -28.941,69.806 0,20.17 1.791,41.41 37.839,82.979 l 0.094,0.105 c 4.858,5.609 10.339,11.562 16.502,17.949 z" id="path259" style="fill: url(#linearGradient1091)"></path>
              <path fill="url(#SVGID_2_)" d="m 298.609,149.284 c 0,82.324 -66.98,149.305 -149.308,149.305 l 44.404,-48.271 c 6.171,-6.387 11.644,-12.34 16.514,-17.949 l 0.091,-0.105 c 36.049,-41.568 37.838,-62.809 37.838,-82.979 0,-27.247 -11.086,-51.947 -28.993,-69.853 -17.885,-17.889 -42.6,-28.971 -69.854,-28.971 -27.251,0 -51.967,11.082 -69.85,28.971 -0.02,0.018 -0.031,0.033 -0.051,0.047 L 43.74,43.812 C 70.77,16.75 108.11,0 149.302,0 231.629,0 298.609,66.964 298.609,149.284 Z" id="path261" style="fill: url(#linearGradient1093)"></path>
            </g>
            <g id="g1077">
              <path fill="#150922" d="m 139.22854,342.16038 c 0,-3.26906 -2.65034,-5.91967 -5.92178,-5.91967 -3.26853,0 -5.921,2.65061 -5.921,5.91967 0,3.27171 2.65247,5.92125 5.921,5.92125 3.27144,0 5.92178,-2.64954 5.92178,-5.92125 z" id="path265" style="stroke-width: 10; stroke-dasharray: none"></path>
              <path fill="#150922" d="m 55.094566,336.95328 v 20.21337 c 0,0 -8.085296,10.5107 -24.256154,10.5107 -16.979148,0 -29.91578108,-12.93636 -29.91578108,-29.10722 0,-16.17086 12.93663308,-29.1067 29.91578108,-29.1067 15.362036,0 23.043453,10.91538 23.043453,10.91538 l -5.659893,5.65936 c 0,0 -5.659894,-8.48971 -17.38356,-8.48971 -11.723666,0 -21.0219288,9.29827 -21.0219288,21.02193 0,11.72367 9.2982628,21.02193 21.0219288,21.02193 10.510965,0 15.362036,-5.65989 15.362036,-5.65989 v -8.89359 H 35.285339 v -8.08556 z" id="path267" style="stroke-width: 9.99999; stroke-dasharray: none"></path>
              <path fill="#150922" d="m 62.295795,310.27172 h 8.893852 v 56.59734 h -8.893852 z" id="path269" style="stroke-width: 9.99999; stroke-dasharray: none"></path>
              <path fill="#150922" d="m 79.232402,325.12193 c 0,-8.48971 6.872594,-15.36203 18.59626,-15.36203 11.319518,0 16.979148,7.27674 16.979148,7.27674 l -5.65963,5.65962 c 0,0 -3.63863,-4.85133 -11.319518,-4.85133 -6.064038,0 -9.702408,3.6389 -9.702408,7.277 0,12.93637 29.915786,4.85134 29.915786,25.873 0,9.70268 -7.27674,16.97915 -20.213378,16.97915 -13.744923,0 -20.213373,-8.89359 -20.213373,-8.89359 l 5.659894,-5.65989 c 0,0 4.446926,6.46845 14.553479,6.46845 7.276738,0 11.319518,-4.04278 11.319518,-8.89412 0,-12.93637 -29.915778,-4.8508 -29.915778,-25.873 z" id="path271" style="stroke-width: 9.99999; stroke-dasharray: none"></path>
              <path fill="#150922" d="m 178.02648,309.46317 c 16.97915,0 29.91578,12.93663 29.91578,29.10749 0,16.17086 -12.93636,29.10722 -29.91578,29.10722 -16.97941,0 -29.91605,-12.93663 -29.91605,-29.10749 0,-16.17085 12.9369,-29.10722 29.91605,-29.10722 z m 0,50.12942 c 11.72393,0 21.02193,-9.29826 21.02193,-21.02193 0,-11.72367 -9.29826,-21.02193 -21.02193,-21.02193 -11.72366,0 -21.02193,9.29826 -21.02193,21.02193 0,11.72367 9.298,21.02193 21.02193,21.02193 z" id="path273" style="stroke-width: 9.99999; stroke-dasharray: none"></path>
              <path fill="#150922" d="m 235.85141,310.56845 c 10.91538,0 19.00067,8.08503 19.00067,18.19185 0,10.10682 -8.08529,18.19238 -19.00067,18.19238 h -13.00124 v 20.21284 h -8.89385 v -56.59707 z m -13.00124,8.08503 v 20.21337 h 13.00124 c 5.65989,0 10.10682,-4.44692 10.10682,-10.10681 0,-5.65963 -4.44693,-10.10682 -10.10682,-10.10682 h -13.00124 z" id="path275" style="stroke-width: 9.99999; stroke-dasharray: none"></path>
              <path fill="#150922" d="m 258.87147,325.12193 c 0,-8.48971 6.87286,-15.36203 18.59626,-15.36203 11.31952,0 16.97915,7.27674 16.97915,7.27674 l -5.65963,5.65962 c 0,0 -3.63864,-4.85133 -11.31952,-4.85133 -6.06404,0 -9.70241,3.6389 -9.70241,7.277 0,12.93637 29.91605,4.85134 29.91605,25.873 0,9.70268 -7.27674,16.97915 -20.21338,16.97915 -13.74492,0 -20.2131,-8.89359 -20.2131,-8.89359 l 5.65962,-5.65989 c 0,0 4.44693,6.46845 14.55348,6.46845 7.27674,0 11.31952,-4.04278 11.31952,-8.89412 -2.6e-4,-12.93637 -29.91604,-4.8508 -29.91604,-25.873 z" id="path277" style="stroke-width: 1; stroke-dasharray: none"></path>
            </g> </svg> </div>
        <div style="
      display: flex;
      flex-direction: column;
      font-family: Arial, Helvetica, sans-serif;
      margin-left: 15px;
      margin-top: -2px;
    ">
          <div style="margin: 0; font-size: 14px"> <span style="color: #7357f9; font-weight: 600">Nils Nolde</span>
          </div>
          <div style="margin-top: 5px; font-size: 12px">Developer /
            Co-Founder</div>
          <div style="margin-top: 12px; font-size: 12px">
            <div style="
          margin-bottom: 4px;
          display: flex;
          justify-content: space-between;
        "> <span style="padding-right: 0px; font-weight: 600; color: #7357f9"> Website:  </span><a style="text-decoration: none; color: rgb(1, 1, 1)" href="https://gis-ops.com" class="moz-txt-link-freetext">https://gis-ops.com</a>
            </div>
            <div style="
          margin-bottom: 4px;
          display: flex;
          justify-content: space-between;
        "> <span style="padding-right: 0px; font-weight: 600; color: #7357f9">Email:  </span><a style="text-decoration: none; color: rgb(1, 1, 1)" href="mailto:nils@gis-ops.com" class="moz-txt-link-freetext">nils@gis-ops.com</a> </div>
            <div style="
          margin-bottom: 4px;
          display: flex;
          justify-content: space-between;
        "> <span style="padding-right: 0px; font-weight: 600; color: #7357f9"> Phone:  </span><a style="text-decoration: none; color: rgb(1, 1, 1)" href="tel +491785161595">+49 (0)178 5161 595 </a> </div>
            <div style="
          margin-bottom: 4px;
          display: flex;
          justify-content: space-between;
        "> <a style="
            padding-right: 0px;
            font-weight: 100;
            color: #7357f9;
            text-decoration: none;
          " href="https://valhalla.openstreetmap.de/directions?profile=bicycle&wps=13.2618285%2C52.4299717">Mühlenstraße
                8 a, 14167 Berlin </a> </div>
          </div>
          <div style="display: flex; margin-top: 3px; gap: 6px; justify-content: start">
            <div> <a href="https://github.com/nilsnolde" style="display: inline-block; border-radius: 3px"><img src="https://s3.eu-central-1.amazonaws.com/mysigmail/icons/new/github.png" alt="social-icon-github" style="
              display: table-cell;
              vertical-align: middle;
              border-radius: 3px;
              background-color: #7357f9;
            " width="20" height="20"/></a> </div>
            <div> <a href="https://www.linkedin.com/in/nils-nolde-geophox/" style="display: inline-block; border-radius: 3px"><img src="https://s3.eu-central-1.amazonaws.com/mysigmail/icons/new/linkedin.png" alt="social-icon-linkedin" style="
              display: table-cell;
              vertical-align: middle;
              border-radius: 3px;
              background-color: #7357f9;
            " width="20" height="20"/></a> </div>
            <div> <a href="mailto:nils@gis-ops.com" style="
            display: inline-block;
            border-radius: 3px;
            background-color: #7357f9;
          "><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-mail" width="16" height="16" viewBox="0 0 24 24" stroke-width="2" stroke="white" fill="none" stroke-linecap="round" stroke-linejoin="round" style="margin: 2px">
                  <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
                  <rect x="3" y="5" width="18" height="14" rx="2"></rect>
                  <polyline points="3 7 12 13 21 7"></polyline></svg></a>
            </div>
            <div> <a href="https://twitter.com/gis_ops" style="
            display: inline-block;
            border-radius: 3px;
            background-color: #7357f9;
          "><img src="https://www.iconsdb.com/icons/preview/white/twitter-xxl.png" alt="social-icon-github" style="vertical-align: middle; border-radius: 3px; margin: 3px" width="14" height="14"/></a> </div>
          </div>
        </div>
      </div>
    </div>
  

</body></html>