v5.0.0
A rework of geojson-vt's internal data layout that cuts memory use roughly by 2–4 times on large datasets, with the same tile output.
Memory and performance
- Retained memory after building an index is 45–75% lower across the board (a 205 MB US counties GeoJSON now holds 103 MB instead of 241 MB).
- Peak memory during tile generation is 45–79% lower, so datasets that used to crash browser tabs now fit.
- Total allocation during build is 50–90% lower, meaning far less GC pressure.
- Build time for point datasets is 50–70% faster. Line and polygon datasets are within roughly 10% of v4 on default settings.
API changes
- Breaking: the default export is now a class. Replace
geojsonvt(data, options)withnew GeoJSONVT(data, options). The browser global is renamed fromgeojsonvttoGeoJSONVT. - Breaking:
getTilereturns{features}only. Internal fields likenumPoints,source,x,y,zare no longer exposed on the result. - New
getTileRaw(z, x, y)returns the tile as stored: flat[x, y, x, y, ...]typed arrays with no per-coordinate objects. Zero-copy, read-only, and much cheaper thangetTilefor renderers that can consume flat coordinates. - TypeScript declarations ship with the package. Remove
@types/geojson-vtif you have it installed.
Fixes
- A point lying exactly on a shared tile edge now appears in exactly one tile instead of both.
- Polygons straddling tile boundaries no longer produce degenerate single-vertex rings at high zooms.
- Empty parts in a MultiPolygon are skipped instead of breaking the feature.
- Geometries with missing coordinates throw the standard invalid-GeoJSON error instead of an opaque TypeError.
- Tile coordinates may differ from v4 by a single pixel in rare cases due to integer coordinate storage. Output is otherwise identical.