forked from geo-data/openstreetmap-tiles-docker
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhelp.txt
74 lines (52 loc) · 3.05 KB
/
help.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Usage: run [COMMAND ...]
Run OpenStreetMap Tile Server related operations in a docker container.
Positional arguments:
COMMAND The command to run. (default: help)
Commands:
help Show this help message
initdb Initialise the postgres database, create osm database and database user
startdb Start the postgresql database
createuser Create the osm user in the database
createdb Create the osm database
import Import osm data into the database
render Render tiles from the database
startservices Start the database and osm web services
cli Drop into a bash shell
dropdb Drop the osm database
Set up a database saved on an external volume:
The following command will initialise the postgresql database on an external
volume that can be used to persist the data:
docker run -v /data/osm-postgresql:/var/lib/postgresql erikj/osm-tiles \
initdb
Import data:
The following will import the file at `/data/import.pbf` or `/data/import.osm`
into the database.
docker run -v /data/osm-postgresql:/var/lib/postgresql -v /tmp:/data erikj/osm-tiles \
import
An alternate path to the import file can be specified via the `OSM_IMPORT_FILE` environment variable.
The following will import `/data/north-america-latest.osm.pbf`:
docker run --env OSM_IMPORT_FILE="/data/north-america-latest.osm.pbf" -v /data/osm-postgresql:/var/lib/postgresql -v /tmp:/data erikj/osm-tiles \
import
Render tiles:
The following will render tiles to `/var/lib/mod_tile` via `renderd`s program `render_list`, to default max-zoom level of 8:
docker run -v /data/osm-postgresql:/var/lib/postgresql -v /tmp:/data erikj/osm-tiles render
Alternate min and max-zoom levels can be specified via the `OSM_MIN_ZOOM` and
`OSM_MAX_ZOOM` environment variables, respectively.
The following will render tiles to a max-zoom level of 12:
docker run --env OSM_MAX_ZOOM=12 -v /data/osm-postgresql:/var/lib/postgresql -v /tmp:/data erikj/osm-tiles render
The number of threads used for rendering can be specified via the `OSM_RENDER_THREADS`
environment variable. If not specified, the number of rendering threads used will either
be 8 or the number of processor cores, whichever is lesser.
By default, the --force flag, 'render tiles even if they seem current' is passed
to `render_list`. This can be disabled by setting the setting the `OSM_RENDER_FORCE`
environment variable to false.
Start the webserver:
Once data is loaded and users have been created run the webserver:
docker run -P -v /data/osm-postgresql:/var/lib/postgresql erikj/osm-tiles \
startservices
A demo index.html page, based on a simple OpenLayers example configured to load
the image's OpenStreetMap tiles as its base layer, is served as Apache's root document.
If localhost's port 8080 is forwarded to the image's port 80, then the demo
index.html will be available @:
http://localhost:8080
For further information run the cli and look at /usr/local/share/doc/README.md.