Skip to content

Commit 5e1be1a

Browse files
Squash
1 parent 560ed5c commit 5e1be1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4321
-709
lines changed

.github/workflows/osrm-backend.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
5858
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON ..
5959
cmake --build . --config Release
60-
60+
6161
# TODO: MSVC goes out of memory when building our tests
6262
# - name: Run tests
6363
# shell: bash
@@ -331,7 +331,7 @@ jobs:
331331
build_node_package: true
332332
continue-on-error: true
333333
node: 22
334-
runs-on: macos-15 # arm64
334+
runs-on: macos-15 # arm64
335335
BUILD_TYPE: Release
336336
CCOMPILER: clang
337337
CXXCOMPILER: clang++
@@ -419,7 +419,7 @@ jobs:
419419
fi
420420
# See: https://github.com/actions/toolkit/issues/946#issuecomment-1590016041
421421
# We need it to be able to access system folders while restoring cached Boost below
422-
- name: Give tar root ownership
422+
- name: Give tar root ownership
423423
if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON'
424424
run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar
425425

@@ -429,7 +429,7 @@ jobs:
429429
id: install-boost
430430
with:
431431
boost_version: 1.85.0
432-
432+
433433
- name: Install dev dependencies
434434
run: |
435435
# workaround for issue that GitHub Actions seems to not adding it to PATH after https://github.com/actions/runner-images/pull/6499
@@ -577,7 +577,7 @@ jobs:
577577
uses: actions/upload-artifact@v4
578578
if: failure()
579579
with:
580-
name: logs
580+
name: logs-${{ matrix.name }}
581581
path: test/logs/
582582

583583
- name: Build Node package

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
# Changelog
2+
13
# Unreleased
24
- Changes from 6.0.0
5+
- Features
6+
- ADDED: Pedestrian area routing [#7161](https://github.com/Project-OSRM/osrm-backend/pull/7161)
37

48
# 6.0.0
59
- Changes from 6.0.0 RC2: None
@@ -182,7 +186,7 @@
182186
- CHANGED: Docker build, enabled arm64 build layer [#6172](https://github.com/Project-OSRM/osrm-backend/pull/6172)
183187
- CHANGED: Docker build, enabled apt-get update/install caching in separate layer for build phase [#6175](https://github.com/Project-OSRM/osrm-backend/pull/6175)
184188
- FIXED: Bump CI complete meta job to ubuntu-20.04 [#6323](https://github.com/Project-OSRM/osrm-backend/pull/6323)
185-
- CHANGED: Node packages are now scoped by @project-osrm [#6386](https://github.com/Project-OSRM/osrm-backend/issues/6386)
189+
- CHANGED: Node packages are now scoped by \@project-osrm [#6386](https://github.com/Project-OSRM/osrm-backend/issues/6386)
186190
- Routing:
187191
- CHANGED: Lazily generate optional route path data [#6045](https://github.com/Project-OSRM/osrm-backend/pull/6045)
188192
- FIXED: Completed support for no_entry and no_exit turn restrictions. [#5988](https://github.com/Project-OSRM/osrm-backend/pull/5988)
@@ -217,7 +221,7 @@
217221
- Build:
218222
- CHANGED: Node binaries now use Github Releases for hosting [#6030](https://github.com/Project-OSRM/osrm-backend/pull/6030)
219223
- Misc:
220-
- FIXED: Upgrade to @mapbox/node-pre-gyp fix various bugs with Node 12/14 [#5991](https://github.com/Project-OSRM/osrm-backend/pull/5991)
224+
- FIXED: Upgrade to \@mapbox/node-pre-gyp fix various bugs with Node 12/14 [#5991](https://github.com/Project-OSRM/osrm-backend/pull/5991)
221225
- FIXED: `valid` type in documentation examples [#5990](https://github.com/Project-OSRM/osrm-backend/issues/5990)
222226
- FIXED: Remove redundant loading of .osrm.cell_metrics [#6019](https://github.com/Project-OSRM/osrm-backend/issues/6019)
223227
- CHANGED: Increase PackedOSMIDs size to 34 bits. This breaks the **data format** [#6020](https://github.com/Project-OSRM/osrm-backend/issues/6020)

CONTRIBUTING.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
# Everyone
1+
# Contributing
2+
3+
## Everyone
24

35
Please take some time to review our [code of conduct](CODE-OF-CONDUCT.md) to help guide your interactions with others on this project.
46

5-
# User
7+
## User
68

79
Before you open a new issue, please search for older ones that cover the same issue.
810
In general "me too" comments/issues are frowned upon.
911
You can add a :+1: emoji reaction to the issue if you want to express interest in this.
1012

11-
# Developer
13+
## Developer
1214

1315
We use `clang-format` version `15` to consistently format the code base. There is a helper script under `scripts/format.sh`.
1416
The format is automatically checked by the `mason-linux-release` job of a Travis CI build.
1517
To save development time a local hook `.git/hooks/pre-push`
18+
1619
```
1720
#!/bin/sh
1821
@@ -28,16 +31,16 @@ if [ x"$remote" = xorigin ] ; then
2831
fi
2932
fi
3033
```
34+
3135
could check code format, modify a local repository and reject push due to unstaged formatting changes.
32-
Also `pre-push` hook rejects direct pushes to `origin/master`.
36+
Also `pre-push` hook rejects direct pushes to `origin/master`.
3337

3438
⚠️ `scripts/format.sh` checks all local files that match `*.cpp` or `*.hpp` patterns.
3539

36-
3740
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
3841
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
3942

40-
## Pull Request
43+
### Pull Request
4144

4245
Every pull-request that changes the API needs to update the docs in `docs/http.md` and add an entry to `CHANGELOG.md`.
4346
Breaking changes need to have a BREAKING prefix. See the [releasing documentation](docs/releasing.md) on how this affects the version.
@@ -57,25 +60,25 @@ If you do have commit access there are in general two accepted styles to merging
5760

5861
1. Make sure the branch is up to date with `master`. Run `git rebase master` to find out.
5962
2. Once that is ensured you can either:
60-
- Click the nice green merge button (for a non-fast-forward merge)
61-
- Merge by hand using a fast-forward merge
63+
64+
- Click the nice green merge button (for a non-fast-forward merge)
65+
- Merge by hand using a fast-forward merge
6266

6367
Which merge you prefer is up to personal preference. In general it is recommended to use fast-forward merges because it creates a history that is sequential and easier to understand.
6468

65-
# Maintainer
69+
## Maintainer
6670

67-
## Doing a release
71+
### Doing a release
6872

6973
There is an in-depth guide around how to push out a release once it is ready [here](docs/releasing.md).
7074

71-
## The API
75+
### The API
7276

7377
Changes to the API need to be discussed and signed off by the team. Breaking changes even more so than additive changes.
7478

75-
## Milestones
79+
### Milestones
7680

7781
If a pull request or an issue is applicable for the current or next milestone, depends on the target version number.
7882
Since we use semantic versioning we restrict breaking changes to major releases.
7983
After a Release Candidate is released we usually don't change the API anymore if it is not critical.
8084
Bigger code changes after a RC was released should also be avoided.
81-

Doxyfile.in

Lines changed: 2 additions & 3 deletions
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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
## Open Source Routing Machine
2-
1+
# Open Source Routing Machine
32

43
[![osrm-backend CI](https://github.com/Project-OSRM/osrm-backend/actions/workflows/osrm-backend.yml/badge.svg)](https://github.com/Project-OSRM/osrm-backend/actions/workflows/osrm-backend.yml) [![Discord](https://img.shields.io/discord/1034487840219860992)](https://discord.gg/es9CdcCXcb)
54

65
High performance routing engine written in C++ designed to run on OpenStreetMap data.
76

87
The following services are available via HTTP API, C++ library interface and NodeJs wrapper:
8+
99
- Nearest - Snaps coordinates to the street network and returns the nearest matches
1010
- Route - Finds the fastest route between coordinates
1111
- Table - Computes the duration or distances of the fastest route between all pairs of supplied coordinates
@@ -18,6 +18,7 @@ To quickly try OSRM use our [demo server](http://map.project-osrm.org) which com
1818
For a quick introduction about how the road network is represented in OpenStreetMap and how to map specific road network features have a look at [the OSM wiki on routing](https://wiki.openstreetmap.org/wiki/Routing) or [this guide about mapping for navigation](https://web.archive.org/web/20221206013651/https://labs.mapbox.com/mapping/mapping-for-navigation/).
1919

2020
Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
21+
2122
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
2223
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
2324
- [osrm-backend-docker](https://github.com/project-osrm/osrm-backend/pkgs/container/osrm-backend) - Ready to use Docker images
@@ -28,7 +29,6 @@ Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
2829

2930
- [Hosted documentation](http://project-osrm.org)
3031
- [osrm-routed HTTP API documentation](docs/http.md)
31-
- [libosrm API documentation](docs/libosrm.md)
3232

3333
## Contact
3434

@@ -41,6 +41,7 @@ Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
4141
The easiest and quickest way to setup your own routing engine is to use Docker images we provide.
4242

4343
There are two pre-processing pipelines available:
44+
4445
- Contraction Hierarchies (CH)
4546
- Multi-Level Dijkstra (MLD)
4647

@@ -86,13 +87,13 @@ After adding yourself to the `docker` group make sure to log out and back in aga
8687

8788
We support the following images in the Container Registry:
8889

89-
Name | Description
90-
-----|------
91-
`latest` | `master` compiled with release flag
92-
`latest-assertions` | `master` compiled with with release flag, assertions enabled and debug symbols
93-
`latest-debug` | `master` compiled with debug flag
94-
`<tag>` | specific tag compiled with release flag
95-
`<tag>-debug` | specific tag compiled with debug flag
90+
| Name | Description |
91+
| ------------------- | ------------------------------------------------------------------------------ |
92+
| `latest` | `master` compiled with release flag |
93+
| `latest-assertions` | `master` compiled with with release flag, assertions enabled and debug symbols |
94+
| `latest-debug` | `master` compiled with debug flag |
95+
| `<tag>` | specific tag compiled with release flag |
96+
| `<tag>-debug` | specific tag compiled with debug flag |
9697

9798
### Building from Source
9899

@@ -166,7 +167,6 @@ For usage details have a look [these API docs](docs/nodejs/api.md).
166167

167168
An exemplary implementation by a 3rd party with Docker and Node.js can be found [here](https://github.com/door2door-io/osrm-express-server-demo).
168169

169-
170170
## References in publications
171171

172172
When using the code in a (scientific) publication, please cite

cucumber.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
default: '--strict --tags ~@stress --tags ~@todo --tags ~@mld --require features/support --require features/step_definitions',
3-
ch: '--strict --tags ~@stress --tags ~@todo --tags ~@mld -f progress --require features/support --require features/step_definitions',
3+
ch: '--strict --tags ~@stress --tags ~@todo --tags ~@mld --require features/support --require features/step_definitions',
44
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
55
all: '--strict --require features/support --require features/step_definitions',
6-
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@ch --require features/support --require features/step_definitions -f progress'
6+
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@ch --require features/support --require features/step_definitions'
77
};

docs/areas.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# How to route through pedestrian areas {#pedestrian_areas}
2+
3+
@sa AreaManager
4+
5+
How to route through pedestrian areas, or any other area where you can travel freely in
6+
all directions.
7+
8+
OSRM routes over the inside of an area by "meshing" it, that is, by adding a virtual way
9+
between every pair of entry points of the area. These virtual ways always follow lines
10+
of sight and only use existing nodes. An entry point is where another way connects to
11+
the area.
12+
13+
## Configuration
14+
15+
This feature is EXPERIMENTAL and you must opt-in to it. To opt-in, you must declare the
16+
algorithm to be used for area meshing. In your LUA profile properties insert this line:
17+
18+
```lua
19+
function setup()
20+
...
21+
return {
22+
properties = {
23+
...
24+
area_meshing_algorithm = 'visgraph+dijkstra', -- << insert this line
25+
...
26+
},
27+
}
28+
end
29+
```
30+
31+
Note: Only one algorithm is available currently.
32+
33+
All areas to be meshed must be registered with the @ref AreaManager. Areas are mapped
34+
either as a closed way or a multipolygon relation. Both types must be configured
35+
separately.
36+
37+
### process_relation(profile, relation, relations)
38+
39+
To mesh a multipolygon relation you must register it in your @ref process_relation
40+
function. The process_relation function is called for every relation in the input file.
41+
You'll have to create the function like this:
42+
43+
```lua
44+
function process_relation(profile, relation, relations)
45+
if relation:has_tag('type', 'multipolygon') and relation:has_tag('highway', 'pedestrian') then
46+
-- register the relation
47+
area_manager:relation(relation)
48+
end
49+
end
50+
51+
-- don't forget to return the process_relation function from the profile
52+
return {
53+
setup = setup,
54+
process_way = process_way,
55+
process_node = process_node,
56+
process_relation = process_relation, -- << add this
57+
...
58+
}
59+
```
60+
61+
### process_way(profile, way, result, relations)
62+
63+
To mesh a closed way you must register it in your @ref process_way function. The
64+
process_way function is called for every way in the input file. Insert following lines
65+
into your process_way function:
66+
67+
```lua
68+
function process_way(profile, way, result, relations)
69+
...
70+
if way:has_tag('highway', 'pedestrian') and way:has_true_tag('area') then
71+
-- register the way
72+
area_manager:way(way)
73+
end
74+
...
75+
end
76+
```
77+
78+
(Note that open ways cannot be meshed and will be ignored.)
79+
80+
Some support for multipolygons is needed in this function too. Since the member ways of
81+
a multipolygon relation are untagged, and OSRM discards untagged ways, you must copy at
82+
least the defining tag (and the name, if you want guidance) from the relation to the
83+
way:
84+
85+
```lua
86+
function process_way(profile, way, result, relations)
87+
...
88+
for _, rel_id in pairs(area_manager:get_relations(way)) do
89+
-- if this way is a member of a previously registered relation
90+
-- we have to set at least one defining tag, else OSRM will discard it
91+
local rel = relations:relation(rel_id)
92+
data.highway = rel:get_value_by_key('highway')
93+
-- also copy the name tag(s) from the relation the to way
94+
WayHandlers.names(profile, rel, result, data)
95+
end
96+
...
97+
end
98+
```
99+
100+
At this point you have a basic configuration. Refer to @ref AreaManager for further
101+
details. A complete profile example is found in the file:
102+
[profiles/foot_area.lua](../profiles/foot_area.lua).

0 commit comments

Comments
 (0)