Tilemaker Tips

Slight tweak to the Docker file to get the repo by itself
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM debian:bullseye-slim
LABEL Description="Tilemaker" Version="1.4.0"

ARG DEBIAN_FRONTEND=noninteractive

# install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential liblua5.1-0 liblua5.1-0-dev libprotobuf-dev libsqlite3-dev protobuf-compiler shapelib libshp-dev libboost-program-options-dev libboost-filesystem-dev libboost-system-dev libboost-iostreams-dev rapidjson-dev git ca-certificates

# COPY . /
WORKDIR /opt/apps

RUN git clone https://github.com/systemed/tilemaker.git && \
cd tilemaker && \
make && \
make install && \
# clean up, remove build-time only dependencies
rm -rf /var/lib/apt/lists/* && \
apt-get purge -y --auto-remove build-essential liblua5.1-0-dev git

ENTRYPOINT ["tilemaker"]
fetching, chopping, and making tiles
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
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset

#####################################################################
## Clean up
#####################################################################
echo "Remove us-south..."
if [ -f us-south-latest.osm.pbf ] ; then
rm -f us-south-latest.osm.pbf
fi

echo "Remove vector tiles..."
if [ -f tiles.mbtiles ] ; then
rm -f tiles.mbtiles
fi

echo "Removing meck.osm.pbf..."
if [ -f meck.osm.pbf ] ; then
rm -f meck.osm.pbf
fi

######################################################################
## Fetch and clip OSM data
######################################################################
echo "Getting OSM data..."
wget http://download.geofabrik.de/north-america/us-south-latest.osm.pbf -q --show-progress

echo "Clipping PBF..."
./osmconvert64 us-south-latest.osm.pbf -b=-82.641,34.125,-79.008,36.762 --complex-ways -o=meck.osm.pbf

######################################################################
## Run Tile Generator
######################################################################
docker run -v $(pwd):/srv -i -t --rm tilemaker /srv/meck.osm.pbf --config=/srv/config-openmaptiles.json --process=/srv/process-openmaptiles.lua --output=/srv/tiles.mbtiles