Skip to content

Commit e9d1058

Browse files
WIP. Mostly docs.
1 parent cffa127 commit e9d1058

16 files changed

+903
-415
lines changed

Doxyfile.in

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ QUIET = YES
1313

1414
INPUT = @CMAKE_CURRENT_SOURCE_DIR@
1515
USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_SOURCE_DIR@/README.md
16-
FILE_PATTERNS = *.h *.hpp *.c *.cc *.cpp *.md
16+
FILE_PATTERNS = *.h *.hpp *.c *.cc *.cpp *.md *.dox
1717
RECURSIVE = YES
1818

1919
EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/third_party \
2020
@CMAKE_CURRENT_SOURCE_DIR@/build \
2121
@CMAKE_CURRENT_SOURCE_DIR@/node_modules \
2222
@CMAKE_CURRENT_SOURCE_DIR@/unit_tests \
23-
@CMAKE_CURRENT_SOURCE_DIR@/benchmarks \
23+
@CMAKE_CURRENT_SOURCE_DIR@/benchmarks \
2424
@CMAKE_CURRENT_SOURCE_DIR@/features
2525

2626
SOURCE_BROWSER = YES
@@ -40,5 +40,4 @@ CALLER_GRAPH = YES
4040
DOT_IMAGE_FORMAT = svg
4141
INTERACTIVE_SVG = YES
4242
DOT_GRAPH_MAX_NODES = 500
43-
DOT_TRANSPARENT = YES
4443
DOT_MULTI_TARGETS = YES

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
2828

2929
- [Hosted documentation](http://project-osrm.org)
3030
- [osrm-routed HTTP API documentation](docs/http.md)
31-
- [libosrm API documentation](docs/libosrm.md)
3231

3332
## Contact
3433

docs/areas.md

+20-64
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
# Areas
1+
@page pedestrian_areas Pedestrian Areas
22

3-
This OSRM feature provides routing through areas. The area type is configurable.
3+
@sa AreaManager
44

5-
## Routing over pedestrian areas
5+
This OSRM feature provides routing through areas, where people are free to choose their
6+
path. The main motivation for this feature are areas tagged with `highway=pedestrian`,
7+
but any other area is configurable.
68

7-
Pedestrian areas in OSM are either closed ways or multipolygon relations. Currently OSRM
8-
routes along the perimeter of a closed way area. It does not route over multipolygon
9-
areas at all.
9+
Areas in OSM are either closed ways or multipolygon relations. Currently OSRM routes
10+
along the perimeter of a closed way area. It does not route over multipolygon areas at
11+
all.
1012

1113
This feature routes over the inside of the area. It does so by "meshing" the area, ie.
1214
by creating virtual ways between every two entry points of the area. These new ways
1315
follow lines of sight, they never go through obstacles in the area.
1416

15-
This feature is opt-in: To enable it you must define a `process_relation` function in
17+
This feature is opt-in: To enable it you must define a @ref process_relation function in
1618
your profile and return it like this:
1719

1820
```lua
@@ -27,8 +29,8 @@ return {
2729

2830
You must also keep multipolygon relations, so that you can use the name on the relation
2931
for turn directions. (Remember that the ways in the relation are untagged.) In your
30-
profile's setup function add or edit the `relation_types` sequence to include the type
31-
"multipolygon":
32+
profile's setup function add or edit the @ref relation_types sequence to include the
33+
type `multipolygon`:
3234

3335
```lua
3436
function setup()
@@ -45,16 +47,14 @@ end
4547

4648
### process_relation(profile, relation, relations)
4749

48-
The `process_relation` function is called for every relation in the input file. If you
49-
want a relation to be meshed, call `area_manager:relation(relation)`.
50+
The @ref process_relation function is called for every relation in the input file. If
51+
you want a relation to be meshed, you must call [area_manager:relation()](@ref AreaManager::relation()).
5052

51-
Example of a process_relation function:
53+
Example:
5254

5355
```lua
5456
function process_relation(profile, relation, relations)
55-
type = relation:get_value_by_key('type')
56-
highway = relation:get_value_by_key('highway')
57-
if type == 'multipolygon' and highway == 'pedestrian' then
57+
if relation:has_tag('type', 'multipolygon') and relation:has_tag('highway', 'pedestrian') then
5858
-- register the relation
5959
area_manager:relation(relation)
6060
end
@@ -63,20 +63,20 @@ end
6363

6464
### process_way(profile, way, result, relations)
6565

66-
The `process_way` function is called for every way in the input file. If you want a
67-
closed way to be meshed, call `area_manager:way(way)`. (Note that open ways cannot be
68-
meshed and will be ignored.)
66+
The @ref process_way function is called for every way in the input file. If you want a
67+
closed way to be meshed, call [area_manager:way()](@ref AreaManager::way()). (Note that
68+
open ways cannot be meshed and will be ignored.)
6969

7070
Multipolygons need some support too. Since the member ways of a multipolygon relation
7171
are as a rule untagged, you have to copy at least the defining tag (and maybe the name)
7272
from the relation to the way. OSRM discards untagged ways.
7373

74-
Example of a process_way function:
74+
Example:
7575

7676
```lua
7777
function process_way(profile, way, result, relations)
7878
...
79-
if way:get_value_by_key('highway') == 'pedestrian' and way:get_value_by_key('area') == 'yes' then
79+
if way:has_tag('highway', 'pedestrian') and way:has_true_tag('area') then
8080
-- register the way
8181
area_manager:way(way)
8282
end
@@ -91,47 +91,3 @@ function process_way(profile, way, result, relations)
9191
...
9292
end
9393
```
94-
95-
### area_manager
96-
97-
A global user type.
98-
99-
#### area_manager:relation(relation)
100-
Call this function inside `process_relation()` to register a relation for meshing. The
101-
relation must be a multipolygon relation.
102-
103-
Argument | Type | Notes
104-
---------|-------------|-----------------------------------------------------
105-
relation | OSMRelation | The same relation as passed into `process_relation`.
106-
107-
#### area_manager:way(way)
108-
Call this function inside `process_way()` to register a way for meshing. The way must be
109-
closed.
110-
111-
Argument | Type | Notes
112-
---------|----------|-------------------------------------------
113-
way | OSMWay | The same way as passed into `process_way`.
114-
115-
#### area_manager:get_relations(node), area_manager:get_relations(way)
116-
Call this functions inside `process_node()` and `process_way()` respectively. If this
117-
node or way is a member of a relation that was registered for meshing, those relations
118-
will be returned.
119-
120-
Since the member ways of a multipolygon relation are as a rule untagged, and since OSRM
121-
discards untagged ways, you have to copy at least the defining tag (and maybe the name
122-
tags) from the relation to the way.
123-
124-
Argument | Type | Notes
125-
---------|----------|-----------------------------------------------
126-
node | OSMNode | The same node as passed into `process_node()`.
127-
way | OSMWay | The same way as passed into `process_way()`.
128-
129-
Usage example:
130-
131-
```lua
132-
for _, rel_id in pairs(area_manager:get_relations(way)) do
133-
local rel = relations:relation(rel_id)
134-
data.highway = rel:get_value_by_key('highway')
135-
WayHandlers.names(profile, rel, result, data)
136-
end
137-
```

0 commit comments

Comments
 (0)