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
If you're using Ubuntu 16.04, you can install Boost with `sudo apt-get install libboost-all-dev`. For 12.04 or 14.04, you'll need to install a recent Boost from [this PPA](https://launchpad.net/~ostogvin/+archive/ubuntu/tjo-develop):
21
+
22
+
sudo add-apt-repository ppa:ostogvin/tjo-develop
23
+
sudo apt-get update
24
+
sudo apt-get install libboost1.58-all-dev
25
+
26
+
Once you've installed those, then `cd` back to your Tilemaker directory and simply:
27
+
28
+
make
29
+
sudo make install
30
+
31
+
If it fails, check that the LIB and INC lines in the Makefile correspond with your system, then try again.
make LUA_CFLAGS="$(pkg-config --cflags lua)" LUA_LIBS="$(pkg-config --libs lua)"
42
+
make install
43
+
44
+
or with luajit:
45
+
46
+
make LUA_CFLAGS="$(pkg-config --cflags luajit)" LUA_LIBS="$(pkg-config --libs luajit)"
47
+
make install
48
+
49
+
### Saving memory
50
+
51
+
To save memory (on any platform), you can choose 32-bit storage for node IDs rather than 64-bit. You will need to run `osmium renumber` or a similar tool over your .osm.pbf first. Then compile Tilemaker with an additional flag:
52
+
53
+
make CONFIG="-DCOMPACT_NODES"
54
+
make install
55
+
56
+
By default, Tilemaker uses 32-bit storage for way IDs and its internal tile index. This shouldn't cause issues with standard OSM data, but if your data needs it, you can compile with `-DFAT_WAYS` for 64-bit. If you are generating vector tiles at zoom level 17 or greater (the usual limit is 14), then compile with `-DFAT_TILE_INDEX`.
57
+
58
+
### Docker
59
+
60
+
**The Dockerfile is not formally supported by project maintainers and you are encouraged to send pull requests to fix any issues you encounter.**
61
+
62
+
Build from project root directory with:
63
+
64
+
docker build . -t tilemaker
65
+
66
+
The docker container can be run like this:
67
+
68
+
docker run -v /Users/Local/Downloads/:/srv -i -t --rm tilemaker /srv/germany-latest.osm.pbf --output=/srv/germany.mbtiles
69
+
70
+
Keep in mind to map the volume your .osm.pbf files are in to a path within your docker container, as seen in the example above.
Copy file name to clipboardExpand all lines: README.md
+25-80Lines changed: 25 additions & 80 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
-
Tilemaker
2
-
=========
1
+
# Tilemaker
3
2
4
3
Tilemaker creates vector tiles (in Mapbox Vector Tile format) from an .osm.pbf planet extract, as typically downloaded from providers like Geofabrik. It aims to be 'stack-free': you need no database and there is only one executable to install.
5
4
@@ -9,8 +8,7 @@ Tilemaker keeps nodes and ways in RAM. If you're processing a country extract or
If you're using Ubuntu 16.04, you can install Boost with `sudo apt-get install libboost-all-dev`. For 12.04 or 14.04, you'll need to install a recent Boost from [this PPA](https://launchpad.net/~ostogvin/+archive/ubuntu/tjo-develop):
38
-
39
-
sudo add-apt-repository ppa:ostogvin/tjo-develop
40
-
sudo apt-get update
41
-
sudo apt-get install libboost1.58-all-dev
42
-
43
-
Once you've installed those, then `cd` back to your Tilemaker directory and simply:
23
+
You can then simply install with:
44
24
45
25
make
46
26
sudo make install
27
+
28
+
For detailed installation instructions for your operating system, see INSTALL.md.
47
29
48
-
If it fails, check that the LIB and INC lines in the Makefile correspond with your system, then try again.
make LUA_CFLAGS="$(pkg-config --cflags lua)" LUA_LIBS="$(pkg-config --libs lua)"
59
-
make install
30
+
## Out-of-the-box setup
60
31
61
-
or with luajit:
32
+
Tilemaker comes with configuration files compatible with the popular [OpenMapTiles](https://openmaptiles.org) schema, and a demonstration map server. You'll run tilemaker to make vector tiles from your `.osm.pbf` source data. To create the tiles:
62
33
63
-
make LUA_CFLAGS="$(pkg-config --cflags luajit)" LUA_LIBS="$(pkg-config --libs luajit)"
If you want to include sea tiles, then create a directory called `coastline` in the same place you're running tilemaker from, and then save the files from https://osmdata.openstreetmap.de/download/water-polygons-split-4326.zip in it, such that tilemaker can find a file at `coastline/water_polygons.shp`.
67
40
68
-
To save memory (on any platform), you can choose 32-bit storage for node IDs rather than 64-bit. You will need to run `osmium renumber` or a similar tool over your .osm.pbf first. Then compile Tilemaker with an additional flag:
41
+
Then, to serve your tiles using the demonstration server:
69
42
70
-
make CONFIG="-DCOMPACT_NODES"
71
-
make install
43
+
cd server
44
+
ruby server.rb /path/to/your/output.mbtiles
72
45
73
-
By default, Tilemaker uses 32-bit storage for way IDs and its internal tile index. This shouldn't cause issues with standard OSM data, but if your data needs it, you can compile with `-DFAT_WAYS` for 64-bit. If you are generating vector tiles at zoom level 17 or greater (the usual limit is 14), then compile with `-DFAT_TILE_INDEX`.
46
+
You can now navigate to http://localhost:8080/and see your map!
74
47
75
-
### Docker
76
-
77
-
**The Dockerfile is not formally supported by project maintainers and you are encouraged to send pull requests to fix any issues you encounter.**
78
-
79
-
Build from project root directory with:
80
-
81
-
docker build . -t tilemaker
82
-
83
-
The docker container can be run like this:
84
-
85
-
docker run -v /Users/Local/Downloads/:/srv -i -t --rm tilemaker /srv/germany-latest.osm.pbf --output=/srv/germany.mbtiles
86
-
87
-
Keep in mind to map the volume your .osm.pbf files are in to a path within your docker container, as seen in the example above.
88
-
89
-
Configuring
90
-
-----------
48
+
## Your own configuration
91
49
92
50
Vector tiles contain (generally thematic) 'layers'. For example, your tiles might contain river, cycleway and railway layers. It's up to you what OSM data goes into each layer. You configure this in Tilemaker with two files:
93
51
94
52
* a JSON file listing each layer, and the zoom levels at which to apply it
95
53
* a Lua program that looks at each node/way's tags, and places it into layers accordingly
96
54
97
-
You can read more about these in [CONFIGURATION.md](CONFIGURATION.md). Sample files are provided to work out-of-the-box: you may find more in the `resources` directory.
98
-
99
-
Running
100
-
-------
55
+
You can read more about these in [CONFIGURATION.md](CONFIGURATION.md).
101
56
102
57
At its simplest, you can create a set of vector tiles from a .pbf with this command:
You may load multiple .pbf files in one run (for example, adjoining counties). Tilemaker does not clear the existing contents of MBTiles files, which makes it easy to load two cities into one file. This does mean you should delete any existing file if you want a fresh run.
61
+
Output can be as individual files to a directory, or to an MBTiles file aka a SQLite database (with extension .mbtiles or .sqlite). Any existing MBTiles file will be deleted (if you don't want this, specify `--merge`).
109
62
110
-
The JSON configuration and Lua processing files are specified with --config and --process respectively. Defaults are config.json and process.lua in the current directory. If there is no config.json and process.lua in the current directory, and you do not specify --config and --process, an error will result.
63
+
The JSON configuration and Lua processing files are specified with `--config` and `--process` respectively. Defaults are config.json and process.lua in the current directory. If there is no config.json and process.lua in the current directory, and you do not specify `--config` and `--process`, an error will result.
111
64
112
65
You can get a run-down of available options with
113
66
114
67
tilemaker --help
115
68
116
69
When running, you may see "couldn't find constituent way" messages. This happens when the .pbf file contains a multipolygon relation, but not all the relation's members are present. Typically, this will happen when a multipolygon crosses the border of the extract - for example, a county boundary formed by a river with islands. In this case, the river will simply not be written to the tiles.
117
70
118
-
Rendering
119
-
---------
71
+
See https://github.com/mapbox/awesome-vector-tiles for a list of renderers which support vector tiles.
120
72
121
-
That bit's up to you! See https://github.com/mapbox/awesome-vector-tiles for a list of renderers which support vector tiles.
122
-
123
-
The [Leaflet.MapboxVectorTile plugin](https://github.com/SpatialServer/Leaflet.MapboxVectorTile) is perhaps the simplest way to test out your new vector tiles.
124
-
125
-
Contributing
126
-
------------
73
+
## Contributing
127
74
128
75
Bug reports, suggestions and (especially!) pull requests are very welcome on the Github issue tracker. Please check the tracker to see if your issue is already known, and be nice. For questions, please use IRC (irc.oftc.net or http://irc.osm.org, channel #osm-dev) and http://help.osm.org.
129
76
130
-
Formatting: braces and indents as shown, hard tabs (4sp). (Yes, I know.) Please be conservative about adding dependencies.
131
-
77
+
Formatting: braces and indents as shown, hard tabs (4sp). (Yes, I know.) Please be conservative about adding dependencies or increasing the memory requirement.
132
78
133
-
Copyright and contact
134
-
---------------------
79
+
## Copyright and contact
135
80
136
81
Richard Fairhurst and contributors, 2015-2020. The tilemaker code is licensed as FTWPL; you may do anything you like with this code and there is no warranty. The included rapidjson (Milo Yip and THL A29), sqlite_modern_cpp (Amin Roosta), and sparse-map (Tessil) libraries are MIT; [kaguya](https://github.com/satoren/kaguya) is licensed under the Boost Software Licence.
0 commit comments