added recipe for downloading pbf,clip and mapping file from a given github repository

pull/89/head
admire 2019-12-31 14:58:49 +02:00
rodzic 3c0dada77e
commit 11661da7c5
5 zmienionych plików z 103 dodań i 3 usunięć

Wyświetl plik

@ -8,11 +8,12 @@ volumes:
pg:
grafana:
pw2:
osm_settings:
services:
db:
# About the postgresql version, it should match in the dockerfile of docker-imposm3
image: kartoza/postgis:11.0-2.5
image: kartoza/postgis:12.0
hostname: db
container_name: dockerosm_db
environment:
@ -30,19 +31,36 @@ services:
healthcheck:
test: "exit 0"
osm_downloader:
image: kartoza/docker-osm:pbf-downloader
build: docker-osm-pbf
container_name: dockerosm_pbf_download
volumes:
# These are sharable to other containers
- settings:/home/settings
environment:
# Read the README in docker-osm-pbf
- CONTINENT=africa
- COUNTRY=lesotho
- BASE_URL='http://download.geofabrik.de'
- MAPPING_URL='https://raw.githubusercontent.com/kartoza/docker-osm/develop/settings'
- GEOJSON_URL=''
imposm:
image: kartoza/docker-osm:imposm-latest
build: docker-imposm3
container_name: dockerosm_imposm
volumes:
# These are sharable to other containers
- ./settings:/home/settings
- osm_settings:/home/settings
- import_done:/home/import_done
- import_queue:/home/import_queue
- cache:/home/cache
depends_on:
db:
condition: service_healthy
osm_downloader:
condition: service_started
environment:
- POSTGRES_USER=docker
- POSTGRES_PASS=docker
@ -81,13 +99,15 @@ services:
container_name: dockerosm_osmupdate
volumes:
# These are sharable to other containers
- ./settings:/home/settings
- osm_settings:/home/settings
- import_done:/home/import_done
- import_queue:/home/import_queue
- cache:/home/cache
depends_on:
db:
condition: service_healthy
osm_downloader:
condition: service_started
environment:
# These are all currently the defaults but listed here for your
# convenience if you want to change them

Wyświetl plik

@ -0,0 +1,14 @@
FROM alpine:latest
RUN apk --no-cache add --update bash
ENV BASE_URL='http://download.geofabrik.de'
ENV CONTINENT=''
ENV COUNTRY=''
ENV MAPPING_URL='https://raw.githubusercontent.com/kartoza/docker-osm/develop/settings'
ENV GEOJSON_URL=''
RUN mkdir /home/settings
ADD download.sh /download.sh
ENTRYPOINT ["/bin/bash", "/download.sh"]

Wyświetl plik

@ -0,0 +1,31 @@
# Download Docker OSM Files
This image is used to facilitate downloading of docker-osm files which are required to get the image
running. The image will download OSM PBF file, Mapping file, Clip Geojson and QGIS Style file.
Environment variables
**BASE_URL='http://download.geofabrik.de'**
This is used to download the OSM PBF file. Currently points to Geofabrik
**CONTINENT=''**
Used to specify what continent you need to download pbf from. This is mandatory eg `CONTINENT=africa`
**COUNTRY=''**
Used to specify which country you need to download pbf from. This is optional if you intent
to only use continent pbf. Eg `COUNTRY=lesotho`
**MAPPING_URL='https://raw.githubusercontent.com/kartoza/docker-osm/develop/settings'**
This currently points to the docker-osm repository to enable downloading of the mapping file, qgis_style
file. These files are mandatory in the running of docker-osm
**GEOJSON_URL=''**
This points to the geojson file that is used for clipping data in OSM. This can be empty if you do
not intent to use the clip functionality in docker-osm

Wyświetl plik

@ -0,0 +1,35 @@
#!/usr/bin/env bash
CONTINENT_LOCKFILE=/home/settings/.${CONTINENT}_lock
COUNTRY_LOCKFILE=/home/settings/.${COUNTRY}_lock
# Download OSM Mapping file and Associated data
if [ ! -f /home/settings/mapping.yml ]; then \
wget -c ${MAPPING_URL}/mapping.yml -O /home/settings/mapping.yml
fi
if [ ! -f /home/settings/qgis_style.sql ]; then \
wget -c ${MAPPING_URL}/qgis_style.sql -O /home/settings/qgis_style.sql
fi
if [[ ! -f /home/settings/clip.geojson && -z ${GEOJSON_URL} ]]; then \
echo "We are not downloading any Geojson"
else
wget -c ${GEOJSON_URL} -O /home/settings/clip.geojson
fi
# Download OSM PBF
if [[ ! -f ${CONTINENT_LOCKFILE} && -z ${COUNTRY} ]]; then \
echo "${BASE_URL}/${CONTINENT}-latest.osm.pbf"
wget -c --no-check-certificate ${BASE_URL}/${CONTINENT}-latest.osm.pbf -O /home/settings/country.pbf
touch ${CONTINENT_LOCKFILE}
elif [[ ! -f ${COUNTRY_LOCKFILE} ]]; then
echo "${BASE_URL}/${CONTINENT}/${COUNTRY}-latest.osm.pbf"
wget -c --no-check-certificate ${BASE_URL}/${CONTINENT}/${COUNTRY}-latest.osm.pbf -O /home/settings/country.pbf
touch ${COUNTRY_LOCKFILE}
fi

Plik binarny nie jest wyświetlany.