vectortile-rs
Rust library for building Mapbox Vector Tiles from PostGIS. This library was adapted from the MVT implementation in Pirmin Kalberer's t-rex server, with changes intended to improve usage ergonamics.
Usage
Put this in your Cargo.toml:
[]
= "0.2.1"
And this in your crate root:
extern crate vectortile;
Example
See examples/streets.rs for a full example w/ PostGIS.
This example shows creating Features and Tiles programmatically:
use ;
use ;
use ;
use ewkb;
// Build a new tile, the hard way
let bbox = Extent;
let mut tile = new;
let mut layer = new;
tile.add_layer;
// Add a new point feature "Ed's Mospresso Shack"
let geom: Geometry = Point;
let mut feature = new;
feature.add_property;
feature.add_property;
layer.add_feature;
// Encode the tile as protobuf and inspect it
let grid = wgs84;
let data = tile.encode;
println!;