Skip to content

Commit 002e719

Browse files
committed
Update readme, plus out-of-the-box server
1 parent df572b2 commit 002e719

1,289 files changed

Lines changed: 6033 additions & 146 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

INSTALL.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Installing Tilemaker
2+
3+
### macOS
4+
5+
Install all dependencies with Homebrew:
6+
7+
brew install protobuf boost lua51 shapelib
8+
9+
Then:
10+
11+
make
12+
sudo make install
13+
14+
### Ubuntu
15+
16+
Start with:
17+
18+
sudo apt-get install build-essential liblua5.1-0 liblua5.1-0-dev libprotobuf-dev libsqlite3-dev protobuf-compiler shapelib libshp-dev
19+
20+
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.
32+
33+
### Fedora
34+
35+
Start with:
36+
37+
dnf install lua-devel luajit-devel sqlite-devel protobuf-devel protobuf-compiler shapelib-devel
38+
39+
then build either with lua:
40+
41+
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.

README.md

Lines changed: 25 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Tilemaker
2-
=========
1+
# Tilemaker
32

43
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.
54

@@ -9,8 +8,7 @@ Tilemaker keeps nodes and ways in RAM. If you're processing a country extract or
98

109
![Continuous Integration](https://github.com/systemeD/tilemaker/workflows/Continuous%20Integration/badge.svg)
1110

12-
Installing
13-
----------
11+
## Installing
1412

1513
Tilemaker is written in C++11. The chief dependencies are:
1614

@@ -22,116 +20,63 @@ Tilemaker is written in C++11. The chief dependencies are:
2220

2321
rapidjson, sqlite_modern_cpp, clipper, kaguya and sparse-map are bundled in the include/ directory.
2422

25-
### OS X
26-
27-
Install all dependencies with Homebrew:
28-
29-
brew install protobuf boost lua51 shapelib
30-
31-
### Ubuntu
32-
33-
Start with:
34-
35-
sudo apt-get install build-essential liblua5.1-0 liblua5.1-0-dev libprotobuf-dev libsqlite3-dev protobuf-compiler shapelib libshp-dev
36-
37-
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:
4424

4525
make
4626
sudo make install
27+
28+
For detailed installation instructions for your operating system, see INSTALL.md.
4729

48-
If it fails, check that the LIB and INC lines in the Makefile correspond with your system, then try again.
49-
50-
### Fedora
51-
52-
Start with:
53-
54-
dnf install lua-devel luajit-devel sqlite-devel protobuf-devel protobuf-compiler shapelib-devel
55-
56-
then build either with lua:
57-
58-
make LUA_CFLAGS="$(pkg-config --cflags lua)" LUA_LIBS="$(pkg-config --libs lua)"
59-
make install
30+
## Out-of-the-box setup
6031

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:
6233

63-
make LUA_CFLAGS="$(pkg-config --cflags luajit)" LUA_LIBS="$(pkg-config --libs luajit)"
64-
make install
34+
tilemaker tilemaker --input /path/to/your/input.osm.pbf \
35+
--output /path/to/your/output.mbtiles \
36+
--config resources/config-openmaptiles.json \
37+
--process resources/process-openmaptiles.lua
6538

66-
### Saving memory
39+
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`.
6740

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:
6942

70-
make CONFIG="-DCOMPACT_NODES"
71-
make install
43+
cd server
44+
ruby server.rb /path/to/your/output.mbtiles
7245

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!
7447

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
9149

9250
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:
9351

9452
* a JSON file listing each layer, and the zoom levels at which to apply it
9553
* a Lua program that looks at each node/way's tags, and places it into layers accordingly
9654

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).
10156

10257
At its simplest, you can create a set of vector tiles from a .pbf with this command:
10358

104-
tilemaker liechtenstein-latest.osm.pbf --output=tiles/
105-
106-
Output can be as individual files to a directory, or to an MBTiles file aka a SQLite database (with extension .mbtiles or .sqlite).
59+
tilemaker liechtenstein-latest.osm.pbf --output=liechtenstein.mbtiles
10760

108-
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`).
10962

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.
11164

11265
You can get a run-down of available options with
11366

11467
tilemaker --help
11568

11669
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.
11770

118-
Rendering
119-
---------
71+
See https://github.com/mapbox/awesome-vector-tiles for a list of renderers which support vector tiles.
12072

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
12774

12875
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.
12976

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.
13278

133-
Copyright and contact
134-
---------------------
79+
## Copyright and contact
13580

13681
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.
13782

resources/mbtileserver.rb

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)