<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Complex p-turns are not covered by dir1
      so this is logically. In real life it will often still find a
      (suboptimal) path which still does not violate turn restructions,
      I think. Do you have a link to this route in graphhopper maps?<br>
      <br>
      Regarding u-turn<big>: </big>What route would you expect? I get
      0-1-2-1-6 if I reduce the u-turn cost a bit.<br>
      <br>
      Regards,<br>
      Peter.<br>
      <br>
      On 21.08.2014 12:51, Bruno Carle wrote:<br>
    </div>
    <blockquote
cite="mid:CANsAejUhKZEgwi-kzKZ62AZYgz_QgWjfjqDst7Mi-ndO9Tuxdw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>Hi Peter,<br>
            </div>
            here is the unit test.<br>
          </div>
          Regards<br>
        </div>
        Bruno<br>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Wed, Aug 20, 2014 at 7:49 PM, Peter
          <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:graphhopper@gmx.de" target="_blank">graphhopper@gmx.de</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>Hi Bruno,<br>
                <br>
                thanks, would you mind to create a unit test for this?
                So that I understand what you mean by 'invalid route'
                and why it fails to find a route for 1dir.<br>
                <br>
                > When do you plan to merge turn restrictions into
                master? Can I help in some way?<br>
                <br>
                We need more tests and real world usage to identify bugs
                and API usage. And I'm currently unsure if I merge it
                without CH-support. CH support would need some work as
                pointed out in the issue.<br>
                <br>
                Regards,<br>
                Peter.
                <div>
                  <div class="h5"><br>
                    <br>
                    On 19.08.2014 18:39, Bruno Carle wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">Hi,<br>
                      <br>
                      FYI<br>
                      With TraversalMode.NODE_BASED      it finds a
                      route ignoring turn restrictions (as expected)<br>
                      With TraversalMode.EDGE_BASED_1DIR it fails to
                      find any route.<br>
                      With TraversalMode.EDGE_BASED_2DIR test works fine
                      <br>
                      With
                      TraversalMode.EDGE_BASED_EDGE_BASED_2DIR_UTURN it
                      finds an invalid route (see <a
                        moz-do-not-send="true"
                        href="http://imgur.com/IEvDObX" target="_blank">http://imgur.com/IEvDObX</a>)<br>
                      <br>
                      Regards<br>
                      Bruno<br>
                    </div>
                    <div class="gmail_extra"><br>
                      <br>
                      <div class="gmail_quote"> On Tue, Aug 19, 2014 at
                        9:37 AM, Bruno Carle <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:bruno.carle@gmail.com"
                            target="_blank">bruno.carle@gmail.com</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div dir="ltr">
                            <div>
                              <div>Thanks Peter,<br>
                              </div>
                              I am now using the turn_costs branch, my
                              test is still not working, but I will
                              continue to look at it today<br>
                            </div>
                            Regards<span><font color="#888888"><br>
                                Bruno<br>
                              </font></span></div>
                          <div>
                            <div>
                              <div class="gmail_extra"><br>
                                <br>
                                <div class="gmail_quote">On Mon, Aug 18,
                                  2014 at 6:22 PM, Peter <span
                                    dir="ltr"><<a
                                      moz-do-not-send="true"
                                      href="mailto:graphhopper@gmx.de"
                                      target="_blank">graphhopper@gmx.de</a>></span>
                                  wrote:<br>
                                  <blockquote class="gmail_quote"
                                    style="margin:0 0 0
                                    .8ex;border-left:1px #ccc
                                    solid;padding-left:1ex">
                                    <div bgcolor="#FFFFFF"
                                      text="#000000">
                                      <div>Bruno,<br>
                                        <br>
                                        please see the turn_costs branch
                                        where the turn cost
                                        configuration has moved into the
                                        flagencoder. The API is still
                                        under development and the branch
                                        is not yet merged into master:<br>
                                        <br>
                                        new CarFlagEncoder(5,5,1) //
                                        enabled for restrictions only<br>
                                        new CarFlagEncoder(5,5,3) //
                                        enabled for turn costs also
                                        (this works in unit tests but
                                        turn costs is currently unused
                                        for OSM data)<br>
                                        <br>
                                        or from config file the string <big>"<small>car</small></big>|turnCosts=true<big>"</big>
                                        can be used or via new
                                        EncodingManager("car|turnCosts=true")<br>
                                        <br>
                                        see for more details regarding
                                        TraversalMode.EDGE_BASED_* and
                                        related docs in e.g.
                                        EdgeBasedRoutingAlgorithmTest<br>
                                        <br>
                                        As stated in the docs
                                        EDGE_BASED_1DIR should be as
                                        fast as the default node based
                                        traversal but could very rarely
                                        produce some unnecessary detours
                                        when turn restrictions are
                                        involved. Use EDGE_BASED_2DIR if
                                        you need the most precise routes
                                        but this is roughly 2 times
                                        slower, where
                                        EDGE_BASED_2DIR_UTURN also
                                        considers u-turns and is a lot
                                        slower, but I'm not sure if this
                                        is necessary at all in practise.<br>
                                        <br>
                                        Regards,<br>
                                        Peter.<br>
                                        <br>
                                      </div>
                                      <blockquote type="cite">
                                        <div>
                                          <div>
                                            <div dir="ltr">Hi Peter,<br>
                                              I am trying to get the
                                              turn restrictions working.
                                              But i can not get it to
                                              route accordingly.
                                              Actually I can not find
                                              out how to enable it.<br>
                                              Also I saw that
                                              TurnCostStorage.getTurnCost()
                                              is never referenced,
                                              except in some in
                                              commented code in
                                              GraphhopperStorage...
                                              maybe there is no
                                              Weighting class
                                              implemented that takes
                                              into account the turn
                                              restrictions yet? <br>
                                              <br>
                                              Here is my test, the turn
                                              restriction being tested
                                              should prevent us from
                                              going from Blanicka into
                                              Urugayska.<br>
                                              <br>
                                                  <br>
                                                  String osmFile=
                                              "../../maps/OLD/prague-latest.osm.pbf";<br>
                                                  <br>
                                                  <br>
                                                  GraphHopper
                                              graphHopper=new
                                              GraphHopper().setInMemory(true)<br>
                                                             
                                              .setGraphHopperLocation("/tmp/ghLoc")<br>
                                                             
                                              .setOSMFile(osmFile)<br>
                                                             
                                              .disableCHShortcuts()<br>
                                                             
                                              .setEncodingManager(new
                                              EncodingManager("car",4,20));<br>
                                                  <br>
                                                 
                                              graphHopper.importOrLoad();<br>
                                                  <br>
                                                  <br>
                                                  GHRequest
                                              ghRequest=new
                                              GHRequest(new
                                              GHPoint(50.07483120416,
                                              14.4390392303),new
                                              GHPoint(50.07333,
                                              14.43869));<br>
                                              <br>
                                                  GHResponse
                                              ghResponse=graphHopper.route(ghRequest);<br>
                                                 
                                              System.err.println(ghResponse.getPoints());<br>
                                              <br>
                                              <br>
                                              <br>
                                              route returned :<br>
                                              <a moz-do-not-send="true"
href="http://imgur.com/QWLgoOL" target="_blank">http://imgur.com/QWLgoOL</a><br>
                                              <br>
                                              <br>
                                              Route expected goes around
                                              Namesti Miru square:<br>
                                              <a moz-do-not-send="true"
href="http://imgur.com/MftaocZ" target="_blank">http://imgur.com/MftaocZ</a><br>
                                              <br>
                                              Thanks,<br>
                                              Bruno<br>
                                            </div>
                                            <br>
                                            <fieldset></fieldset>
                                            <br>
                                          </div>
                                        </div>
                                        <div>
                                          <pre>_______________________________________________
GraphHopper mailing list
<a moz-do-not-send="true" href="mailto:GraphHopper@openstreetmap.org" target="_blank">GraphHopper@openstreetmap.org</a>
<a moz-do-not-send="true" href="https://lists.openstreetmap.org/listinfo/graphhopper" target="_blank">https://lists.openstreetmap.org/listinfo/graphhopper</a>
</pre>
                                        </div>
                                      </blockquote>
                                      <br>
                                    </div>
                                    <br>
_______________________________________________<br>
                                    GraphHopper mailing list<br>
                                    <a moz-do-not-send="true"
                                      href="mailto:GraphHopper@openstreetmap.org"
                                      target="_blank">GraphHopper@openstreetmap.org</a><br>
                                    <a moz-do-not-send="true"
                                      href="https://lists.openstreetmap.org/listinfo/graphhopper"
                                      target="_blank">https://lists.openstreetmap.org/listinfo/graphhopper</a><br>
                                    <br>
                                  </blockquote>
                                </div>
                                <br>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
GraphHopper mailing list
<a moz-do-not-send="true" href="mailto:GraphHopper@openstreetmap.org" target="_blank">GraphHopper@openstreetmap.org</a>
<a moz-do-not-send="true" href="https://lists.openstreetmap.org/listinfo/graphhopper" target="_blank">https://lists.openstreetmap.org/listinfo/graphhopper</a>
</pre>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            GraphHopper mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a><br>
            <a moz-do-not-send="true"
              href="https://lists.openstreetmap.org/listinfo/graphhopper"
              target="_blank">https://lists.openstreetmap.org/listinfo/graphhopper</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
GraphHopper mailing list
<a class="moz-txt-link-abbreviated" href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/graphhopper">https://lists.openstreetmap.org/listinfo/graphhopper</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>