@@ -27,6 +27,28 @@ This project's approach is to do as much processing in the Lua styles
2727passed along to osm2pgsql, with post-processing steps creating indexes,
2828constraints and comments.
2929
30+ ## Quick start
31+
32+ See the [ Docker Usage] ( #docker-usage ) section below for an explanation of
33+ these commands.
34+
35+ ``` bash
36+ mkdir ~ /pgosm-data
37+ export POSTGRES_USER=postgres
38+ export POSTGRES_PASSWORD=mysecretpassword
39+
40+ docker run --name pgosm -d --rm \
41+ -v ~ /pgosm-data:/app/output \
42+ -v /etc/localtime:/etc/localtime:ro \
43+ -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
44+ -p 5433:5432 -d rustprooflabs/pgosm-flex
45+
46+ docker exec -it \
47+ pgosm python3 docker/pgosm_flex.py \
48+ --ram=8 \
49+ --region=north-america/us \
50+ --subregion=district-of-columbia
51+ ```
3052
3153
3254## Versions Supported
@@ -57,21 +79,24 @@ package used to determine the best osm2pgsql command assumes fast SSDs.
5779
5880## PgOSM via Docker
5981
60- The easiest way to use PgOSM-Flex is with the
61- [ Docker image] ( https://hub.docker.com/r/rustprooflabs/pgosm-flex ) hosted on
62- Docker Hub.
63- The image has all the pre-requisite software installed,
64- handles downloading an OSM region (or subregion)
65- from Geofabrik, and saves an output ` .sql ` file with the processed data
66- ready to load into your database(s).
67- The PBF/MD5 source files are archived by date on your local storage
68- with the ability to easily reload them at a later date.
82+ The PgOSM Flex
83+ [ Docker image] ( https://hub.docker.com/r/rustprooflabs/pgosm-flex )
84+ is hosted on Docker Hub.
85+ The image includes all the pre-requisite software and handles all of the options,
86+ logic, an post-processing steps required. Features include:
87+
88+ * Automatic data download from Geofabrik and validation against checksum
89+ * Custom Flex layers built in Lua
90+ * Mix and match layers using Layersets
91+ * Loads to Docker-internal Postgres, or externally defined Postgres
92+ * Supports ` osm2pgsql-replication ` and ` osm2pgsql --append ` mode
93+ * Export processed data via ` pg_dump ` for loading into additional databases
6994
7095
7196### Docker usage
7297
73- This section outlines a typical import using Docker to run PgOSM- Flex.
74- See [ the full Docker instructions in docs/DOCKER-RUN.md] ( docs/DOCKER-RUN.md ) .
98+ This section outlines a typical import using Docker to run PgOSM Flex.
99+ See the full Docker instructions in [ docs/DOCKER-RUN.md] ( docs/DOCKER-RUN.md ) .
75100
76101Create directory for the ` .osm.pbf ` file, output ` .sql ` file, log output, and
77102the osm2pgsql command ran.
@@ -90,7 +115,7 @@ export POSTGRES_USER=postgres
90115export POSTGRES_PASSWORD=mysecretpassword
91116```
92117
93- Start the ` pgosm ` Docker container. At this point, PostgreSQL / PostGIS
118+ Start the ` pgosm ` Docker container. At this point, Postgres / PostGIS
94119is available on port ` 5433 ` .
95120
96121``` bash
@@ -110,7 +135,6 @@ along with a region/subregion.
110135* Sub-region (` district-of-columbia ` ) (Optional)
111136
112137
113-
114138``` bash
115139docker exec -it \
116140 pgosm python3 docker/pgosm_flex.py \
@@ -128,7 +152,6 @@ it takes to download the 17 MB PBF file + ~ 1 minute processing.
128152
129153### After processing
130154
131-
132155The processed OpenStreetMap data is also available in the Docker container on port ` 5433 ` .
133156You can connect and query directly in the Docker container.
134157
@@ -150,33 +173,20 @@ again in the future, either with the same version of PgOSM Flex or the latest ve
150173to load these historic files.
151174
152175
153- If the optional ` --pg-dump ` option is used, the output ` .sql ` is also saved in
176+ If ` --pg-dump ` option is used the output ` .sql ` is also saved in
154177the ` ~/pgosm-data ` directory.
178+ This ` .sql ` file can be loaded into any other database with PostGIS and the proper
179+ permissions.
155180
156181
157182``` bash
158183ls -alh ~ /pgosm-data/
159184
160- -rw-r--r-- 1 root root 17M Nov 2 19:57 district-of-columbia-2021-11-03 .osm.pbf
161- -rw-r--r-- 1 root root 70 Nov 2 19:59 district-of-columbia-2021-11-03 .osm.pbf.md5
162- -rw-r--r-- 1 root root 156M Nov 3 19:10 pgosm-flex- north-america-us-district-of-columbia-default-2021-11-03 .sql
185+ -rw-r--r-- 1 root root 18M Jan 21 03:45 district-of-columbia-2023-01-21 .osm.pbf
186+ -rw-r--r-- 1 root root 70 Jan 21 04:39 district-of-columbia-2023-01-21 .osm.pbf.md5
187+ -rw-r--r-- 1 root root 163M Jan 21 16:14 north-america-us-district-of-columbia-default-2023-01-21 .sql
163188```
164189
165- This ` .sql ` file can be loaded into a PostGIS enabled database. The following example
166- creates an empty ` myosm ` database to load the processed OpenStreetMap data into.
167-
168-
169- ``` bash
170- psql -d postgres -c " CREATE DATABASE myosm;"
171- psql -d myosm -c " CREATE EXTENSION postgis;"
172-
173- psql -d myosm \
174- -f ~ /pgosm-data/pgosm-flex-north-america-us-district-of-columbia-default-2021-11-03.sql
175- ```
176-
177-
178- > See [ more in docs/DOCKER-RUN.md] ( docs/DOCKER-RUN.md ) about other ways to customize how PgOSM Flex runs.
179-
180190
181191## Layer Sets
182192
0 commit comments