t-rex

Create and serve your own vector tiles

Setup

Installation

Ubuntu

t-rex requires libgdal20. For Xenial or older you can add UbuntuGIS PPA Stable or Unstable.

Install GDAL 2.x library:

sudo apt-get install libgdal20

Download and install DEB package from github.com:

curl -O -L https://github.com/t-rex-tileserver/t-rex/releases/download/v0.9.0/t-rex-v0.9.0-x86_64-unknown-linux-gnu.deb && sudo dpkg -i t-rex-v0.9.0-x86_64-unknown-linux-gnu.deb

Windows

Download MSI installer from github.com:

t-rex-v0.9.0.msi

Double click to install (needs Administrator permissions).

Run in Command Prompt window:

"%programfiles%\t-rex\t_rex"

Docker

Install Docker on your platform.

Download and run the t-rex Docker image:

docker pull sourcepole/t-rex
docker run sourcepole/t-rex --version
docker run -p 6767:6767 sourcepole/t-rex serve --bind=0.0.0.0 --openbrowser=false --config=myconfig.toml

The process is running as user www-data with the working directory /var/data/in. For output, a volume /var/data/out is available.

Example using input and output volumes (Unix):

docker run -p 6767:6767 -v $PWD:/var/data/in:ro -v /tmp:/var/data/out sourcepole/t-rex serve --bind=0.0.0.0 --openbrowser=false --config=myconfig.toml

Current directory on Windows:

docker run -p 6767:6767 -v %CD%:/var/data/in:ro sourcepole/t-rex serve --bind=0.0.0.0 --openbrowser=false --config=myconfig.toml

Upgrading

See the Changelog for breaking changes in new versions.

0.7.x -> 0.8.0

Conversion to new datasource syntax:

sed -e 's/\[datasource\]/[[datasource]]/g' \
    -e '/type = "postgis"/d' \
    -e 's/url =/dbconn =/g' \
    infile.toml