Function stacSearchSource

  • Adapter factory for a STAC API search endpoint.

    The canonical Source.query() runs a search against the STAC root, using POST /search when the landing page advertises a rel="search" link with method: "POST" (long CQL2 filters and intersects geometries overflow GET URL limits) and falling back to the universally supported GET /search otherwise. Query.spatialFilter translates to STAC's bbox for an envelope(...) and to intersects for any other GeoJSON-convertible geometry. The deprecated source-native Query.where migration member maps to STAC datetime / filter parameters.

    Type Parameters

    • T

    Parameters

    Returns CapabilityAwareSource<T>

    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 },
    });