GithubHelp home page GithubHelp logo

00mjk / t-rex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from t-rex-tileserver/t-rex

0.0 0.0 0.0 16.79 MB

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

Home Page: https://t-rex.tileserver.ch/

License: MIT License

Rust 98.63% Makefile 0.80% Shell 0.04% HTML 0.14% Dockerfile 0.39%

t-rex's Introduction

t-rex

CI build status Language (Rust) Discord Chat docker

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

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

Examples

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

Software Requirements

Ubuntu 20.04 (Focal Fossa):

sudo apt install cargo libssl-dev libgdal-dev

Build and run

Build:

cargo build

Run tests:

cargo test --all

Run server with DB connection:

cargo run -- serve --dbconn postgresql://t_rex:[email protected]:5439/t_rex_tests

Decode a vector tile:

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

Database tests

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

Start Test DB:

docker run -p 127.0.0.1:5439:5432 -d --name trextestdb --rm sourcepole/trextestdb

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

export DBCONN=postgresql://t_rex:[email protected]:5439/t_rex_tests

Run the tests with

cargo test --all -- --ignored

Creating test database locally:

# Set Postgresql environment variables when needed: PGHOST, PGPORT, PGUSER, PGPASSWORD
cd data
make createdb loaddata

S3 tests

Unit tests which need a S3 connection are skipped by default.

Install MinIO Client.

Start Test S3

docker run -d --rm -p 9000:9000 -e MINIO_REGION_NAME=my-region -e MINIO_ACCESS_KEY=miniostorage -e MINIO_SECRET_KEY=miniostorage minio/minio server /data && sleep 5 && mc config host add local-docker http://localhost:9000 miniostorage miniostorage && mc mb local-docker/trex && mc policy set download local-docker/trex 

To run the S3 tests, declare that there is a S3 available in an environment vaiable S3TEST:

export S3TEST=true

Run the tests with

cargo test --all -- --ignored

License

t-rex is released under the MIT License.

t-rex's People

Contributors

allanin avatar amandasaurus avatar apezel avatar arbakker avatar blesss avatar dependabot-preview[bot] avatar frodrigo avatar gerdos82 avatar joostvenema avatar jpbede avatar kiambogo avatar lnicola avatar malthe avatar nimix avatar pka avatar sebastian-r-schmidt avatar tobwen avatar woutervisscher avatar wykks avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.