Core Package Overview
The @spatialdata/core package provides a TypeScript/JavaScript interface for reading and working with SpatialData Zarr stores. It mostly mirrors the Python library's API design while adapting to TypeScript idioms and the asynchronous nature of browser-based data loading. Hot paths (parquet decode) use WASM behind TypeScript interfaces.
Element Classes
Each element type in a SpatialData store is represented by a typed class that provides access to metadata, coordinate transformations, and data loading methods.
Loading points and shapes
Points and shapes are parquet-backed and can be large. Both are read lazily,
Coordinate Transformations
Coordinate transformations are fundamental to SpatialData, allowing different elements to be placed in shared coordinate systems. The @spatialdata/core package aims to provide a comprehensive implementation of transformation classes that can be represented in the standard.
Error Handling
The @spatialdata/core package uses a Result type pattern inspired by Rust for explicit error handling. This approach makes error cases visible in the type system and avoids unexpected exceptions.
Element Issues
Some stores are slow or awkward however well the client behaves, because of how they are laid out on disk. An element reports these as issues: structured facts about the store that a host can show next to the element list or word its own way. The data conforms to the spec; it just has a caveat.
Resource Resolver
The Resource Resolver turns the entries of a Render Stack
Internals & Architecture
This page documents internal implementation details of @spatialdata/core. These APIs are not part of the public interface and may change without notice.