geo2mvt
A Go program that converts a GeoJSON object into a Mapbox vector tile (mvt) object.
This tool is powered by orb.
Prerequisites
You need the following software installed,
-
Run go build
.
go build
-
You will find geo2mvt
in this directory.
geo2mvt -x X -y Y -z ZOOM INPUT OUTPUT
Parameters
X
: x coordinate of a tile to be generated.
Y
: y coordinate of a tile to be generated.
ZOOM
: zoom of a tile to be generated.
INPUT
: path to an input JSON file.
OUTPUT
: path to an output map vector tile file, which is a zipped PBF file.
As a Mapbox's map vector tile can contain multiple layers in a single tile, an input JSON file, multilayer GeoJSON file, can contain multiple GeoJSON objects inside.
It associates a layer name with a corresponding GeoJSON object.
A multilayer GeoJSON file looks like the following,
{
"layers-1": {
// GeoJSON object
},
"layers-2": {
// GeoJSON object
}, ...
}