@@ -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 ` ).
@@ -23,7 +32,7 @@ your the host machine's timezone, important when for archiving PBF & MD5 files b
23
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
@@ -40,7 +49,7 @@ The 3rd parameter tells the script the server has 8 GB RAM available for osm2pgs
40
49
41
50
``` bash
42
51
docker exec -it \
43
- -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_USER=postgres \
52
+ -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD -e POSTGRES_USER=$POSTGRES_USER \
44
53
pgosm python3 docker/pgosm_flex.py \
45
54
--layerset=run-all --ram=8 \
46
55
--region=north-america/us \
@@ -62,31 +71,35 @@ Usage: pgosm_flex.py [OPTIONS]
62
71
Logic to run PgOSM Flex within Docker.
63
72
64
73
Options:
65
- --layerset TEXT Layer set from PgOSM Flex to load. e.g. run-all
66
- [default: (run-all); required]
67
- --ram INTEGER Amount of RAM in GB available on the server running this
68
- process. [default: 8; required]
69
- --region TEXT Region name matching the filename for data sourced from
70
- Geofabrik. e.g. north-america/us [default: (north-
71
- america/us); required]
72
- --subregion TEXT Sub-region name matching the filename for data sourced
73
- from Geofabrik. e.g. district-of-columbia [default:
74
- (district-of-columbia)]
75
- --srid INTEGER SRID for data in PostGIS.
76
- --pgosm-date TEXT Date of the data in YYYY-MM-DD format. Set to historic
77
- date to load locally archived PBF/MD5 file, will fail if
78
- both files do not exist.
79
- --skip-nested When True, skips calculating nested admin polygons. Can
80
- be time consuming on large regions.
81
- --data-only When True, skips running Sqitch and importing QGIS
82
- Styles.
83
- --debug Enables additional log output
84
- --basepath TEXT Debugging option. Used when testing locally and not
85
- within Docker
86
- --help Show this message and exit.
74
+ --layerset TEXT Layer set from PgOSM Flex to load. e.g. run-all
75
+ [default: (run-all); required]
76
+ --ram INTEGER Amount of RAM in GB available on the server running this
77
+ process. [default: 4; required]
78
+ --region TEXT Region name matching the filename for data sourced from
79
+ Geofabrik. e.g. north-america/us [default: (north-
80
+ america/us); required]
81
+ --subregion TEXT Sub-region name matching the filename for data sourced
82
+ from Geofabrik. e.g. district-of-columbia [default:
83
+ (district-of-columbia)]
84
+ --srid TEXT SRID for data in PostGIS.
85
+ --pgosm-date TEXT Date of the data in YYYY-MM-DD format. Set to historic
86
+ date to load locally archived PBF/MD5 file, will fail if
87
+ both files do not exist.
88
+ --language TEXT Set default language in loaded OpenStreetMap data when
89
+ available. e.g. ' en' or ' kn' .
90
+ --schema-name TEXT Coming soon
91
+ --skip-nested When True, skips calculating nested admin polygons. Can
92
+ be time consuming on large regions.
93
+ --data-only When True, skips running Sqitch and importing QGIS
94
+ Styles.
95
+ --debug Enables additional log output
96
+ --basepath TEXT Debugging option. Used when testing locally and not
97
+ within Docker
98
+ --help Show this message and exit.
87
99
` ` `
88
100
89
- An example of running with all current options.
101
+ An example of running with all current options, except ` --basepath` which is only
102
+ used during development.
90
103
91
104
` ` ` bash
92
105
docker exec -it \
0 commit comments