{"id":48976176,"url":"https://github.com/tobilg/cereusdb","last_synced_at":"2026-04-18T09:06:46.244Z","repository":{"id":350867446,"uuid":"1185347405","full_name":"tobilg/cereusdb","owner":"tobilg","description":"A custom Wasm build of SedonaDB","archived":false,"fork":false,"pushed_at":"2026-04-12T13:30:01.000Z","size":433,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-12T15:24:04.840Z","etag":null,"topics":["database","sedonadb","spatial","wasm"],"latest_commit_sha":null,"homepage":"https://cereusdb-api.gh.tobilg.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tobilg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-18T13:45:34.000Z","updated_at":"2026-04-12T13:30:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tobilg/cereusdb","commit_stats":null,"previous_names":["tobilg/cereusdb"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tobilg/cereusdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Fcereusdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Fcereusdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Fcereusdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Fcereusdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobilg","download_url":"https://codeload.github.com/tobilg/cereusdb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Fcereusdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31962892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","sedonadb","spatial","wasm"],"created_at":"2026-04-18T09:06:45.502Z","updated_at":"2026-04-18T09:06:46.231Z","avatar_url":"https://github.com/tobilg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CereusDB\n\nA custom WebAssembly (Wasm) build of [Apache SedonaDB](https://github.com/apache/sedona-db) for browser-side spatial SQL. \n\n\u003e Named for the desert cactus genus Cereus (/ˈsɪəriəs/ — \"serious\"), a nod to its Sedona roots.\n\n## Overview\n\nCereusDB compiles SedonaDB's spatial SQL engine (built on [Apache DataFusion](https://datafusion.apache.org/) and [Apache Arrow](https://arrow.apache.org/)) to WebAssembly, with optional GEOS, PROJ, GDAL, and opt-in S2 geography support cross-compiled via Emscripten.\n\nThe repository keeps upstream sources in git submodules and applies local WASM\ncompatibility changes from `patches/` into generated trees under\n`build/patched-sources/`.\n\nThe public WASM packages now enable SedonaDB's spatial join planner path,\nincluding relation joins, distance joins, and `ST_KNN`, in a constrained\nbrowser MVP: single-partition, in-memory, sequential refinement, with no\nspill-to-disk or out-of-core execution.\n\n## API Docs\n\nThe TypeScript API docs can be found at [cereusdb-api.gh.tobilg.com](https://cereusdb-api.gh.tobilg.com).\n\n## Playground\n\nThe interactive Playground fro CereusDB can be found at [cereusdb-playground.gh.tobilg.com](https://cereusdb-playground.gh.tobilg.com).\n\n### Browser packages\n\n| Build | Features | Raw size | Gzipped | Brotli |\n|---|---|---|---|---|\n| `minimal` | Core + `geo` + GEOS + spatial joins / `ST_KNN` MVP | 21.3 MB | 6.2 MB | 4.0 MB |\n| `standard` | `minimal` + PROJ / `ST_Transform` | 40.6 MB | 10.8 MB | 6.0 MB |\n| `global` | `standard` + opt-in S2 geography kernels | 42.9 MB | 11.8 MB | 6.7 MB |\n| `full` | `global` + GDAL-backed raster ingestion and the full current local `RS_*` catalog | 49.5 MB | 14.4 MB | 8.5 MB |\n\n`full` is the maximum browser build target. It now combines GEOS, PROJ, S2, and GDAL. It adds browser-side GeoTIFF/TIFF upload plus the full current SedonaDB/Rust raster SQL surface (`33` `RS_*` functions), including `RS_Contains`, `RS_Intersects`, and `RS_Within`. Raster ingestion remains host-driven through `registerGeoTIFF()` / `registerRaster()`. SQL-side raster loader functions are not exposed in the browser WASM build.\n\nS2 geography is available in `global` and `full`. The\nverified native `sedona-s2geography` scalar kernel family is exposed there,\nplus the S2-backed `sd_order` override for lon/lat geography values.\n\n### npm packages\n\nEach public browser artifact is published as its own npm package:\n\n| Package | Build |\n|---|---|\n| [`@cereusdb/minimal`](https://www.npmjs.com/package/@cereusdb/minimal) | `minimal` |\n| [`@cereusdb/standard`](https://www.npmjs.com/package/@cereusdb/standard) | `standard` |\n| [`@cereusdb/global`](https://www.npmjs.com/package/@cereusdb/global) | `global` |\n| [`@cereusdb/full`](https://www.npmjs.com/package/@cereusdb/full) | `full` |\n\nThe repository also contains two private Pages-deployed apps under `packages/`:\n\n- `packages/documentation` for the Typedoc site\n- `packages/playground` for the interactive browser playground built on `@cereusdb/minimal`\n\n### Spatial join MVP limits\n\nRegular spatial joins, distance joins, and `ST_KNN` are enabled in `minimal`,\n`standard`, `global`, and `full`, but the browser runtime intentionally stays on a\nconstrained execution profile:\n\n- one spatial partition\n- in-memory only\n- sequential refinement\n- no spill files\n- no out-of-core multi-partition spatial join execution\n\nVerified relation predicates through `SpatialJoinExec` currently include:\n`ST_Intersects`, `ST_Contains`, `ST_Within`, `ST_Covers`, `ST_CoveredBy`,\n`ST_Touches`, `ST_Crosses`, `ST_Overlaps`, and `ST_Equals`.\n\nVerified distance join forms currently include:\n`ST_DWithin(left.geom, right.geom, literal_distance)` and\n`ST_Distance(left.geom, right.geom) \u003c literal_distance`.\n\nThe browser KNN contract currently includes:\n- `ST_KNN(query_geom, object_geom)`\n- `ST_KNN(query_geom, object_geom, k)`\n- `ST_KNN(query_geom, object_geom, k, use_spheroid_literal)`\n\nThe current browser MVP does not support non-literal `k`, non-literal\n`use_spheroid`, geography inputs to `ST_KNN`, or `OR`-composed `ST_KNN`\npredicates.\n\n## Quick start\n\n```javascript\nimport { CereusDB } from '@cereusdb/standard';\n\nconst db = await CereusDB.create();\n\n// Spatial query\nconst result = await db.sqlJSON(\n  \"SELECT ST_AsText(ST_Buffer(ST_Point(0, 0), 1.0)) AS buffered\"\n);\nconsole.log(result);\n\n// CRS transformation (standard, global, or full build)\nconst projected = await db.sqlJSON(`\n  SELECT ST_AsText(ST_Transform(\n    ST_GeomFromWKT('POINT(13.4 52.5)'),\n    'EPSG:4326', 'EPSG:3857'\n  )) AS result\n`);\n\n// Load remote Parquet\nawait db.registerRemoteParquet('cities', 'https://example.com/cities.parquet');\nconst cities = await db.sqlJSON(\"SELECT * FROM cities WHERE ST_Within(geometry, ST_Buffer(ST_Point(13.4, 52.5), 0.5))\");\n```\n\nFor local browser examples without npm packaging, the generated wasm-bindgen\nloader remains available under `dist/\u003cpackage\u003e/cereusdb.js` and the `pkg/`\nsymlink points at the most recently built artifact.\n\n## API\n\n| Method | Description |\n|---|---|\n| `CereusDB.create()` | Create a new instance with all spatial functions registered |\n| `db.sql(query)` | Execute SQL, return Arrow IPC bytes (`Uint8Array`) |\n| `db.sqlJSON(query)` | Execute SQL and return parsed JSON rows |\n| `db.registerFile(name, file)` | Register a browser `File` as Parquet, GeoJSON, or GeoTIFF/TIFF |\n| `db.registerRemoteParquet(name, url)` | Fetch and register a remote Parquet file (CORS required) |\n| `db.registerGeoJSON(name, geojson)` | Register a GeoJSON string or object as a table |\n| `db.registerRaster(name, bytes, format)` | Register raster bytes as a single-column raster table (`full` only, currently `geotiff` / `tiff`) |\n| `db.registerGeoTIFF(name, bytes)` | Register GeoTIFF bytes as a single-column raster table (`full` only) |\n| `db.dropTable(name)` | Drop a registered table |\n| `db.tables()` | List registered table names |\n| `db.version()` | Version string |\n\n## Spatial function reference\n\nSignatures and descriptions below are sourced from the [Apache SedonaDB SQL function reference](https://sedona.apache.org/sedonadb/latest-snapshot/reference/sql/). Entries marked _(local runtime helper)_ are exposed by the cereusdb build but are not documented upstream.\n\n### Core functions (always available)\n\n66 scalar + 3 aggregate functions from pure Rust.\n\n#### Constructors\n\n- **ST_Point** — `geometry ST_Point(x: double, y: double, srid: crs)` — Constructs a Point from X and Y.\n- **ST_PointZ** — `geometry ST_PointZ(x: double, y: double, z: double)` — Constructs a Point with a Z coordinate.\n- **ST_PointM** — `geometry ST_PointM(x: double, y: double, m: double)` — Constructs a Point with an M (measure) coordinate.\n- **ST_PointZM** — `geometry ST_PointZM(x: double, y: double, z: double, m: double)` — Constructs a Point with X, Y, Z, and M coordinates.\n- **ST_GeogPoint** — `geography ST_GeogPoint(longitude: double, latitude: double)` — Creates a geography POINT from longitude and latitude.\n\n#### Parsers\n\n- **ST_GeomFromWKT** — `geometry ST_GeomFromWKT(wkt: string)` · `geometry ST_GeomFromWKT(wkt: string, srid: crs)` — Constructs a Geometry from Well-Known Text.\n- **ST_GeomFromWKB** — `geometry ST_GeomFromWKB(wkb: binary)` · `geometry ST_GeomFromWKB(wkb: binary, srid: crs)` — Constructs a Geometry from Well-Known Binary.\n- **ST_GeomFromEWKT** — `geometry ST_GeomFromEWKT(ewkt: string)` — Constructs a geometry from Extended Well-Known Text.\n- **ST_GeomFromEWKB** — `geometry ST_GeomFromEWKB(ewkb: binary)` — Constructs a geometry from Extended Well-Known Binary.\n- **ST_GeogFromWKT** — `geography ST_GeogFromWKT(wkt: string)` · `geography ST_GeogFromWKT(wkt: string, srid: integer)` — Constructs a Geography from WKT.\n- **ST_GeogFromWKB** — `geography ST_GeogFromWKB(wkb: binary)` — Constructs a Geography from WKB.\n- **ST_GeomFromWKBUnchecked** — `geometry ST_GeomFromWKBUnchecked(wkb: binary)` — _(local runtime helper)_ constructs a Geometry from WKB without validation.\n\n#### Serializers\n\n- **ST_AsText** — `string ST_AsText(geom: geometry)` — Returns the WKT string representation of a geometry or geography.\n- **ST_AsBinary** — `binary ST_AsBinary(geom: geometry)` — Converts a geometry to Well-Known Binary format.\n- **ST_AsEWKB** — `binary ST_AsEWKB(geom: geometry)` — Returns the EWKB representation of a geometry or geography.\n- **ST_AsEWKT** — `string ST_AsEWKT(geom: geometry)` — _(local extension)_ returns the Extended WKT representation of a geometry.\n\n#### Coordinate accessors\n\n- **ST_X** — `double ST_X(geom: geometry)` — Returns the X coordinate of the point, or NULL if not available.\n- **ST_Y** — `double ST_Y(geom: geometry)` — Returns the Y coordinate of the point, or NULL if not available.\n- **ST_Z** — `double ST_Z(geom: geometry)` — Returns the Z coordinate of the point, or NULL if not available.\n- **ST_M** — `double ST_M(geom: geometry)` — Returns the M (measure) coordinate of a Point geometry.\n\n#### Bounding box\n\n- **ST_XMin** — `double ST_XMin(geom: geometry)` — Returns the minimum X coordinate of a geometry's bounding box.\n- **ST_XMax** — `double ST_XMax(geom: geometry)` — Returns the maximum X coordinate of a geometry's bounding box.\n- **ST_YMin** — `double ST_YMin(geom: geometry)` — Returns the minimum Y coordinate of a geometry's bounding box.\n- **ST_YMax** — `double ST_YMax(geom: geometry)` — Returns the maximum Y coordinate of a geometry's bounding box.\n- **ST_ZMin** — `double ST_ZMin(geom: geometry)` — Returns the minimum Z coordinate of a geometry's bounding box.\n- **ST_ZMax** — `double ST_ZMax(geom: geometry)` — Returns the maximum Z coordinate of a geometry's bounding box.\n- **ST_MMin** — `double ST_MMin(geom: geometry)` — Returns the minimum M-coordinate of a geometry's bounding box.\n- **ST_MMax** — `double ST_MMax(geom: geometry)` — Returns the maximum M value from a geometry's bounding box.\n\n#### CRS / SRID\n\n- **ST_SRID** — `integer ST_SRID(geom: geometry)` — Returns the SRID of a geometry.\n- **ST_SetSRID** — `geometry ST_SetSRID(geom: geometry, srid: integer)` — Sets the SRID for a geometry.\n- **ST_CRS** — `string ST_CRS(geom: geometry)` — Returns the CRS metadata associated with a geometry or geography object.\n- **ST_SetCRS** — `geometry ST_SetCRS(geom: geometry, target_crs: string)` · `geography ST_SetCRS(geog: geography, target_crs: string)` — Sets the CRS for a geometry.\n\n#### Properties\n\n- **ST_Dimension** — `integer ST_Dimension(geom: geometry)` — Returns the dimension of the geometry.\n- **ST_GeometryType** — `string ST_GeometryType(geom: geometry)` — Returns the type of a geometry.\n- **ST_NumGeometries** — `integer ST_NumGeometries(geom: geometry)` — Returns the number of geometries in a geometry collection.\n- **ST_NPoints** — `integer ST_NPoints(geom: geometry)` — Returns the number of points of the geometry.\n- **ST_IsEmpty** — `boolean ST_IsEmpty(geom: geometry)` — Returns true if the geometry is empty.\n- **ST_IsClosed** — `boolean ST_IsClosed(geom: geometry)` — Returns true if the LINESTRING start and end point are the same.\n- **ST_IsCollection** — `boolean ST_IsCollection(geom: geometry)` — Returns true if the geometry type is a geometry collection type.\n- **ST_HasZ** — `boolean ST_HasZ(geom: geometry)` — Returns true if the geometry has a Z dimension.\n- **ST_HasM** — `boolean ST_HasM(geom: geometry)` — Returns true if the geometry has an M dimension.\n- **ST_ZMFlag** — `integer ST_ZMFlag(geom: geometry)` — Returns a code indicating the dimension of the coordinates in a geometry.\n\n#### Component access\n\n- **ST_GeometryN** — `geometry ST_GeometryN(geom: geometry, n: integer)` — Returns the 0-based Nth geometry from a geometry collection or multi-type.\n- **ST_PointN** — `geometry ST_PointN(geom: geometry, n: integer)` — Returns the Nth point in a linestring.\n- **ST_Points** — `geometry ST_Points(geom: geometry)` — Returns a MultiPoint geometry consisting of all coordinates of the input geometry.\n- **ST_StartPoint** — `geometry ST_StartPoint(geom: geometry)` — Returns the start point of a linestring geometry.\n- **ST_EndPoint** — `geometry ST_EndPoint(geom: geometry)` — Returns the last point of a linestring.\n- **ST_InteriorRingN** — `geometry ST_InteriorRingN(geom: geometry, n: integer)` — Returns the Nth interior ring of a polygon.\n\n#### Geometry operations\n\n- **ST_Envelope** — `geometry ST_Envelope(geom: geometry)` — Returns the bounding box (envelope) of a geometry as a new geometry.\n- **ST_Dump** — `struct ST_Dump(geom: geometry)` — Expands multi-part geometries into child parts.\n- **ST_MakeLine** — `geometry ST_MakeLine(geomA: geometry, geomB: geometry)` — Creates a LineString from two or more input geometries.\n- **ST_Reverse** — `geometry ST_Reverse(geom: geometry)` — Returns the geometry with vertex order reversed.\n\n#### Affine transforms\n\n- **ST_Translate** — `geometry ST_Translate(geom: geometry, deltaX: double, deltaY: double)` · `geometry ST_Translate(geom: geometry, deltaX: double, deltaY: double, deltaZ: double)` — Returns a geometry with coordinates translated by deltaX, deltaY (and optional deltaZ).\n- **ST_Scale** — `geometry ST_Scale(geom: geometry, scaleX: double, scaleY: double)` · `geometry ST_Scale(geom: geometry, scaleX: double, scaleY: double, scaleZ: double)` — Scales a geometry by multiplying ordinates with scale factors.\n- **ST_Rotate** — `geometry ST_Rotate(geom: geometry, rot: double)` — Rotates a geometry counter-clockwise around the Z axis by an angle in radians.\n- **ST_RotateX** — `geometry ST_RotateX(geom: geometry, rot: double)` — Rotates a geometry around the X axis by an angle in radians.\n- **ST_RotateY** — `geometry ST_RotateY(geom: geometry, rot: double)` — Rotates a geometry around the Y axis by an angle in radians.\n- **ST_Affine** — `geometry ST_Affine(geom: geometry, a: double, b: double, d: double, e: double, xOff: double, yOff: double)` · `geometry ST_Affine(geom: geometry, a: double, b: double, c: double, d: double, e: double, f: double, g: double, h: double, i: double, xOff: double, yOff: double, zOff: double)` — Applies an affine transformation to a geometry.\n\n#### Dimension forcing\n\n- **ST_Force2D** — `geometry ST_Force2D(geom: geometry)` — Forces a geometry into a XY coordinate model.\n- **ST_Force3D** — `geometry ST_Force3D(geom: geometry)` · `geometry ST_Force3D(geom: geometry, z: double)` — Forces a geometry into a XYZ coordinate model with an optional Z value.\n- **ST_Force3DM** — `geometry ST_Force3DM(geom: geometry)` · `geometry ST_Force3DM(geom: geometry, m: double)` — Forces a geometry into a XYM coordinate model with an optional M value.\n- **ST_Force4D** — `geometry ST_Force4D(geom: geometry)` · `geometry ST_Force4D(geom: geometry, z: double)` · `geometry ST_Force4D(geom: geometry, z: double, m: double)` — Forces a geometry into a XYZM coordinate model with optional Z and M values.\n\n#### Aggregates\n\n- **ST_Collect_Agg** — `geometry ST_Collect_Agg(geom: geometry)` — Combines multiple geometries from a set of rows into a single collection.\n- **ST_Envelope_Agg** — `geometry ST_Envelope_Agg(geom: geometry)` — Returns the collective bounding box (envelope) of a set of geometries.\n- **ST_Analyze_Agg** — `struct ST_Analyze_Agg(geom: geometry)` — Computes statistics of geometries for the input geometry.\n\n### Geo functions (always available)\n\n10 scalar + 2 aggregate functions from the pure-Rust `geo` crate.\n\n#### Measurement\n\n- **ST_Area** — `double ST_Area(geom: geometry)` — Returns the area of a geometry.\n- **ST_Length** — `double ST_Length(geom: geometry)` — Returns the length of a geometry.\n- **ST_Perimeter** — `double ST_Perimeter(geom: geometry)` — Calculates the 2D perimeter of a given geometry.\n- **ST_Distance** — `double ST_Distance(geomA: geometry, geomB: geometry)` — Returns the distance between two geometries or geographies.\n- **ST_DWithin** — `boolean ST_DWithin(geomA: geometry, geomB: geometry, distance: double)` — Returns true if two geometries are within a specified distance of each other.\n\n#### Geometry operations\n\n- **ST_Buffer** — `geometry ST_Buffer(geom: geometry, distance: float64)` · `geometry ST_Buffer(geom: geometry, distance: float64, params: string)` — Computes a geometry representing all points within a specified distance.\n- **ST_Centroid** — `geometry ST_Centroid(geom: geometry)` — Returns the centroid of a geometry.\n- **ST_Intersects** — `boolean ST_Intersects(geomA: geometry, geomB: geometry)` — Returns true if geomA intersects geomB.\n- **ST_LineInterpolatePoint** — `geometry ST_LineInterpolatePoint(geom: geometry, fraction: double)` — Returns a point interpolated along a line.\n\n#### Serializers\n\n- **ST_AsGeoJSON** — `string ST_AsGeoJSON(geom: geometry)` — Returns the GeoJSON representation of a geometry.\n\n#### Aggregates\n\n- **ST_Intersection_Agg** — `geometry ST_Intersection_Agg(geom: geometry)` — Returns the cumulative intersection of all geometries in the input.\n- **ST_Union_Agg** — `geometry ST_Union_Agg(geom: geometry)` — Returns a geometry representing the point set union of all geometries.\n\n### GEOS functions (`minimal`, `standard`, `global`, `full`)\n\n42 scalar + 1 aggregate function via GEOS 3.13.1 (C++ cross-compiled with Emscripten).\n\n#### Spatial predicates\n\n- **ST_Contains** — `boolean ST_Contains(geomA: geometry, geomB: geometry)` — Returns true if geomA contains geomB.\n- **ST_Within** — `boolean ST_Within(geomA: geometry, geomB: geometry)` — Returns true if A is completely inside B.\n- **ST_Covers** — `boolean ST_Covers(geomA: geometry, geomB: geometry)` — Returns true if geomA covers geomB.\n- **ST_CoveredBy** — `boolean ST_CoveredBy(geomA: geometry, geomB: geometry)` — Returns true if geomA is covered by geomB.\n- **ST_Crosses** — `boolean ST_Crosses(geomA: geometry, geomB: geometry)` — Returns true if A crosses B.\n- **ST_Touches** — `boolean ST_Touches(geomA: geometry, geomB: geometry)` — Returns true if A touches B.\n- **ST_Overlaps** — `boolean ST_Overlaps(geomA: geometry, geomB: geometry)` — Returns true if A overlaps B.\n- **ST_Disjoint** — `boolean ST_Disjoint(geomA: geometry, geomB: geometry)` — Returns true if geomA is disjoint from geomB.\n- **ST_Equals** — `boolean ST_Equals(geomA: geometry, geomB: geometry)` — Returns true if geomA equals geomB.\n- **ST_Relate** — `string ST_Relate(geomA: geometry, geomB: geometry)` · `boolean ST_Relate(geomA: geometry, geomB: geometry, intersectionMatrixPattern: string)` — Returns the DE-9IM intersection matrix string, or tests a given pattern.\n\n#### Validation\n\n- **ST_IsValid** — `boolean ST_IsValid(geom: geometry)` — Checks whether a geometry meets OGC validity rules.\n- **ST_IsValidReason** — `string ST_IsValidReason(geom: geometry)` — Returns a text explanation describing why a geometry is invalid.\n- **ST_IsSimple** — `boolean ST_IsSimple(geom: geometry)` — Tests if the geometry's only self-intersections are at boundary points.\n- **ST_IsRing** — `boolean ST_IsRing(geom: geometry)` — Returns true if a linestring is `ST_IsClosed` and `ST_IsSimple`.\n- **ST_MakeValid** — `geometry ST_MakeValid(geom: geometry)` · `geometry ST_MakeValid(geom: geometry, keepCollapsed: boolean)` — Creates a valid representation of an invalid geometry.\n\n#### Overlay operations\n\n- **ST_Intersection** — `geometry ST_Intersection(geomA: geometry, geomB: geometry)` · `geography ST_Intersection(geogA: geography, geogB: geography)` — Computes the intersection of two geometries or geographies.\n- **ST_Union** — `geometry ST_Union(geomA: geometry, geomB: geometry)` — Returns a geometry that represents the point set union of two geometries.\n- **ST_Difference** — `geometry ST_Difference(geomA: geometry, geomB: geometry)` — Computes the difference between geomA and geomB.\n- **ST_SymDifference** — `geometry ST_SymDifference(geomA: geometry, geomB: geometry)` — Returns the parts of geometries A and B that do not overlap.\n\n#### Hulls\n\n- **ST_ConvexHull** — `geometry ST_ConvexHull(geom: geometry)` — Returns the Convex Hull of polygon A.\n- **ST_ConcaveHull** — `geometry ST_ConcaveHull(geom: geometry, pct_convex: double)` — Returns a concave hull enclosing the input geometry.\n\n#### Simplification\n\n- **ST_Simplify** — `geometry ST_Simplify(geom: geometry, tolerance: double)` — Simplifies an input geometry using the Douglas-Peucker algorithm.\n- **ST_SimplifyPreserveTopology** — `geometry ST_SimplifyPreserveTopology(geom: geometry, tolerance: double)` — Simplifies a geometry, ensuring the result is valid with the same topology.\n\n#### Topology\n\n- **ST_Boundary** — `geometry ST_Boundary(geom: geometry)` — Returns the closure of the combinatorial boundary of this geometry.\n- **ST_UnaryUnion** — `geometry ST_UnaryUnion(geom: geometry)` — Returns a single geometry which is the union of all components.\n- **ST_LineMerge** — `geometry ST_LineMerge(geom: geometry)` — Merges a collection of line segments into the fewest possible LineStrings.\n- **ST_Polygonize** — `geometry ST_Polygonize(geom: geometry)` — Builds a polygonal geometry from linear components in the input geometry.\n- **ST_Snap** — `geometry ST_Snap(geomA: geometry, geomB: geometry, tolerance: double)` — Snaps input geometry to reference geometry within tolerance.\n\n#### Precision\n\n- **ST_MinimumClearance** — `double ST_MinimumClearance(geom: geometry)` — Returns the minimum clearance of a geometry.\n- **ST_MinimumClearanceLine** — `geometry ST_MinimumClearanceLine(geom: geometry)` — Returns a LineString representing the minimum clearance distance of the input geometry.\n\n#### Properties\n\n- **ST_NRings** — _(local runtime helper)_ returns the number of rings (interior + exterior) in a polygon.\n- **ST_NumInteriorRings** — _(local runtime helper)_ returns the number of interior rings of a polygon.\n- **ST_NumPoints** — _(local runtime helper)_ returns the number of points in a geometry.\n\n#### Aggregates\n\n- **ST_Polygonize_Agg** — `geometry ST_Polygonize_Agg(geom: geometry)` — Creates polygons from a set of geometries containing linework representing polygon edges.\n\n### PROJ functions (`standard`, `global`, `full`)\n\n1 scalar function via PROJ 9.6.0 (C++ cross-compiled with Emscripten).\n\n- **ST_Transform** — `geometry ST_Transform(geom: geometry, target_crs: string)` · `geometry ST_Transform(geom: geometry, source_crs: string, target_crs: string)` — Transforms a geometry from one CRS to another. Supports EPSG codes, PROJ strings, and WKT2.\n\n### Raster functions (`full`)\n\n33 `RS_*` functions via GDAL-backed raster support. The `full` package matches the\ncurrent local SedonaDB/Rust raster catalog and includes raster metadata,\ngeoreference, pixel geometry, and predicate functions such as `RS_Width`,\n`RS_Height`, `RS_NumBands`, `RS_BandPixelType`, `RS_CRS`, `RS_GeoReference`,\n`RS_PixelAsPoint`, `RS_PixelAsPolygon`, `RS_Contains`, `RS_Intersects`, and\n`RS_Within`.\n\n### Comparison with native SedonaDB\n\n| Category | sedona-db (native) | cereusdb |\n|---|---|---|\n| Vector scalar functions | Current SedonaDB/Rust catalog | Up to 132 exposed runtime names (`global` / `full`) |\n| Vector aggregate functions | 6 | 6 |\n| Raster functions (RS_*) | 33 | 33 in `full` |\n| S2 geography functions | 18 | 18 in `global` / `full` |\n| CRS transform | ST_Transform | ST_Transform |\n| GEOS predicates \u0026 operations | All | All |\n| Spatial join | Yes (with spill-to-disk) | Yes (single-partition, in-memory MVP) |\n| KNN join (`ST_KNN`) | Yes | Yes (same MVP limitations) |\n| Remote Parquet (HTTP) | Yes | Yes (pre-fetch) |\n| GeoParquet metadata | Yes | -- |\n| File upload (Parquet, GeoJSON) | N/A | Yes |\n\n### Package Function Availability\n\nCurrent generated runtime counts per browser artifact:\n\n| Package | Runtime `ST_*` | Runtime `RS_*` | What it adds | What it omits |\n|---|---:|---:|---|---|\n| `minimal` | 130 | 0 | Core, `geo`, GEOS, spatial joins, `ST_KNN` MVP | `ST_Transform`, all raster, all S2 geography kernels |\n| `standard` | 131 | 0 | `ST_Transform` | all raster, all S2 geography kernels |\n| `global` | 132 | 0 | `ST_Transform`, 18 S2 geography kernels, S2 `sd_order` override | all raster |\n| `full` | 132 | 33 | `ST_Transform`, 18 S2 geography kernels, S2 `sd_order` override, full current raster catalog | nothing from the current local SedonaDB docs set |\n\nCommon runtime-only names exposed across the packages include:\n\n- Compatibility aliases: `ST_AsWKB`, `ST_AsWKT`, `ST_GeogFromText`, `ST_GeomFromText`, `ST_GeometryFromText`\n- Geography additions: `ST_GeogFromEWKB`, `ST_GeogFromEWKT`, `ST_GeogToGeometry`, `ST_GeomToGeography`\n- Local broad-doc extensions: `ST_AsEWKT`, `ST_Expand`, `ST_ExteriorRing`, `ST_GeomFromGeoJSON`, `ST_MakeEnvelope`\n- Runtime helpers: `ST_GeomFromWKBUnchecked`, `ST_NRings`, `ST_NumInteriorRings`, `ST_NumPoints`\n\n## Building\n\n### Prerequisites\n\n- Rust (1.88+) with `wasm32-unknown-unknown` target\n- [wasm-pack](https://rustwasm.github.io/wasm-pack/)\n- [Emscripten](https://emscripten.org/) (for `minimal`, `standard`, `global`, or `full`)\n\n### Build commands\n\n```bash\n# Initialize submodules once\nmake deps\n\n# Prepare patched source trees\nmake prepare-sources\n\n# Validate the Rust baseline\nmake check\n\n# Public browser packages\nmake build\nmake build-minimal\nmake build-standard\nmake build-global\nmake build-full\n\n# JavaScript wrapper and tests\nmake install-js-deps\nmake build-js\nmake build-ts\nmake package-minimal\nmake package-standard\nmake package-global\nmake package-full\nmake package-all\nmake test-js\nmake test-js-minimal\nmake test-js-standard\nmake test-js-global\nmake test-js-full\n\n# Size reporting\nmake size-minimal\nmake size-standard\nmake size-global\nmake size-full\nmake size-report\n\n# Regenerate the package surface snapshot report\nmake surface-report\n```\n\nEach package build writes to `dist/\u003cpackage\u003e/`. The repository-level `pkg/` path is a symlink to the most recently built package so the JS wrapper and tests can keep importing `./pkg/cereusdb.js`. The publishable npm package shells live under `packages/minimal`, `packages/standard`, `packages/global`, and `packages/full`; `make package-*` assembles each of them from the matching built WASM artifact plus the shared TypeScript wrapper.\n\n### Local development\n\n```bash\nmake install-playground-deps\nmake package-standard\nmake serve\n# Open http://127.0.0.1:8080\n```\n\nThe Vite playground in `packages/playground` replaces the old static HTML demos. It uses `@cereusdb/minimal`, supports ad hoc SQL queries, remote Parquet loading, local Parquet/GeoJSON uploads, and result inspection in both table and JSON form.\n\n### JavaScript tests\n\n```bash\n# Package-specific rebuild + TypeScript compile + Vitest\nmake test-js-minimal\nmake test-js-standard\nmake test-js-global\nmake test-js-full\n\n# Or run the JS steps directly once dependencies are installed\ncd js\nnpm exec tsc\nnpm run test:minimal\nnpm run test:standard\nnpm run test:global\nnpm run test:full\n```\n\n## Architecture\n\n```\nCereusDB/\n├── deps/\n│   ├── sedona-db/          # Git submodule (never modified)\n│   ├── geos/               # GEOS 3.13.1 source\n│   ├── proj/               # PROJ 9.6.0 source\n│   ├── gdal/               # GDAL source\n│   ├── expat/              # Expat source\n│   ├── zlib/               # zlib source\n│   ├── sqlite-src/         # SQLite source\n│   ├── georust-geos/       # geos / geos-sys source\n│   ├── georust-proj/       # proj / proj-sys source\n│   └── georust-gdal/       # gdal / gdal-sys source\n├── patches/\n│   ├── sedona-db/          # sedona-db WASM patch series\n│   ├── georust-geos/       # georust/geos WASM patch series\n│   ├── georust-proj/       # georust/proj WASM patch series\n│   └── georust-gdal/       # georust/gdal WASM patch series\n├── rust/\n│   ├── cereusdb/           # WASM entry point (wasm-bindgen API)\n│   └── cereusdb-object-store/\n├── scripts/\n│   ├── build.sh            # Master build script\n│   ├── prepare-patched-sources.sh\n│   ├── report-wasm-size.sh # Raw/gzip/brotli size reporting\n│   ├── patch-wasm-js.sh    # Post-build JS patching\n│   ├── env_shim.js         # Emscripten runtime stubs\n│   └── emscripten/         # GEOS/PROJ Emscripten build scripts\n├── build/\n│   └── patched-sources/    # Generated patched source trees (not committed)\n├── dist/                   # Package outputs (minimal, standard, global, full)\n├── packages/               # npm package shells and private Pages apps\n│   ├── documentation/      # Typedoc site source and deployment config\n│   ├── playground/         # Browser playground built on @cereusdb/minimal\n│   └── \u003cpackage\u003e/          # @cereusdb/minimal|standard|global|full shells\n├── pkg -\u003e dist/\u003cpackage\u003e   # Symlink to the most recently built package\n├── js/\n│   ├── src/index.ts        # Internal shared TypeScript wrapper source\n│   └── tests/              # Vitest package matrix\n├── Cargo.toml              # Workspace root\n├── Makefile\n└── DEPENDENCIES.md\n```\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobilg%2Fcereusdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobilg%2Fcereusdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobilg%2Fcereusdb/lists"}