You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DOCKER-RUN.md
+75-47Lines changed: 75 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Using PgOSM-Flex within Docker
2
2
3
3
This README provides details about running PgOSM-Flex using the image defined
4
-
in `Dockerfile` and the script loaded from `docker/run_pgosm_flex.sh`.
4
+
in `Dockerfile` and the script loaded from `docker/pgosm_flex.py`.
5
5
6
6
7
7
## Setup and Run Container
@@ -12,6 +12,15 @@ Create directory for the `.osm.pbf` file and output `.sql` file.
12
12
mkdir ~/pgosm-data
13
13
```
14
14
15
+
16
+
Set environment variables for the temporary Postgres connection in Docker.
17
+
18
+
```bash
19
+
export POSTGRES_USER=postgres
20
+
export POSTGRES_PASSWORD=mysecretpassword
21
+
```
22
+
23
+
15
24
Start the `pgosm` Docker container to make PostgreSQL/PostGIS available.
16
25
This command exposes Postgres inside Docker on port 5433 and establishes links
17
26
to the local directory created above (`~/pgosm-data`).
@@ -20,10 +29,10 @@ your the host machine's timezone, important when for archiving PBF & MD5 files b
20
29
21
30
22
31
```bash
23
-
docker run --name pgosm -d \
32
+
docker run --name pgosm -d --rm \
24
33
-v ~/pgosm-data:/app/output \
25
34
-v /etc/localtime:/etc/localtime:ro \
26
-
-e POSTGRES_PASSWORD=mysecretpassword \
35
+
-e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
27
36
-p 5433:5432 -d rustprooflabs/pgosm-flex
28
37
```
29
38
@@ -32,84 +41,103 @@ docker run --name pgosm -d \
32
41
The following `docker exec` command runs PgOSM Flex to load the District of Columbia
33
42
region
34
43
35
-
The command `bash docker/run_pgosm_flex.sh` runs the full process. The
44
+
The command `python3 docker/pgosm_flex.py` runs the full process. The
36
45
script uses a region (`north-america/us`) and sub-region (`district-of-columbia`)
37
46
that must match values in URLs from the Geofabrik download server.
38
47
The 3rd parameter tells the script the server has 8 GB RAM available for osm2pgsql, Postgres, and the OS. The PgOSM-Flex layer set is defined (`run-all`).
To force the processing to remove existing files and re-download the latest PBF and MD5 files from Geofabrik, set the `PGOSM_ALWAYS_DOWNLOAD` env var when running the Docker container.
124
+
Use `--skip-nested` to bypass the calculation of nested admin polygons.
125
+
126
+
The default is to run the nested polygon calculation. This can take considerable time on larger regions or may
127
+
be otherwise unwanted.
92
128
93
-
```bash
94
-
docker run --name pgosm -d \
95
-
-v ~/pgosm-data:/app/output \
96
-
-e POSTGRES_PASSWORD=mysecretpassword \
97
-
-e PGOSM_ALWAYS_DOWNLOAD=1 \
98
-
-p 5433:5432 -d rustprooflabs/pgosm
99
-
```
100
129
101
130
## Configure Postgres in Docker
102
131
103
132
Add customizations with the `-c` switch, e.g. `-c shared_buffers=1GB`,
104
133
to customize Postgres' configuration at run-time in Docker.
The `name` column throughout PgOSM-Flex defaults to using the highest priority
290
+
name tag according to the [OSM Wiki](https://wiki.openstreetmap.org/wiki/Names). Setting `PGOSM_LANGUAGE` allows giving preference to name tags with the
291
+
given language.
292
+
The value of `PGOSM_LANGUAGE` should match the codes used by OSM:
293
+
294
+
> where code is a lowercase language's ISO 639-1 alpha2 code, or a lowercase ISO 639-2 code if an ISO 639-1 code doesn't exist." -- [Multilingual names on OSM Wiki](https://wiki.openstreetmap.org/wiki/Multilingual_names)
0 commit comments