[GraphHopper] turn restrictions
Peter
graphhopper at gmx.de
Thu Aug 21 16:17:46 UTC 2014
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?
Regarding u-turn: What route would you expect? I get 0-1-2-1-6 if I
reduce the u-turn cost a bit.
Regards,
Peter.
On 21.08.2014 12:51, Bruno Carle wrote:
> Hi Peter,
> here is the unit test.
> Regards
> Bruno
>
>
> On Wed, Aug 20, 2014 at 7:49 PM, Peter <graphhopper at gmx.de
> <mailto:graphhopper at gmx.de>> wrote:
>
> Hi Bruno,
>
> 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.
>
> > When do you plan to merge turn restrictions into master? Can I
> help in some way?
>
> 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.
>
> Regards,
> Peter.
>
>
> On 19.08.2014 18:39, Bruno Carle wrote:
>> Hi,
>>
>> FYI
>> With TraversalMode.NODE_BASED it finds a route ignoring turn
>> restrictions (as expected)
>> With TraversalMode.EDGE_BASED_1DIR it fails to find any route.
>> With TraversalMode.EDGE_BASED_2DIR test works fine
>> With TraversalMode.EDGE_BASED_EDGE_BASED_2DIR_UTURN it finds an
>> invalid route (see http://imgur.com/IEvDObX)
>>
>> Regards
>> Bruno
>>
>>
>> On Tue, Aug 19, 2014 at 9:37 AM, Bruno Carle
>> <bruno.carle at gmail.com <mailto:bruno.carle at gmail.com>> wrote:
>>
>> Thanks Peter,
>> I am now using the turn_costs branch, my test is still not
>> working, but I will continue to look at it today
>> Regards
>> Bruno
>>
>>
>> On Mon, Aug 18, 2014 at 6:22 PM, Peter <graphhopper at gmx.de
>> <mailto:graphhopper at gmx.de>> wrote:
>>
>> Bruno,
>>
>> 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:
>>
>> new CarFlagEncoder(5,5,1) // enabled for restrictions only
>> new CarFlagEncoder(5,5,3) // enabled for turn costs also
>> (this works in unit tests but turn costs is currently
>> unused for OSM data)
>>
>> or from config file the string "car|turnCosts=true" can
>> be used or via new EncodingManager("car|turnCosts=true")
>>
>> see for more details regarding TraversalMode.EDGE_BASED_*
>> and related docs in e.g. EdgeBasedRoutingAlgorithmTest
>>
>> 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.
>>
>> Regards,
>> Peter.
>>
>>> Hi Peter,
>>> 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.
>>> 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?
>>>
>>> Here is my test, the turn restriction being tested
>>> should prevent us from going from Blanicka into Urugayska.
>>>
>>>
>>> String osmFile= "../../maps/OLD/prague-latest.osm.pbf";
>>>
>>>
>>> GraphHopper graphHopper=new
>>> GraphHopper().setInMemory(true)
>>> .setGraphHopperLocation("/tmp/ghLoc")
>>> .setOSMFile(osmFile)
>>> .disableCHShortcuts()
>>> .setEncodingManager(new
>>> EncodingManager("car",4,20));
>>>
>>> graphHopper.importOrLoad();
>>>
>>>
>>> GHRequest ghRequest=new GHRequest(new
>>> GHPoint(50.07483120416, 14.4390392303),new
>>> GHPoint(50.07333, 14.43869));
>>>
>>> GHResponse ghResponse=graphHopper.route(ghRequest);
>>> System.err.println(ghResponse.getPoints());
>>>
>>>
>>>
>>> route returned :
>>> http://imgur.com/QWLgoOL
>>>
>>>
>>> Route expected goes around Namesti Miru square:
>>> http://imgur.com/MftaocZ
>>>
>>> Thanks,
>>> Bruno
>>>
>>>
>>> _______________________________________________
>>> GraphHopper mailing list
>>> GraphHopper at openstreetmap.org <mailto:GraphHopper at openstreetmap.org>
>>> https://lists.openstreetmap.org/listinfo/graphhopper
>>
>>
>> _______________________________________________
>> GraphHopper mailing list
>> GraphHopper at openstreetmap.org
>> <mailto:GraphHopper at openstreetmap.org>
>> https://lists.openstreetmap.org/listinfo/graphhopper
>>
>>
>>
>>
>>
>> _______________________________________________
>> GraphHopper mailing list
>> GraphHopper at openstreetmap.org <mailto:GraphHopper at openstreetmap.org>
>> https://lists.openstreetmap.org/listinfo/graphhopper
>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org <mailto:GraphHopper at openstreetmap.org>
> https://lists.openstreetmap.org/listinfo/graphhopper
>
>
>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/graphhopper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20140821/37683b1f/attachment.html>
More information about the GraphHopper
mailing list