Root WFS handle. Holds the capabilities cache and exposes feature-type / stored-query factories.

Constructors

Properties

capabilitiesFetches: number = 0

Counter exposed for tests / diagnostics: how many times capabilities was fetched.

client: HonuaClient
endpointUrl: string
version: string

Methods

  • Fetch and cache the GetCapabilities document. Subsequent calls reuse the parsed snapshot. Throws HonuaWfsExceptionError on <ows:ExceptionReport>.

    Parameters

    • Optionaloptions: {
          signal?: AbortSignal;
      }
      • Optionalsignal?: AbortSignal

    Returns Promise<WfsCapabilitiesSnapshot>

  • Fetch the DescribeFeatureType XSD for one feature type. Returned raw so Source.protocol("wfs") callers can read schema detail the canonical surface does not model.

    Parameters

    • typeName: string
    • Optionaloptions: {
          signal?: AbortSignal;
      }
      • Optionalsignal?: AbortSignal

    Returns Promise<{
        contentType: string;
        text: string;
    }>

  • Resolve the geometry property name of one feature type from its DescribeFeatureType schema, caching the result alongside the capabilities snapshot. Fails closed with HonuaWfsProtocolError("unresolved-geometry-property") rather than assuming a vendor default: the_geom is only the PostGIS-via-GeoServer convention, MapServer serves msGeometry, and other servers use per-schema names, so guessing silently matches nothing.

    Feature types that declare several geometry properties resolve to the first declared one (the server's default geometry); pin a different one with locator.geometryName.

    Parameters

    • typeName: string
    • Optionaloptions: {
          signal?: AbortSignal;
      }
      • Optionalsignal?: AbortSignal

    Returns Promise<string>

  • Resolve the concrete request URL for a WFS operation, honouring the DCP xlink:href a raw server advertises in GetCapabilities (e.g. GeoServer mounted at /geoserver/ows that advertises its operation URL at /geoserver/wfs). Falls back to the configured endpoint URL when capabilities have not been resolved yet or the server omits the DCP href. This peeks at the already-resolved snapshot synchronously, so it never forces an extra GetCapabilities round-trip: the canonical WFS query path resolves capabilities for output-format negotiation before issuing GetFeature.

    Parameters

    • operation: string
    • method: "GET" | "POST"

    Returns string

  • Internal helper used by feature-type / stored-query handles.

    Parameters

    • method: "GET" | "POST"
    • path: string
    • options: {
          accept: string;
          body?: string;
          contentType?: string;
          maxResponseBytes?: number;
          signal?: AbortSignal;
      }
      • accept: string
      • Optionalbody?: string
      • OptionalcontentType?: string
      • OptionalmaxResponseBytes?: number
      • Optionalsignal?: AbortSignal

    Returns Promise<{
        contentType: string;
        status: number;
        text: string;
    }>

  • Discover stored queries through the ListStoredQueries operation. Returns the bare list of identifier strings; per-query metadata is exposed via storedQuery(id).describe().

    Parameters

    • Optionaloptions: {
          signal?: AbortSignal;
      }
      • Optionalsignal?: AbortSignal

    Returns Promise<readonly string[]>