import { Feature } from 'ol'; import { Geometry } from 'ol/geom.js'; import { WriteGetFeatureOptions } from 'ol/format/WFS.js'; import SelectionParam from '../../models/selectionparam.js'; import LayerWms from '../../models/layers/layerwms.js'; import ServerWfs from '../../models/serverwfs.js'; import { XmlTypes } from '../../models/xmlTypes.js'; import ServerOgc from '../../models/serverogc.js'; import IGirafeContext from '../context/icontext.js'; export type WfsClientOptions = { featurePrefix: string; featureNS: string; }; export type WfsClientOptionalOptions = { featurePrefix?: string; featureNS?: string; }; export default class WfsClient { private readonly context; protected version: string; private get state(); protected ogcServer: ServerOgc; protected maxFeatures: number; protected featurePrefix: string; protected featureNS: string; protected featureNsWithPrefix: Record; private readonly urlParameters; private serverWfs; constructor(ogcServer: ServerOgc, options: WfsClientOptions, context: IGirafeContext); private get wfsUrl(); private extractVersionFromUrl; private configMaxFeatures; getServerWfs(): Promise>; protected describeFeatureType(): Promise>; private requestDescribeFeatureType; private parseDescribeFeatureTypeResponse; private initializeAttribute; protected manageLayerAttribute(serverWfs: ServerWfs, element: Element, featureType: string): void; protected validateLayerAttributeType(type: string): boolean; protected getElementToTypeName(xml: Document): Record; protected getDescribeFeatureTypeUrl(): string; /** * Gets features from a WFS server. * Configure the request by providing a GeoGirafe `SelectionParam` or an ol `GetFeatureOptions` object. */ getFeature(options: SelectionParam): Promise[]>; getFeature(options: GetFeatureOptionsPartial): Promise[]>; /** * Transforms a `SelectionParam` object, originating from a map selection, * into a `GetFeatureOptionsPartial` object, needed for performing the WFS GetFeature request. */ protected getFeatureOptionsFromSelectionParam(selectionParam: SelectionParam): GetFeatureOptionsPartial | null; /** * Creates a `WriteGetFeatureOptions` object by expanding the provided partial options. * Required for a ol GetFeature WFS request. */ protected completeGetFeatureOptions(options: GetFeatureOptionsPartial): Promise; /** * Sends a GetFeature request to a WFS endpoint based on provided options and parses the received GML answer. */ protected getFeatureRaw(getFeatureOptions: WriteGetFeatureOptions): Promise[]>; /** * Sets or removes a time restriction on the provided query layer. Depending on the presence of a time attribute, * either a temporal XML filter is created or a TIME parameter is added to the URL. * * @param {QueryableLayerWms} queryLayer - The layer on which the time restriction is to be applied. * @return {Filter | undefined} Returns a temporal XML filter if a time attribute exists; otherwise, undefined. */ private setTimeRestriction; private getTimeRestrictionFilter; private addTimeRestrictionAsUrlParameter; private removeTimeRestrictionAsUrlParameter; private checkForExceptions; } export type QueryableLayerWms = Omit & { queryLayers: string; }; export type GetFeatureOptionsPartial = Omit & { featureNS?: string; featurePrefix?: string; featureTypes: string[]; }; export declare class WfsClientMapServer extends WfsClient { constructor(ogcServer: ServerOgc, options: WfsClientOptionalOptions, context: IGirafeContext); } export declare class WfsClientQgis extends WfsClient { constructor(ogcServer: ServerOgc, options: WfsClientOptionalOptions, context: IGirafeContext); } export declare class WfsClientGeorama extends WfsClient { protected version: string; constructor(ogcServer: ServerOgc, options: WfsClientOptionalOptions, context: IGirafeContext); } export declare const WfsClientDefault: typeof WfsClientQgis; export declare const WfsClientGeoServer: typeof WfsClientMapServer;