@poopdeck.gl/core
v0.4.0
Published
Core TypeScript library for reading spatiotemporal tiles
Maintainers
Readme
@poopdeck.gl/core
The framework-free TypeScript core for SpatioTemporal Tiles (STT): the
packed-archive reader, the tile decoder, the viewport + time-aware tileset,
and the render kernel every renderer backend
(@poopdeck.gl/{layers,three,maplibre,cesium}) is built on.
Install
npm install @poopdeck.gl/coreNo peer dependencies — the only runtime deps are apache-arrow, earcut,
and fzstd.
Hello world — open an archive, decode a tile
import { STTArchive } from "@poopdeck.gl/core";
const archive = new STTArchive("https://tiles.example.com/earthquakes/manifest.json");
const meta = await archive.getMetadata();
// Tile ids are {z, x, y, t} — t is the temporal-bucket start (Unix ms).
const ids = await archive.getTileIdsInBounds(meta.bounds, meta.minZoom, meta.timeRange);
const tile = await archive.getTile(ids[0]); // fetched, decompressed, decoded
for (const layer of tile?.layers ?? []) {
console.log(layer.name, layer.features.featureCount, "features");
}For streaming a live viewport + playhead (selection, prefetch, eviction,
buffered-runway events), wrap the archive in a SpatiotemporalTileset:
import { SpatiotemporalTileset } from "@poopdeck.gl/core";
import { makeTilesetCallbacks } from "@poopdeck.gl/core/tileset-adapter";
const tileset = new SpatiotemporalTileset({
minZoom: meta.minZoom,
maxZoom: meta.maxZoom,
temporalBucketMs: meta.temporalBucketMs,
...makeTilesetCallbacks(archive),
onTileLoad: (tile) => render(tile.layers), // BinaryFeatures: GPU-ready columns
});
tileset.update({ bounds, zoom, time, timeWindow });What's in the box
- Reader —
STTArchive(packed manifest + paged directory + per-pack Range requests),SpatiotemporalTileset(selection, prefetch, eviction, buffered-runway events),TileDecoder(inline or worker-pool). BinaryFeatures— the decoded, columnar, zero-copy tile payload (positions, times, per-vertex values, vector groups, triangles).- Render kernel — framework-free subpaths (
core/time-filter,core/style,core/geometry,core/geo,core/picking,core/tileset-adapter,core/shader-codegen,core/capabilities) shared by all four renderer backends.
Docs
MIT.
