| Crates.io | mvt-wrangler |
| lib.rs | mvt-wrangler |
| version | 0.1.1 |
| created_at | 2025-09-18 06:28:28.152885+00 |
| updated_at | 2025-09-22 06:38:14.653552+00 |
| description | A high-performance Rust tool for processing and transforming Mapbox Vector Tiles (MVT) with advanced filtering capabilities. Apply sophisticated spatial and attribute-based filters to slim down your tiles. |
| homepage | |
| repository | https://github.com/KotobaMedia/mvt-wrangler |
| max_upload_size | |
| id | 1844291 |
| size | 122,781 |
A high-performance Rust tool for processing and transforming Mapbox Vector Tiles (MVT) with advanced filtering capabilities. Apply sophisticated spatial and attribute-based filters to slim down your tiles.
For example, I'm a big fan of Protomaps' tiles generated from OpenStreetMap, but when serving tiles to Japanese customers, there are a couple things that need to be tweaked (sensitive areas, removing data that won't be shown anyways, etc..). Instead of downloading and reprocessing all the tiles from scratch, this tool takes in an already-built PMTiles archive, applies the desired filters, and outputs the filtered tiles.
MVT Wrangler reads PMTiles files (containing MVT data) and outputs filtered PMTiles databases. It provides a powerful filtering system that allows you to:
Pre-compiled binaries available in GitHub Releases
git clone https://github.com/KotobaMedia/mvt-wrangler.git
cd mvt-wrangler
cargo build --release
The compiled binary will be available at target/release/mvt-wrangler.
mvt-wrangler <input.pmtiles> <output.pmtiles> [--filter <filter.geojson>] [--name <string>] [--description <string>] [--attribution <string>]
input: Path to the input PMTiles fileoutput: Path for the output PMTiles file (will be overwritten if it exists)--filter / -f: Optional path to a GeoJSON filter file--name / -n: Set TileJSON name--description / -N: Set TileJSON description--attribution / -A: Set TileJSON attributionmvt-wrangler input.pmtiles output.pmtiles
mvt-wrangler input.pmtiles output.pmtiles --filter my-filter.geojson
# Set display name, description and attribution
mvt-wrangler input.pmtiles output.pmtiles \
--name "My Tiles" \
--description "Filtered tileset" \
--attribution "© Me"
The tool supports sophisticated filtering through GeoJSON filter files. See FILTERING.md for complete documentation.
Create a filter file remove-parks.geojson:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[
[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]
]]
},
"properties": {
"id": "global-park-filter",
"description": "Remove all park features worldwide",
"layers": {
"*": {
"feature": [
"in",
["tag", "kind"],
["literal", ["park", "recreation_ground"]]
]
}
}
}
}
]
}
Then apply it:
mvt-wrangler input.pmtiles clean-output.pmtiles --filter remove-parks.geojson
==, !=, <, >, etc.)any, all, none, not)starts-with, ends-with, regex-match, regex-capture)in)["==", ["type"], "Point"]
["in", ["tag", "amenity"], ["literal", ["parking", "fuel"]]]
["starts-with", ["key"], "name:"]
["all",
["==", ["type"], "LineString"],
["in", ["tag", "highway"], ["literal", ["residential", "tertiary"]]]
]
The tool is optimized for processing large tile sets:
The output PMTiles file follows the PMTiles specification.
This tool uses the pmtiles-rs library. When pmtiles-rs gains support for pmtiles writing, this tool will also switch to pmtiles output.
Remove unwanted features or properties from vector tiles:
# Remove all POI features globally
mvt-wrangler source.pmtiles clean.pmtiles --filter remove-pois.geojson
Strip personally identifiable information:
# Remove all name tags starting with personal prefixes
mvt-wrangler source.pmtiles anonymized.pmtiles --filter remove-personal-names.geojson
Reduce tile size by removing unnecessary attributes:
# Keep only essential properties for rendering
mvt-wrangler full.pmtiles minimal.pmtiles --filter essential-only.geojson
This project is licensed under the MIT License. See the LICENSE file for details.