Mvt Decoder
object MvtDecoder
Decode the bytes of a Mapbox Vector Tile (MVT v2.1) into an MvtTile. Geometry stays in tile-local extent coordinates; conversion to lat/lon is MvtGeometry's job.
Walks the protobuf wire format directly via ProtobufReader — no codegen, no runtime.
Wire layout (only the fields we care about; unknown fields are skipped):
Tile { repeated Layer layers = 3 }
Layer { string name = 1; repeated Feature features = 2; repeated string keys = 3;
repeated Value values = 4; uint32 extent = 5; uint32 version = 15 }
Feature { uint64 id = 1; repeated uint32 tags = 2 [packed]; GeomType type = 3;
repeated uint32 geometry = 4 [packed] }
Value { string=1; float=2; double=3; int64=4; uint64=5; sint64=6; bool=7 }Content copied to clipboard
Some servers send packed repeated fields as non-packed, and some old encoders do the opposite; both forms decode identically here because appendPackedUInt32 accepts a single value (non-packed) by treating it as a one-element packed run.