Skip to content

Commit

Permalink
feat: add car routing (#10)
Browse files Browse the repository at this point in the history
* feat: update to ORS 8.0.1
* feat: add car routing to the config
* feat: add script to build the graph ahead of time
  • Loading branch information
paulswartz authored May 28, 2024
1 parent 2af4d26 commit 9fbe644
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
FROM openrouteservice/openrouteservice:v8.0.0
ARG OPEN_ROUTE_SERVICE_VERSION=8.0.1

FROM openrouteservice/openrouteservice:v${OPEN_ROUTE_SERVICE_VERSION} AS builder

COPY preparation.sh /preparation.sh

RUN wget http://download.geofabrik.de/north-america/us/massachusetts-latest.osm.pbf -O files/data.osm.pbf

COPY ors-config.yml config/ors-config.yml

RUN /preparation.sh

FROM openrouteservice/openrouteservice:v${OPEN_ROUTE_SERVICE_VERSION}

COPY --from=builder /home/ors/graphs graphs
COPY ors-config.yml config/ors-config.yml
3 changes: 3 additions & 0 deletions ors-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ors:
engine:
source_file: /home/ors/files/data.osm.pbf
profiles:
car:
enabled: true

hgv:
enabled: true
profile: driving-hgv
Expand Down
16 changes: 16 additions & 0 deletions preparation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

export REBUILD_GRAPHS=true
export ors.engine.preparation_mode=true
export ors.services.routing.mode=preparation

/entrypoint.sh &
entrypoint_pid=$!

# Wait for the server to become healthy...
while ! wget --quiet -O /dev/null http://localhost:8082/ors/v2/health; do
sleep 5
done

echo Built graph, stopping server...
kill $entrypoint_pid

0 comments on commit 9fbe644

Please sign in to comment.