Skip to main content

Crate manby

Crate manby 

Source
Expand description

manby builds vector tilesets from geographic features, like tippecanoe, but several times faster. See DESIGN.md.

run takes Options and writes the tileset, and join() takes JoinOptions and joins tilesets as tippecanoe’s tile-join does. Nothing in manby exits the process; errors come back as Error, with the exit status tippecanoe would use.

The options are tippecanoe’s, so its command line is the shortest way to them:

let args = ["manby", "-zg", "--drop-densest-as-needed", "-o", "places.pmtiles", "places.geojson"];
let options = manby::options::parse_args(&args.map(String::from))?;
let summary = manby::run(&options)?;
println!("{} tiles, to zoom {}", summary.tiles, summary.maxzoom);

They are also fields, set on the defaults:

use manby::options::Output;

let mut options = manby::Options::default();
options.inputs = vec!["places.geojson".to_string()];
options.output = Output::Pmtiles("places.pmtiles".to_string());
options.maxzoom = 12;
manby::run(&options)?;

§What is public

The API is what these pages show: run and join() with their options and summaries, and the commands in stats, serve and overzoom. The options and summaries are #[non_exhaustive], since each new option is a new field. Some fields have types of tippecanoe-rs, which is tippecanoe here.

manby’s other modules are public for its own tests, examples and benchmarks. They are hidden from these pages and can change in any release.

§One run at a time

The code that manby borrows from tippecanoe-rs reads its options from globals, which each run sets, and the memory budget is the process’s. Runs in one process should take turns unless their options are the same.

Re-exports§

pub use error::Error;
pub use error::Result;
pub use join::JoinOptions;
pub use join::JoinSummary;
pub use join::join;
pub use options::Options;
pub use shard::MergeOptions;
pub use shard::MergeSummary;
pub use shard::merge;
pub use tippecanoe;

Modules§

error
Errors. Each carries the exit status tippecanoe would use for the same problem, so the command can exit the way tippecanoe does.
join
manby join: tippecanoe’s tile-join, making the same tiles faster. See DESIGN.md.
options
Everything a run needs to know, parsed from tippecanoe’s command line options or filled in by a library user. Replaces tippecanoe’s global variables.
overzoom
manby overzoom, tippecanoe-overzoom: copies of tippecanoe-rs’s overzoom.rs and of the overzoom_source_tiles it runs, from clip.rs, with manby’s feature filters (crate::filter), so that like, ilike and intersects work in them. intersects is tested against each feature’s geometry as clipped to the new tile.
serve
manby serve: serves tilesets over HTTP while they are made and looked at, with a map of them at /. Each tileset is served as tiles at /{name}/{z}/{x}/{y}.mvt (.mlt for MapLibre Tiles), with its TileJSON at /{name}.json, and a PMTiles archive also as itself, by its file name, with range requests, for maps that read PMTiles. Every response allows any origin and is not to be cached, so a tileset made again shows when the map is reloaded.
shard
Builds split across machines. See DESIGN.md.
stats
manby stats: how big a tileset’s tiles are at each zoom, as stored, and with --layers how many features of each layer the tiles at each zoom hold, which shows where tippecanoe’s dropping and coalescing took effect. The sizes of a PMTiles archive come from its directories alone. A run of identical tiles counts as that many tiles of the run’s size, which is what a map fetches rather than what is on disk.

Structs§

Filter
A parsed feature filter.
Summary
What a run produced.

Enums§

MltProfile
Which encodings the MLT encoder may use, by the clients the tiles are for.
TileFormat
The tile encoding manby writes.

Functions§

run
Reads the inputs, tiles them and writes the tileset that options describes.