t-rex is a vector tile server specialized on publishing MVT tiles from your own data
Rust Shell Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ci Setup test DB from GeoPackage Jul 12, 2018
doc Remove presentation slides - moved to t-rex.tileserver.ch Sep 10, 2017
examples Minor stylejson update Feb 8, 2018
packaging
src Add no-transform "fake mercator" mode Jul 20, 2018
t-rex-core Add no-transform "fake mercator" mode Jul 20, 2018
t-rex-gdal Add no-transform "fake mercator" mode Jul 20, 2018
t-rex-service Return 204 No Content for empty tiles Jul 20, 2018
t-rex-webserver Return 204 No Content for empty tiles Jul 20, 2018
.gitignore Put user defined grid definition into [user.grid] Sep 17, 2017
.travis.yml
CHANGELOG.md Setup test DB from GeoPackage Jul 12, 2018
Cargo.lock cargo update Jul 6, 2018
Cargo.toml Migrate to actix-web Jun 13, 2018
LICENSE Include MIT License May 13, 2016
README.md Setup test DB from GeoPackage Jul 12, 2018
appveyor.yml Build MSI with GDAL on Appveyor Sep 3, 2017

README.md

t-rex

Travis build Status Appveyor build status Language (Rust)

t-rex is a vector tile server specialized on publishing MVT tiles from your own data.

Features

  • Support for PostGIS databases and GDAL vector formats
  • Auto-detection of layers in data source
  • Built-in viewers for data display and inspection
  • Tile generation command with simple parallelization
  • Automatic reprojection to grid CRS
  • Support for custom tile grids
  • Embedded styles

Presentations

  • T-rex, a vector tile server for your own data (FOSS4G 2017): slides
  • Vector Tiles - Introduction & Usage with QGIS (User meeting Bern 21.6.17): slides
  • Von WMS zu WMTS zu Vektor-Tiles (FOSSGIS 2017): Video
  • Workshop "Vector Tiles" (GEOSummit Bern 7.6.16): slides

Usage

Quick tour

t_rex serve --dbconn postgresql://user:pass@localhost/osm2vectortiles

Tiles are then served at http://localhost:6767/{layer}/{z}/{x}/{y}.pbf

A list of all detected layers is available at http://localhost:6767/

Use a tile cache:

t_rex serve --dbconn postgresql://user:pass@localhost/osm2vectortiles --cache /tmp/mvtcache

Generate a configuration template:

t_rex genconfig --dbconn postgresql://user:pass@localhost/osm2vectortiles | tee osm2vectortiles.toml

Run server with configuration file:

t_rex serve --config osm2vectortiles.toml

Generate tiles for cache:

t_rex generate --config osm2vectortiles.toml

Increase log level:

t_rex serve --loglevel debug --dbconn postgresql://user:pass@localhost/osm2vectortiles

For developers

t-rex is written in Rust. Minimal required rustc version is 1.26.

Build:

cargo build

Run tests:

cargo test --all

Run server:

cargo run -- serve --dbconn postgresql://$USER@%2Frun%2Fpostgresql/natural_earth_vectors

Decode a vector tile:

curl --silent http://127.0.0.1:6767/ne_10m_populated_places/5/31/17.pbf | gunzip -d | protoc --decode=vector_tile.Tile src/mvt/vector_tile.proto

Database tests

Unit tests which need a PostgreSQL connection are ignored by default.

To run the database tests, declare the connection in an environment variable DBCONN. Example:

export DBCONN=postgresql://$USER@%2Frun%2Fpostgresql/natural_earth_vectors

Creating test database:

# Set Postgresql environment variables when needed: PGHOST, PGPORT, PGUSER, PGPASSWORD
cd t-rex-service/src/test
make createdb loadfromgpkg

Run the tests with

cargo test --all -- --ignored

Roadmap

See Github board

License

t-rex is released under the MIT License.