-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker configuration to process OTP data files (#1281)
* Add Docker configuration to process OTP data files * Add curl
- Loading branch information
1 parent
ee42509
commit eb32a3f
Showing
4 changed files
with
44 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,8 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN mkdir -p /usr/local/src | ||
WORKDIR /usr/local/src | ||
|
||
RUN apt update && apt install -y curl osmctools | ||
|
||
COPY . /usr/local/src |
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,20 @@ | ||
#!/bin/bash | ||
|
||
BOUNDS=-76.209582,38.441753,-74.243725,40.725449 | ||
|
||
declare -a STATES=("pennsylvania" "new-jersey" "delaware") | ||
|
||
for STATE in "${STATES[@]}"; do | ||
echo "extracting OSM data for the region served by CAC for ${STATE}..." | ||
osmconvert ${STATE}.pbf -b=${BOUNDS} \ | ||
--complete-ways --complex-ways --complete-boundaries --complete-multipolygons \ | ||
-o=${STATE}.o5m | ||
done | ||
|
||
echo "combining state region extracts..." | ||
|
||
INPUTS=$(printf "%s.o5m " "${STATES[@]}") | ||
|
||
osmconvert ${INPUTS} -o=cac.pbf | ||
|
||
echo "all done!" |
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,8 @@ | ||
version: "3" | ||
services: | ||
osm: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- ./:/usr/local/src |
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,8 @@ | ||
#!/bin/bash | ||
|
||
declare -a STATES=("pennsylvania" "new-jersey" "delaware") | ||
|
||
for STATE in "${STATES[@]}"; do | ||
echo "downloading OSM data for ${STATE}..." | ||
curl https://download.geofabrik.de/north-america/us/${STATE}-latest.osm.pbf -o ${STATE}.pbf | ||
done |