forked from erikj/osm-tiles-docker
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathhelp.txt
89 lines (63 loc) · 3.75 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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 ncareol/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 ncareol/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 ncareol/osm-tiles \
import
Caching can improve the performance of import. Cache is configured via the
OSM_IMPORT_CACHE environment variable, which has a default value of 40MB. The value is
specified in units of MB, and values between 15-80% of available memory are recommended,
but should take into consideration usage by other applications on the system. Specifying
more memory than the system has available will result in an error. For further details,
see:
- http://wiki.openstreetmap.org/wiki/Osm2pgsql#Parameters
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 ncareol/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 ncareol/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 ncareol/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
To test previously rendered tiles without running the database and renderd, use the
`startweb` command:
docker run -P -v /data/mod_tile:/var/lib/mod_tile ncareol/osm-tiles \
startweb
For further information run the cli and look at /usr/local/share/doc/README.md.