Skip to content

Initial implementation of turn restriction support - #55

Closed
kschrab wants to merge 17 commits into
graphhopper:masterfrom
kschrab:master
Closed

kschrab wants to merge 17 commits into
graphhopper:masterfrom
kschrab:master

Conversation

@kschrab

@kschrab kschrab commented May 28, 2013

Copy link
Copy Markdown
Contributor

Here's my attempt to let graphhopper support turn costs/restrictions (turn cost = time a turn would cost, turn restriction = infinite turn cost, turn is prohibited).
At the moment only simple turn restrictions will be imported. You can enable turn restriction support by GraphHopper.enableTurnCosts() and you need to re-import your osm files. If you want to use turn restrictions together with contraction hierarchies you must decide on preparation time if and which kind of turn cost calculation you want to use. Once the graph has been prepared for contraction hierarchies you cannot switch to another turn cost calculation. This behavior should be familiar since you need to decide on preparation time as well which EdgePropertyEncoder and which WeightCalculation you want to use.

Turn costs are stored in a separate storage. For each turn cost entry the edge id from which the turn goes, the edge id to which the turn goes and the costs of the specific turn is stored. The costs are encoded by TurnCostEncoder, which allows to store separate costs for car and bike in one integer value. When searching for shortest routes only restrictions will be considered, when searching for fastest routes restrictions AND turn costs will be considered. For pedestrians no turn costs or restrictions will be considered.

Feel to try it out. I will add some more details to my implementation when I have a bit more time, maybe tomorrow.

kschrab added 17 commits May 1, 2013 14:25
Conflicts:
	core/src/main/java/com/graphhopper/reader/OSMReaderHelperDoubleParse.java
Conflicts:
	core/src/main/java/com/graphhopper/GHRequest.java
	core/src/main/java/com/graphhopper/GraphHopper.java
	core/src/main/java/com/graphhopper/reader/OSMReader.java
	core/src/main/java/com/graphhopper/reader/OSMReaderHelper.java
	core/src/main/java/com/graphhopper/routing/AbstractRoutingAlgorithm.java
	core/src/main/java/com/graphhopper/routing/ch/PrepareContractionHierarchies.java
	core/src/main/java/com/graphhopper/routing/util/VehicleEncoder.java
	core/src/test/java/com/graphhopper/routing/AbstractRoutingAlgorithmTester.java
a turn restriction is around the meeting point.
Conflicts:
	core/src/main/java/com/graphhopper/reader/OSMReader.java
	core/src/main/java/com/graphhopper/routing/ch/PrepareContractionHierarchies.java
Conflicts:
	core/src/main/java/com/graphhopper/reader/OSMReaderHelper.java
	core/src/main/java/com/graphhopper/reader/OSMReaderHelperDoubleParse.java
	core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java
Conflicts:
	core/src/main/java/com/graphhopper/GraphHopper.java
	core/src/main/java/com/graphhopper/reader/OSMReader.java
	core/src/main/java/com/graphhopper/reader/OSMReaderHelper.java
	core/src/main/java/com/graphhopper/routing/AbstractRoutingAlgorithm.java
	core/src/test/java/com/graphhopper/routing/DijkstraOneToManyTest.java
@ghost ghost assigned karussell May 28, 2013
@karussell

Copy link
Copy Markdown
Member

Thanks a lot!

@karussell

Copy link
Copy Markdown
Member

@kschrab

kschrab commented May 29, 2013

Copy link
Copy Markdown
Contributor Author

Hm ok, I will try to find out what's wrong.

I've create a separate branch

Good choice.

RoutingAlgorithmIntegrationTest.testMonacoWithTurn ... which should fail IMO.

There are no relations of type.restriction in the osm file. The import currently only add turn restrictions for this kind of relations.

Will turn restrictions work for CH too?

Yes, this comment is a bit old. As I wrote above you need to decide before preparation if you want to consider turn restrictions or not, you can not change it later when requesting routes.

@karussell

Copy link
Copy Markdown
Member

There are no relations of type.restriction in the osm file. The import currently only add turn
restrictions for this kind of relations.

Ah, ok. We'll need a file with this relations to avoid testing stuff from real world files every here and then. I'll see if I have time this evening

Yes, this comment is a bit old.

Ok

@kschrab

kschrab commented May 29, 2013

Copy link
Copy Markdown
Contributor Author

this query should be fixed

There are two different errors in the resulting route:

  • the roundabout at the end of the route: This has nothing to do with turn restrictions. According to the osm file the edge which is traversed the wrong way has no tag oneway.yes. Maybe this should be fixed in OSM?
  • the left-turn "Carl-Schüller Straße"->"Karl-Marx-Straße" is restricted. When I do not use contraction hierarchies this turn restriction will be considered, but when using CH it's not. I try to find out whats wrong there.

@karussell

Copy link
Copy Markdown
Member

Maybe this should be fixed in OSM?

Ah, I didn't spotted the roundabout problem! I'll see if we can fix that even without a oneway=yes.

When I do not use contraction hierarchies this turn restriction will be considered

Hmmh, strange. Even without CH it didn't work for me (I'll try again this evening)

@kschrab

kschrab commented May 29, 2013

Copy link
Copy Markdown
Contributor Author

I'm not allowed to push changes to this branch. Would you mind to give me permission to push changes to this branch or should I fork the branch and do pull requests?

@karussell

Copy link
Copy Markdown
Member

Would you mind to give me permission to push changes to this branch

I gave you the permission. Please be careful as this is not limited to this branch only ;) !

@kschrab

kschrab commented May 29, 2013

Copy link
Copy Markdown
Contributor Author

Something seems to be buggy with turn restrictions under CH. When adding shortcuts due to preparation, turn cost entries have to be copied. For example: There's a turn restriction from edge 1 to edge 2 via node A. When the preparation algorithm detects a shortcut which ends at node A and skips edge 1 a new turn restriction entry has to be added, which restricts the turn from the shortcut to edge 2 via node A. This is already implemented but seems to have some bugs, maybe I mixed some ids. I will try to create a test case and fix it then.

nope, seems to be another issue.. :'(

PS: It totally sucks to debug such things with OSM data :D

@karussell

Copy link
Copy Markdown
Member

PS: It totally sucks to debug such things with OSM data :D

Do you know the MiniGraphUI in the tools project? CH debugging is a bit harder even there. But still you could enable 'debug' and you see how the algorithm behave and you can also print the internal node indices etc. You could also print the exploration step by step with the help of your debugger (but only if you ensure that the window of your IDE and the MiniGraphUI do not overlap)

@karussell

Copy link
Copy Markdown
Member

Please see the newly added test GraphStorageTurnCostTest:testTurnCost this gives me: something went wrong: next entry would be the same

@kschrab

kschrab commented May 29, 2013

Copy link
Copy Markdown
Contributor Author

Please see the newly added test GraphStorageTurnCostTest:testTurnCost this gives me: something went wrong: next entry would be the same

Can't find this, did you push it?

@kschrab

kschrab commented May 29, 2013

Copy link
Copy Markdown
Contributor Author

Alright, I pushed an initial version of the edge-based Dijkstra. Feel free to try it with your test.

@ghost ghost assigned kschrab May 30, 2013
@kschrab

kschrab commented Jun 10, 2013

Copy link
Copy Markdown
Contributor Author

I added edge-based versions of AStar and DijkstraBidirectionalRef. It seems we have to write edge based versions of all existing algorithms. With the classic algorithms we will never be able to get results like the right one in the following picture:

comparisson_classic_vs_edgebased (if you search for routes in HERE or TomTom with same start/end point you will get very similar results, Google does not know this left turn restriction)

Also your simple example showed that my previous attempt (using the classic algorithms together with node tables) does not work.

Unfortunately I'm not able to put much time into this. So maybe you can support me by implementing an edge-based versions of DijkstraOneToMany, which may be the most important one to get CH+turn restrictions working correctly. And maybe you find a way to speed up the whole thing (performance is quite poor compared to the existing algorithms). Of course I'll answer all of your questions asap.

@karussell

Copy link
Copy Markdown
Member

I added edge-based versions of AStar and DijkstraBidirectionalRef.

Thanks!

Unfortunately I'm not able to put much time into this.

with me it is the same. I would like to push out 0.1 before I'll add more bigger features like this :/

The problem with turn restrictions is that they slow down everything, the preparation time will also suffer a lot and the algorithm will get more complex with it. So we'll have to take a lot of care when we add this.

@karussell

Copy link
Copy Markdown
Member

since we need to distinguish between backward and forward direction we only can accept 2^31 edges

this is not a real limitation as even without turn restriction we do not support negative ids.

the edge based version of astar needs more time because we have much more edges to traverse

and can we somehow improve this? I mean, like in the paper, they say such turn restrictions are rather rare and they could implement some 'dynamic' behaviour. e.g. pushing such restricted nodes with all its associated edges + weights as only one entry to the queue.

@karussell karussell mentioned this pull request Aug 5, 2013
@kschrab

kschrab commented Aug 5, 2013

Copy link
Copy Markdown
Contributor Author

Well, I finally merged the master into pr/55. The build is green, but due to the API changes in the import and encoding mechanisms, I'm not sure if everything works as expected.
However, I try to keep pr/55 up-to-date, but I won't be able to continue my work in the near future.

and can we somehow improve this? I mean, like in the paper, they say such turn restrictions are rather rare and they could implement some 'dynamic' behaviour.

Yes, we totally could do that. However, if we want to include turn costs as well to make routes more realistic, this approach would not give any advantages, since each junction will be in relation with turn costs.

I'm currently writing my master thesis and I need a routing algorithm which supports turn restrictions. The current state is sufficient for my needs; performance is not that important. Therefore, I won't go deeper into this topic because I have to concentrate on other things. However, I will try to answer incoming questions. So, everyone is invited to continue my work!

Short summary of the current state of this issue:

  • There's a turn cost table, which holds turn cost entries for turns. Currently, during the import process, relations of type 'restriction' will cause turn cost entries with infinite costs.
  • Every existing routing algorithm (including CH) is able to use those turn cost entries. However, those algorithms are node-based, i.e. no P-turns are possible and the resulting route might not be the shortest one. Using turn cost tables in combination with such node-based routing algorithms is generally not going to work, but in huge networks the error rate is quiet low.
  • A correct approach would be to use edge-based algorithms. I already implemented edge-based versions of Dijkstra, AStar, and DijkstraBidir. Those ones are slower and need more memory than the node-based algorithms, since edges will be traversed in both directions, which results in a larger SPT.

PS: How do I add my last merge commit to this pull request?

@karussell

Copy link
Copy Markdown
Member

However, I try to keep pr/55 up-to-date, but I won't be able to continue my work in the near future.
Therefore, I won't go deeper into this topic because I have to concentrate on other things.

Ok, no problem.

Short summary of the current state of this issue

I really welcome the work you did when merging and the work you've already done! I would like to merge it sooner than later. I'll have a look into this! Probably we should only integrate edge based algos to keep node-based algorithms simpler? Or which algorithm classes are you using and trying out for your work?

PS: How do I add my last merge commit to this pull request?

Hmmh, strange. Normally this appears automatically if you push the changes. Did you push to khuebner/master?

BTW: Are you sure you updated your master before? As the merge pr/55 does not look to be aligned with the latest master. But nevermind, if you don't have the time then I'll try to get it up to date.

BTW: Also are you willing to contribute your work under Apache License and with the same header snippet?

@tfnico

tfnico commented Dec 3, 2013

Copy link
Copy Markdown

Is there anything we can do to help getting this feature in, or has this branch been abandoned?

@karussell

Copy link
Copy Markdown
Member

It is on the road map to integrate this but other things are still more important.

The first step could be to make it compile against master. Afterwards additional tests needs to be added as well as making contraction hierarchies working.

@tfnico

tfnico commented Dec 17, 2013

Copy link
Copy Markdown

@karussell I spent a day or so merging the latest changes from master back to the work @khuebner has done here:

tfnico/graphhopper@411c983

Now, apart from being a Java dev and somewhat experienced with merging, I have very little idea of what I was doing there in regards to business logic. Perhaps either of you could have a look and see what you think.

@karussell

Copy link
Copy Markdown
Member

Thanks for this work! Wow, this is a massive edit :)

I think @khuebner was also in the process of doing this. Maybe he can have a look and decide wether it is worth to merge or too risky and just grab the important pieces (algorithm, relation parsing and graphstorage changes) and tests.

What I don't like is that turn costs are so invasive like with GraphStorageTurnCosts extends GraphHopperStorage - how do we want to support LevelGraphStorage? I don't have an idea for this but this makes everything very complex. Hmmh. I would prefer an approach where the user can enable and disable it. E.g. by default it is disabled and we could merge this and then iterate until this is polished. But again, I don't have such an idea for such a simple solution at the moment. Maybe you have one? A turn restriction "mixin" for the storage part would be nice ;) ... hmmh maybe we would then also need a "mixin" for the shortcuts (LevelGraphStorage) ;)

Another major problem is that we have QueryGraph which creates virtual nodes and edges per request, where turn restrictions could be necessary too :(

TODO (tfnico): Not sure how to test varying speeds any more, used to be embedded in the encoder flags

setting flags is done ala graph.edge(5, 8).setDistance(distance).setFlags(flags)

@tfnico

tfnico commented Dec 17, 2013

Copy link
Copy Markdown

What I don't like is that turn costs are so invasive like with GraphStorageTurnCosts extends GraphHopperStorage - how do we want to support LevelGraphStorage? I don't have an idea for this but this makes everything very complex. Hmmh. I would prefer an approach where the user can enable and disable it. E.g. by default it is disabled and we could merge this and then iterate until this is polished. But again, I don't have such an idea for such a simple solution at the moment. Maybe you have one? A turn restriction "mixin" for the storage part would be nice ;) ... hmmh maybe we would then also need a "mixin" for the shortcuts (LevelGraphStorage) ;)

@karussell I'm afraid those things are still a bit over my head, and I lack the domain understanding here to do anything useful beyond pure refactorings just to make the code look nicer, which is very hard with poor test coverage and not-working code.

I'll try running some tests and fire it up tomorrow to see whether it's functional at all.

@karussell

Copy link
Copy Markdown
Member

I'll try running some tests and fire it up tomorrow to see whether it's functional at all.

That would be good. Are the other tests passing?

@tfnico

tfnico commented Dec 17, 2013

Copy link
Copy Markdown

That would be good. Are the other tests passing?

Don't know yet :)

@tfnico

tfnico commented Dec 18, 2013

Copy link
Copy Markdown

I fixed a couple of obvious errors in tfnico/graphhopper@544410d

Here are the current test results:

Failed tests:
  GraphHopperTest.testFootAndCar:111 expected:<2> but was:<3>
  GraphHopperTest.testLoadOSM:62 null
  OSMReaderTurnCostsTest.testImportTurnRestrictions:54 expected:<1.07374182E9> but was:<0.0>
  AStarBidirectionTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_turnRestrictions:208 expected:<{0, 1, 5, 3}> but was:<{0, 1, 5, 8, 3}>
  AStarBidirectionTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_ignoreTurnRestrictions:219 distance:18000.0, edges:4 expected:<5760> but was:<18000>
  AStarBidirectionTest>AbstractRoutingAlgorithmTester.testCalcIfEmptyWay:270 distance:24.0, edges:6 expected:<0> but was:<7>
  AStarBidirectionTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_FootPath_noTurnRestrictions:228 distance:16000.0, edges:4 expected:<11520> but was:<16000>
  AStarTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_turnRestrictions:208 expected:<{0, 1, 5, 3}> but was:<{0, 1, 5, 8, 3}>
  AStarTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_ignoreTurnRestrictions:219 distance:18000.0, edges:4 expected:<5760> but was:<2147483647>
  AStarTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_FootPath_noTurnRestrictions:228 distance:16000.0, edges:4 expected:<11520> but was:<2147483647>
  DijkstraBidirectionCHTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_turnRestrictions:208 expected:<{0, 1, 5, 3}> but was:<{0, 1, 5, 8, 3}>
  DijkstraBidirectionCHTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_FootPath_noTurnRestrictions:228 distance:16000.0, edges:4 expected:<11520> but was:<16000>
  DijkstraBidirectionRefTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_turnRestrictions:208 expected:<{0, 1, 5, 3}> but was:<{0, 1, 5, 8, 3}>
  DijkstraBidirectionRefTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_ignoreTurnRestrictions:219 distance:18000.0, edges:4 expected:<5760> but was:<18000>
  DijkstraBidirectionRefTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_FootPath_noTurnRestrictions:228 distance:16000.0, edges:4 expected:<11520> but was:<16000>
  DijkstraBidirectionTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_turnRestrictions:208 expected:<{0, 1, 5, 3}> but was:<{0, 1, 5, 8, 3}>
  DijkstraBidirectionTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_ignoreTurnRestrictions:219 distance:18000.0, edges:4 expected:<5760> but was:<18000>
  DijkstraBidirectionTest>AbstractRoutingAlgorithmTester.testCalcIfEmptyWay:270 distance:24.0, edges:6 expected:<0> but was:<7>
  DijkstraBidirectionTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_FootPath_noTurnRestrictions:228 distance:16000.0, edges:4 expected:<11520> but was:<16000>
  DijkstraOneToManyTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_turnRestrictions:208 expected:<{0, 1, 5, 3}> but was:<{0, 1, 5, 8, 3}>
  DijkstraOneToManyTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_ignoreTurnRestrictions:219 distance:18000.0, edges:4 expected:<5760> but was:<2147483647>
  DijkstraOneToManyTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_FootPath_noTurnRestrictions:228 distance:16000.0, edges:4 expected:<11520> but was:<2147483647>
  DijkstraTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_turnRestrictions:208 expected:<{0, 1, 5, 3}> but was:<{0, 1, 5, 8, 3}>
  DijkstraTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_ignoreTurnRestrictions:219 distance:18000.0, edges:4 expected:<5760> but was:<2147483647>
  DijkstraTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_FootPath_noTurnRestrictions:228 distance:16000.0, edges:4 expected:<11520> but was:<2147483647>
  EdgeAStarTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_turnRestrictions:208 expected:<{0, 1, 5, 3}> but was:<{0, 1, 5, 8, 3}>
  EdgeAStarTest>AbstractRoutingAlgorithmTester.testViaEdges_WithCoordinates:629 expected:<{9, 1, 2, 8}> but was:<{}>
  EdgeAStarTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_ignoreTurnRestrictions:219 distance:18000.0, edges:4 expected:<5760> but was:<2147483647>
  EdgeAStarTest>AbstractRoutingAlgorithmTester.testViaEdges_FromEqualsTo:620 expected:<{8, 9}> but was:<{}>
  EdgeAStarTest>AbstractRoutingAlgorithmTester.testViaEdges_SpecialCases:654 expected:<{6, 1, 2, 3, 5}> but was:<{}>
  EdgeAStarTest>AbstractRoutingAlgorithmTester.testViaEdges_BiGraph:605 distance:0.0, edges:0 expected:<{10, 7, 6, 8, 3, 9}> but was:<{}>
  EdgeAStarTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_FootPath_noTurnRestrictions:228 distance:16000.0, edges:4 expected:<11520> but was:<2147483647>
  EdgeDijkstraBidirectionRefTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_turnRestrictions:208 expected:<{0, 1, 5, 3}> but was:<{0, 1, 5, 8, 3}>
  EdgeDijkstraBidirectionRefTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_ignoreTurnRestrictions:219 distance:18000.0, edges:4 expected:<5760> but was:<18000>
  EdgeDijkstraBidirectionRefTest>AbstractRoutingAlgorithmTester.testViaEdges_FromEqualsTo:620 expected:<{8, 9}> but was:<{8, 9, 1, 4, 0, 8, 9}>
  EdgeDijkstraBidirectionRefTest>AbstractRoutingAlgorithmTester.testViaEdges_SpecialCases:659 expected:<{5, 6}> but was:<{5, 6, 3, 4, 0, 1, 2, 5, 6}>
  EdgeDijkstraBidirectionRefTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_FootPath_noTurnRestrictions:228 distance:16000.0, edges:4 expected:<11520> but was:<16000>
  EdgeDijkstraTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_turnRestrictions:208 expected:<{0, 1, 5, 3}> but was:<{0, 1, 5, 8, 3}>
  EdgeDijkstraTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_CarPath_ignoreTurnRestrictions:219 distance:18000.0, edges:4 expected:<5760> but was:<2147483647>
  EdgeDijkstraTest>AbstractRoutingAlgorithmTester.testCalcWithTurnRestrictions_FootPath_noTurnRestrictions:228 distance:16000.0, edges:4 expected:<11520> but was:<2147483647>
  DefaultTurnCostsCalcTest.turnCostCalc_shortestRoute_carEncoder:155 expected:<0.0> but was:<100.0>
Tests in error:
  GraphHopperTest.testPrepareOnly:238 IllegalArgument Encoder for car not foun...
  GraphHopperTest.testFootOnly:221 IllegalArgument Encoder for car not found.
  EdgeDijkstraTest>AbstractRoutingAlgorithmTester.testNoPathFound:278 NullPointer
Tests run: 752, Failures: 41, Errors: 3, Skipped: 0

@kschrab

kschrab commented Dec 18, 2013

Copy link
Copy Markdown
Contributor Author

Hey guys. I'm totally deep into merging the master into this branch, but I'm not able to continue before weekend. I'll take a look at what @tfnico has done so far, and I would prefer to take care of the edge-based algorithms by myself (i.e. all algorithms which extend AbstractEdgeBasedRoutingAlgorithm). For all the other stuff anyone is welcomed to help me resolving conflicts. Furthermore, I would like to remove any turn-restriction support out of the existing node-based routing algorithms, since it is just faulty to consider turn-restrictions in those classic algorithms.
I also agree to make turn-restriction support more component based instead of using inheritance, so that GraphHopperStorage and LevelGraphStorage can easily be extended to store turn-costs/restrictions. However, I also have no idea how to do this, but maybe I think about it after merging.

@kschrab

kschrab commented Dec 21, 2013

Copy link
Copy Markdown
Contributor Author

FYI: I merged the master into pr/55 (5 tests still fail)

@karussell

Copy link
Copy Markdown
Member

Thanks a lot! I'll have a look into it. One question: why could one disable the turn cost in GraphStorageTurnCosts?

I also agree to make turn-restriction support more component based instead of using inheritance

As there are no mixin the only possibility in Java would be to define an interface which can be called within GraphHopperStorage and is a composition of e.g. turn and shortcut support. But I'll have to sort this out after merge.

However, I also have no idea how to do this, but maybe I think about it after merging.

Yes, let us make turn restriction support for normal algos working first adding more test. Then we do turn stuff for CH, then making everything nice & fast.

@kschrab

kschrab commented Dec 22, 2013

Copy link
Copy Markdown
Contributor Author

I think it will be better to "rebuild" this whole thing from scratch instead of trying to merge this monster. We should do this step by step, for each step one pull request, which should make it a lot easier to review and merge:

I have done those things already and they also are part of this monster commit, but I would prefer to make tiny commits step by step onto the master. Further features, like CH, can be done later.

@karussell

Copy link
Copy Markdown
Member

For step 2 and 3 I think #132 is very handy which I integrate now, but go ahead as merging should be easy then.

@stephanosch

Copy link
Copy Markdown

Hello.
After this Initial implementation of turn restriction that you describe here (8 months ago), can now turn restrictions, like no right/left turn, no u turn, etc, be imported automatically from my osm data?
What step I must follow to succeed that?
To start Graphhopper I run the java command:
java -Dgraphhopper.config=config-example.properties -Dgraphhopper.osmreader.osm=myOSM.osm -jar jetty-runner-9.1.0.v20131115.jar --port 8989 graphhopper-web-0.2.war

Thanks

@kschrab

kschrab commented Feb 5, 2014

Copy link
Copy Markdown
Contributor Author

Hi,

this feature is still under development. We've splitted this pull request into smaller pieces: #133, #134, #135 , #158
The import of turn restrictions from OSM files should be already possible, however, routing does not consider turn restrictions yet. I still have to implement routing algorithms which are able to support turn restrictions. I'm very busy at the moment, but I try to commit the first prototype in around two weeks.

@stephanosch

Copy link
Copy Markdown

Hello,
Just a recommendation. No other routing engine supports way-way-way turn restriction (u turn), but only way-node-way (no left/right turn). It could be an advantage of Graphhopper to include this kind of restriction as well.
Thank you.
Stephanos

@graphhopper graphhopper deleted a comment from jitendra3109 Jun 20, 2017
karussell added a commit that referenced this pull request Apr 11, 2018
Use bash for map-matching.sh
dabiih pushed a commit to dabiih/graphhopper that referenced this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants