- Notifications
You must be signed in to change notification settings - Fork3.8k
Area Routing#7161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
MarcelloPerathoner wants to merge1 commit intoProject-OSRM:masterChoose a base branch fromMarcelloPerathoner:area-routing
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
+4,387 −713
Open
Area Routing#7161
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
10 changes: 5 additions & 5 deletions.github/workflows/osrm-backend.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletionsCHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
29 changes: 16 additions & 13 deletionsCONTRIBUTING.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletionsDoxyfile.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletionsREADME.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletionscucumber.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| module.exports={ | ||
| default:'--strict --tags ~@stress --tags ~@todo --tags ~@mld --require features/support --require features/step_definitions', | ||
| ch:'--strict --tags ~@stress --tags ~@todo --tags ~@mld --require features/support --require features/step_definitions', | ||
| todo:'--strict --tags @todo --require features/support --require features/step_definitions', | ||
| all:'--strict --require features/support --require features/step_definitions', | ||
| mld:'--strict --tags ~@stress --tags ~@todo --tags ~@ch --require features/support --require features/step_definitions' | ||
| }; |
109 changes: 109 additions & 0 deletionsdocs/areas.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| #How to route inside pedestrian areas {#pedestrian_areas} | ||
| How to route inside pedestrian areas, or over the interior of an area where you can | ||
| travel freely in all directions. | ||
| %OSRM can create routes crossing the interior of an area by generating virtual ways | ||
| between every pair of entry points to the area. This process is called@em meshing. The | ||
| generated ways follow lines of sight, avoid obstacles, and use existing nodes. An entry | ||
| point is where another way connects to the perimeter of the area. | ||
| This feature is still EXPERIMENTAL. | ||
| ##Configuration | ||
| To opt-in to this feature, you must declare an algorithm to be used for area meshing. | ||
| Find your LUA profile's@ref setup function and insert this line: | ||
| ```lua | ||
| functionsetup() | ||
| ... | ||
| area_manager:init('visgraph+dijkstra') | ||
| ... | ||
| end | ||
| ``` | ||
| Note: Only the`visgraph+dijkstra` algorithm is available at present. | ||
| All areas to be meshed must be registered with the@ref AreaManager. In OpenStreetMap <a | ||
| href="https://wiki.openstreetmap.org/wiki/Tag:highway%3Dpedestrian#Squares_and_plazas"> | ||
| areas are mapped</a> either as a closed way or as a multipolygon relation. Both flavours | ||
| must be configured separately. | ||
| ###Meshing closed ways | ||
| To mesh a closed way you must register it in your@ref process_way function. Insert | ||
| following lines into your existing`process_way` function, immediately after the "quick | ||
| initial test": | ||
| ```lua | ||
| functionprocess_way(profile,way,result,relations) | ||
| ... | ||
| ifway:has_tag('highway','pedestrian')andway:has_true_tag('area')then | ||
| -- register the way | ||
| area_manager:way(way) | ||
| return | ||
| end | ||
| ... | ||
| end | ||
| ``` | ||
| (Note that open ways cannot be meshed and will be ignored.) | ||
| ###Meshing multipolygon relations | ||
| To mesh a multipolygon relation you must register it in the@ref process_relation | ||
| function. The`process_relation` function is a newly introduced function that is called | ||
| for every relation in the input file. You'll have to create the function like this: | ||
| ```lua | ||
| functionprocess_relation(profile,relation,relations) | ||
| ifrelation:has_tag('type','multipolygon')andrelation:has_tag('highway','pedestrian')then | ||
| -- register the relation | ||
| area_manager:relation(relation) | ||
| end | ||
| end | ||
| ``` | ||
| And you must also return the`process_relation` function at the end of your profile: | ||
| ```lua | ||
| return { | ||
| setup=setup, | ||
| process_way=process_way, | ||
| process_node=process_node, | ||
| process_relation=process_relation,-- << add this line | ||
| ... | ||
| } | ||
| ``` | ||
| At this point you have a working basic configuration. Remember that you must run | ||
| `osrm-extract` before your changes become effective. | ||
| ###Processing the generated ways | ||
| While not necessary, you may want to apply further processing to the@em generated ways. | ||
| The generated ways are passed to the@ref process_way function in the usual fashion. | ||
| They have the same tags as the original way or relation, except: | ||
| - the`area` tag is removed on ways, | ||
| - the`type` tag is removed on relations, | ||
| - an`osrm:virtual=yes` tag is added. | ||
| You can pick generated ways like this: | ||
| ```lua | ||
| functionprocess_way(profile,way,result,relations) | ||
| ... | ||
| ifway:has_key('osrm:virtual')then | ||
| -- do something with the way here | ||
| end | ||
| ... | ||
| end | ||
| ``` | ||
| @sa AreaManager | ||
| <br> A complete example profile is found in the file:[profiles/foot_area.lua](../profiles/foot_area.lua). | ||
| <br>https://wiki.openstreetmap.org/wiki/Relation:multipolygon | ||
| <br>https://wiki.openstreetmap.org/wiki/Key:area | ||
| <br>https://wiki.openstreetmap.org/wiki/Tag:highway%3Dpedestrian#Squares_and_plazas |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.