@poopdeck.gl/core
v0.8.0
Published
Core TypeScript library for reading spatiotemporal tiles
Maintainers
Readme
@poopdeck.gl/core
Status: stable, pre-1.0. See the support and compatibility policy.
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 used by the published renderer packages
(@poopdeck.gl/{layers,three,maplibre}) and the experimental, workspace-only
Cesium backend.
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 every renderer backend.
Docs
MIT.
