Skip to content

Releases

v0.8.0

Choose a tag to compare

@cboettig cboettig released this 28 Nov 00:07
6305805

geo-query-wasm runs geo-query's MCP server in the browser. Apps can pin this release as https://cdn.jsdelivr.net/gh/SchmidtDSE/geo-query-wasm@v0.8.0/src/…. Nothing that worked on 0.7.0 changes.

Visitor files

A page can give the worker a file of the visitor's own, such as a GeoJSON dropped on the map, and the SQL can read it and join it to the catalog's data (#25, closes #16). The file never leaves the browser; on geo-query the same upload goes to a bucket.

  • src/files.js adds addFile(worker, file), removeFile(worker, name) and listFiles(worker). They are messages outside MCP, as sendSecrets() is, because the model never holds the bytes. The page tells the model the file's path.
  • addFile resolves to { name, path, bytes, read, columns, geometry }. read is the SQL call that reads the file, such as ST_Read('/upload/site.geojson'). columns is DuckDB's DESCRIBE of the file, and geometry names its first GEOMETRY column.
  • Types.
    • .geojson, .json, .gpkg, .fgb and .kml are read with ST_Read.
    • .parquet is read with read_parquet, and .csv with read_csv.
  • Refused files. A file DuckDB cannot read is refused at addFile. maxUploadBytes caps the size, 50 MB by default.
  • Timing.
    • A file may be sent as soon as the Worker exists; the worker holds it until DuckDB has started.
    • Files live only as long as that Worker.
    • Calls reject on a worker error or after a timeout (120 s by default), so a worker from an older release shows up as a timeout.
  • The SQL stays locked. /upload/ is allowed from start-up, and the SQL still runs only SELECT statements. ST_Read cannot reach other hosts through GDAL; we checked this on DuckDB 1.5.4 and 2.0.
  • Guidance. The query description gains one line saying where visitor files are.
  • Engine. A page that imports the engine gets registerFile, removeFile and listFiles.

The guide is at https://schmidtdse.github.io/geo-query-wasm/docs/guide/visitor-files.html.

v0.7.0

Choose a tag to compare

@cboettig cboettig released this 27 Nov 06:16
3f42f5e

geo-query-wasm runs geo-query's MCP server in the browser. This release brings it back in line with geo-query's main at 7467f15. Apps can pin it as https://cdn.jsdelivr.net/gh/SchmidtDSE/geo-query-wasm@v0.7.0/src/….

Breaking: no STAC tools

  • The server no longer offers browse_stac_catalog, get_stac_details, get_collection or the catalog:// resources, as geo-query removed them in geo-query#528 (#23). Its tools are query, register_hex_tiles and get_hex_tile_status, plus zonal_stats when an app turns it on.
  • A client finds dataset paths with its own catalog tool. glen already answers its catalog tools in the browser and never registered the server's. A page without a catalog tool can use src/stac.js, which writes the same markdown and JSON as before, as the demo page does.
  • The worker's discovery option is ignored.

Paths and guidance

  • A string literal in query or register_hex_tiles SQL that starts with a published NRP or source.coop https:// prefix is rewritten to s3:// before it runs, as in geo-query#543. Paths copied from any STAC client can then be globbed. The engine option httpsToS3 sets the prefixes, and [] turns the rewrite off. Apps that import src/engine.js get this rewrite too.
  • The query and hex-tile descriptions come from geo-query 7467f15. Their discovery steps no longer name this server's tools.
  • s3.carlboettiger.info is an allowed s3_endpoint, as on geo-query.

Data

  • The demo page and the checks read only the catalog's own data on the source.coop mirror. The instructions about the tpl-cities California county files are gone, and so are the files themselves.

Documentation

v0.6.0

Choose a tag to compare

@cboettig cboettig released this 11 Nov 19:35
727f39f

geo-query-wasm runs geo-query's MCP server in the browser. This is the first tag since v0.3.1, and it includes the work from versions 0.4.0 and 0.5.0, which were not tagged. Apps can pin it as https://cdn.jsdelivr.net/gh/SchmidtDSE/geo-query-wasm@v0.6.0/src/….

Catalogs

  • The worker walks a STAC catalog to any depth through Catalog and Collection nodes, as geo-query does since geo-query#487 (#18). browse_stac_catalog lists groups as headings with their datasets indented beneath them. A group's details list every dataset under it, and a short id such as wards finds government/wards when only one id ends that way. Listings, get_stac_details and get_collection match geo-query on the GLEN source.coop mirror, which now lists 140 datasets in 21 groups, and on the St. Louis catalog.
  • The worker reads Portolan catalogs, whose hrefs are relative and whose root has no self link (#15).
  • A dataset whose id is already taken is skipped, but the datasets beneath it are still listed (#18).

Geometry

  • GeoParquet geometry is read as GEOMETRY, as it is on geo-query, so spatial SQL such as ST_Contains works without ST_GeomFromWKB (#13). duckdb-wasm cannot export geometry that carries a coordinate system, so the engine casts it to plain GEOMETRY: the engine's arrow results give it as WKB, and JSON results as WKT.

Zonal statistics

  • An optional zonal_stats tool summarizes a Cloud-Optimized GeoTIFF that has no H3 hex copy over polygon zones (#17). An app turns it on with zonalStats: true. It reads the COG with geotiff.js, ZSTD included, and counts pixels by centre, as rasterio does, or weights them by area. For GHS-POP 2020 over the 14 St. Louis wards it gives 320,133 people in 4.6 s, the same as rasterio. It declines a COG whose collection in the catalog has a hex copy and names that copy.

Hex tiles

  • register_hex_tiles and get_hex_tile_status run in the worker with geo-query's arguments and responses (#6). The worker serves tiles and metadata.json at geoquerywasm://tiles/hex/…, and src/hex-protocol.js registers that scheme with MapLibre.

Private data

  • An app reads a private bucket with keys it sends to the worker with sendSecrets() (#8). The model never sees the keys and cannot pass its own.

Capabilities and limits

  • docs/capabilities.md lists which queries run well in the browser and which belong on geo-query, with benchmarks against geo-query (#9, #10).
  • A query is cancelled after 600 seconds, and the instance keeps working (#9).
  • DuckDB 2.0 (1.33.1-dev114.0) is available with the duckdb option and spills large aggregates and sorts. DuckDB 1.5.4 stays the default until duckdb#28218 is fixed (#9, #11).

Compatibility

  • The browse listing changes shape: it shows groups with their datasets beneath them, and its header reads "N datasets in M groups". Code that parses the old "N collections" header needs updating.
  • query results in format: "json" give geometry as WKT text, where they gave an escaped WKB blob before.