@cereusdb/full
v0.1.0
Published
Full CereusDB browser package with GEOS, PROJ, GDAL, and S2 geography support
Maintainers
Readme
@cereusdb/full
Maximum-feature CereusDB browser package. Everything in @cereusdb/global, plus GDAL-backed raster ingestion and the full current RS_* runtime catalog.
Install
npm install @cereusdb/fullSQL function availability
Current runtime surface:
132runtimeST_*names33runtimeRS_*names
Included function families:
- Everything from
@cereusdb/global: core SedonaDB functions,geofunctions, GEOS predicates/operations,ST_Transform, S2 geography kernels, relation joins, distance joins, andST_KNN. - Raster registration through the host API and the full current browser raster catalog.
Examples of available raster functions:
RS_WidthRS_HeightRS_NumBandsRS_BandPixelTypeRS_CRSRS_GeoReferenceRS_PixelAsPointRS_PixelAsPolygonRS_ContainsRS_IntersectsRS_Within
Raster ingestion notes:
registerGeoTIFF()andregisterRaster()are supported in this package.registerFile()supports.tifand.tiffin addition to Parquet and GeoJSON.- The current browser raster path is host-driven; SQL-side raster loader functions are not exposed.
JS / TS API
Exports:
CereusDBCereusDBOptionsRasterFormatQueryResult
Main types:
type RasterFormat = 'geotiff' | 'tiff';
interface CereusDBOptions {
wasmUrl?: string;
wasmSource?:
| RequestInfo
| URL
| Response
| BufferSource
| WebAssembly.Module
| Promise<Response>;
}Main API:
class CereusDB {
static create(options?: CereusDBOptions): Promise<CereusDB>;
sql(query: string): Promise<Uint8Array>;
sqlJSON(query: string): Promise<Record<string, unknown>[]>;
registerRemoteParquet(name: string, url: string): Promise<void>;
registerFile(name: string, file: File): Promise<void>;
registerGeoJSON(name: string, geojson: string | object): void;
registerRaster(name: string, data: BufferSource, format: RasterFormat): void;
registerGeoTIFF(name: string, data: BufferSource): void;
dropTable(name: string): void;
tables(): string[];
version(): string;
}API notes:
sql()returns Arrow IPC bytes asUint8Array.sqlJSON()returns parsed JSON rows.registerFile()supports.parquet,.geoparquet,.geojson,.json,.tif, and.tiff.registerRaster()currently acceptsgeotiffandtiff.
Example
import { CereusDB } from '@cereusdb/full';
const db = await CereusDB.create();
db.registerGeoTIFF('raster', bytes);
const rows = await db.sqlJSON(`
SELECT RS_Width(raster) AS width, RS_Height(raster) AS height
FROM raster
`);
console.log(rows);