import { envelope } from "@honua/sdk-js";
const dataset = createDataset({
id: "imagery",
client,
sources: [{
id: "stac-search",
protocol: "stac",
locator: { url: "https://your-honua-server.example/stac" },
capabilities: PROTOCOL_DEFAULT_CAPABILITIES.stac,
}],
});
const result = await dataset.source("stac-search")!.query({
spatialFilter: envelope(-158.5, 21.2, -157.6, 21.7),
pagination: { limit: 100 },
});
Adapter factory for a STAC API search endpoint.
The canonical
Source.query()runs a search against the STAC root, usingPOST /searchwhen the landing page advertises arel="search"link withmethod: "POST"(long CQL2 filters andintersectsgeometries overflow GET URL limits) and falling back to the universally supportedGET /searchotherwise.Query.spatialFiltertranslates to STAC'sbboxfor anenvelope(...)and tointersectsfor any other GeoJSON-convertible geometry. The deprecated source-nativeQuery.wheremigration member maps to STACdatetime/filterparameters.