From 40cb3aeae6967f3cc1683226d1a89a4b5f999252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Austerm=C3=BChle?= Date: Tue, 14 Sep 2021 20:49:32 +0200 Subject: [PATCH 1/2] Allow file:// urls in the config file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stephan Austermühle --- scripts/get-external-data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/get-external-data.py b/scripts/get-external-data.py index 454fdba1a1..4cd1321f5c 100755 --- a/scripts/get-external-data.py +++ b/scripts/get-external-data.py @@ -22,6 +22,7 @@ # modules for getting data import zipfile import requests +from requests_file import FileAdapter import io # modules for converting and postgres loading @@ -196,6 +197,7 @@ def main(): user=user, password=password) + s.mount('file://', FileAdapter()) s.headers.update({'User-Agent': 'get-external-data.py/osm-carto'}) # DB setup From d688bd340cbdb6bdf02d66e6c054d43d672ade50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Austerm=C3=BChle?= Date: Thu, 16 Sep 2021 08:28:35 +0200 Subject: [PATCH 2/2] Update dependencies for local file support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stephan Austermühle --- Dockerfile.import | 2 +- INSTALL.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.import b/Dockerfile.import index bca900f4fc..88e1991a99 100644 --- a/Dockerfile.import +++ b/Dockerfile.import @@ -12,7 +12,7 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 \ RUN apt-get update && apt-get install --no-install-recommends -y \ osm2pgsql gdal-bin python3-psycopg2 python3-yaml \ - python3-requests postgresql-client && rm -rf /var/lib/apt/lists/* + python3-requests python3-requests-file postgresql-client && rm -rf /var/lib/apt/lists/* ADD openstreetmap-carto.style / diff --git a/INSTALL.md b/INSTALL.md index 347a3112c8..a568723e4e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -102,7 +102,7 @@ To display any map a database containing OpenStreetMap data and some utilities a * [PostgreSQL](https://www.postgresql.org/) * [PostGIS](https://postgis.net/) * [osm2pgsql](https://github.com/openstreetmap/osm2pgsql#installing) to [import your data](https://switch2osm.org/loading-osm-data/) into a PostGIS database -* Python 3 with the psycopg2, yaml, and requests libraries (`python3-psycopg2` `python3-yaml` `python3-requests` packages on Debian-derived systems) +* Python 3 with the psycopg2, yaml, and requests libraries (`python3-psycopg2`, `python3-yaml`, `python3-requests`, `python3-requests-file` packages on Debian-derived systems) * `ogr2ogr` for loading shapefiles into the database (`gdal-bin` on Debian-derived systems) ### Optional development dependencies