-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c02a918
Showing
13 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
tools/ |
This file contains 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,2 @@ | ||
data | ||
**.pbf |
This file contains 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,19 @@ | ||
## Dynamic Images | ||
|
||
To build the Docker image, use the following command: | ||
|
||
```docker build -t neobility/osrm-backend-docker dynamic``` | ||
|
||
To run the Docker image, use the following command: | ||
|
||
```docker run -e MAP_URL=https://download.geofabrik.de/europe/romania-latest.osm.pbf -v "./data:/data" neobility/osrm-backend-docker:latest``` | ||
|
||
## Prebuilt Images | ||
|
||
To build a prebuilt image, use the following command: | ||
|
||
```docker build --build-arg MAP_URL=https://download.geofabrik.de/europe/romania-latest.osm.pbf -t neobility/osrm-backend-docker:romania prebuilt``` | ||
|
||
To run the prebuilt image, use the following command: | ||
|
||
```docker run neobility/osrm-backend-docker:romania``` |
This file contains 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,10 @@ | ||
FROM ghcr.io/project-osrm/osrm-backend | ||
|
||
# Install curl | ||
RUN apt-get update && apt-get install -y curl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy the entrypoint script to the container | ||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains 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,35 @@ | ||
#!/bin/bash | ||
|
||
# Check if map URL environment variable is set | ||
if [ -z "${MAP_URL}" ]; then | ||
echo "MAP_URL environment variable is not set." | ||
exit 1 | ||
fi | ||
|
||
# Extract filename from URL | ||
MAP_FILE=$(basename ${MAP_URL}) | ||
|
||
# Define the base name for the OSRM files | ||
OSRM_BASENAME="/data/${MAP_FILE%.osm.pbf}" | ||
|
||
# Download the map file if it doesn't exist | ||
# Run extract, partition, and customize | ||
if [ ! -f "/data/${MAP_FILE}" ]; then | ||
echo "Downloading map data from ${MAP_URL} to /data/${MAP_FILE} ..." | ||
|
||
mkdir -p /data | ||
curl -o "/data/${MAP_FILE}" "${MAP_URL}" | ||
|
||
echo "Extracting and preparing the map data ${OSRM_BASENAME}.osrm ..." | ||
|
||
# Extract the map file | ||
osrm-extract -p /opt/car.lua "/data/${MAP_FILE}" | ||
|
||
# Prepare the routing data | ||
osrm-partition "${OSRM_BASENAME}.osrm" | ||
osrm-customize "${OSRM_BASENAME}.osrm" | ||
fi | ||
|
||
# Start the OSRM backend | ||
echo "Starting OSRM backend..." | ||
osrm-routed --algorithm mld "${OSRM_BASENAME}.osrm" |
This file contains 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,15 @@ | ||
FROM ghcr.io/project-osrm/osrm-backend | ||
|
||
ARG MAP_URL | ||
|
||
ADD ${MAP_URL} /data/map.osm.pbf | ||
|
||
RUN osrm-extract -p /opt/car.lua /data/map.osm.pbf | ||
|
||
RUN osrm-partition /data/map.osm | ||
|
||
RUN osrm-customize /data/map.osm | ||
|
||
RUN rm /data/map.osm.pbf | ||
|
||
ENTRYPOINT [ "osrm-routed", "--algorithm", "mld", "/data/map.osm" ] |
This file contains 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,16 @@ | ||
FROM osrm/osrm-backend | ||
|
||
# ADD http://download.geofabrik.de/north-america/us-northeast-latest.osm.pbf /data/ | ||
ADD us-northeast-latest.osm.pbf /data/ | ||
|
||
RUN osrm-extract -p /opt/car.lua /data/us-northeast-latest.osm.pbf | ||
|
||
RUN osrm-partition /data/us-northeast-latest.osm | ||
|
||
RUN osrm-customize /data/us-northeast-latest.osm | ||
|
||
RUN rm /data/us-northeast-latest.osm.pbf | ||
|
||
ENTRYPOINT [ "osrm-routed", "--algorithm", "mld" ] | ||
|
||
CMD [ "/data/us-northeast-latest.osm" ] |
This file contains 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,3 @@ | ||
wget https://download.geofabrik.de/north-america/us/pennsylvania-latest.osm.pbf | ||
wget https://download.geofabrik.de/north-america/us/new-york-latest.osm.pbf | ||
wget https://download.geofabrik.de/europe/romania-latest.osm.pbf |
This file contains 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 @@ | ||
wget https://planet.openstreetmap.org/pbf/planet-latest.osm.pbf |
This file contains 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 @@ | ||
osmium cat romania-latest.osm.pbf new-york-latest.osm.pbf pennsylvania-latest.osm.pbf -o merged.osm.pbf |
This file contains 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,5 @@ | ||
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/planet-latest.osm.pbf | ||
|
||
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/planet-latest.osm | ||
|
||
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/planet-latest.osm |
This file contains 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 @@ | ||
docker run -p 9966:9966 -e OSRM_BACKEND='http://127.0.0.1:5000' osrm/osrm-frontend |
This file contains 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,3 @@ | ||
# docker run -t -i -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/planet-latest.osm | ||
|
||
docker run -d -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/planet-latest.osm |