Skip to content

Commit

Permalink
Merge pull request gravitystorm#4468 from stephan2012/feature/local-f…
Browse files Browse the repository at this point in the history
…iles

Allow file:// urls in the config file
  • Loading branch information
pnorman authored Jun 20, 2022
2 parents 17113f7 + db3386f commit 6fd66c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.import
Original file line number Diff line number Diff line change
Expand Up @@ -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 /

Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/serving-tiles/updating-as-people-edit/) 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
Expand Down
2 changes: 2 additions & 0 deletions scripts/get-external-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -198,6 +199,7 @@ def main():
user=user,
password=password)

s.mount('file://', FileAdapter())
s.headers.update({'User-Agent': 'get-external-data.py/osm-carto'})

# DB setup
Expand Down

0 comments on commit 6fd66c9

Please sign in to comment.