import { getCapabilities, getWFSLayerInfo } from "@arcgis/core/layers/ogc/wfsUtils.js";const { getCapabilities, getWFSLayerInfo } = await $arcgis.import("@arcgis/core/layers/ogc/wfsUtils.js");Type definitions
GetCapabilitiesOptions
- Supertypes
- AbortOptions
customParameters
- Type
- CustomParameters | null | undefined
A list of key-value pairs of parameters to append to the url.
WFSCapabilities
WFS service information about the available layers and operations.
operations
- Type
- WFSOperations
Information about the operations needed to consume the WFS service.
featureTypes
- Type
- Array<WFSFeatureType>
An array of featureTypes (or layers) available in the WFS service.
WFSOperations
Information about some operations of the WFS service.
- See also
WFSFeatureType
Provides information about an individual feature type, or layer, found in the WFS service.
- See also
defaultSpatialReference
- Type
- number
the default spatialReference wkid used when not explicitely specified in the GetFeature call.
supportedSpatialReferences
- Type
- number[]
An array of spatialReference wkids that are supported on the featureType.
WFSLayerInfoOptions
- Supertypes
- AbortOptions
spatialReference
- Type
- SpatialReference | undefined
The desired spatial reference for the layer. By default will use the default spatial reference of the feature type.
customParameters
- Type
- CustomParameters | null | undefined
A list of key-value pairs of parameters to append to the url.
WFSLayerInfo
The layer info from the WFS service.
- See also
wfsCapabilities
- Type
- WFSCapabilities
customParameters
- Type
- CustomParameters | null | undefined
The custom parameters applied to the layer.
Functions
getCapabilities
Fetches the GetCapabilities document of a WFS service which contains information about the list of layers in the service and the available operations.
- Signature
-
getCapabilities (url: string, options?: GetCapabilitiesOptions): Promise<WFSCapabilities>
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| url | The URL to the WFS endpoint. | | |
| options | | |
- Returns
- Promise<WFSCapabilities>
The WFS Capabilities for the service.
Example
const capabilities = await wfsUtils.getCapabilities(url);const layerInfo = await wfsUtils.getWFSLayerInfo(capabilities, "layer");
const layer = WFSLayer.fromWFSLayerInfo(layerInfo);
// Same asconst layer = WFSLayer({ url, name: "layer"}); getWFSLayerInfo
Returns the WFSLayerInfo from the capabilities of the WFS service. Can be used in conjunction with getCapabilities
- Signature
-
getWFSLayerInfo (capabilities: WFSCapabilities, name?: string | null, namespaceUri?: string | null, options?: WFSLayerInfoOptions): Promise<WFSLayerInfo>
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| capabilities | The capabilities of the WFS service. | | |
| name | The type name to get information for. If not specified, the first layer of the service is chosen. | | |
| namespaceUri | The namespace URI of the type name. If not specified, the first namespace found for the | | |
| options | An object specifying additional options. See the object specification table below for the required properties of this object. | |
- Returns
- Promise<WFSLayerInfo>
The layer info that can be used to create a WFSLayer
Example
const capabilities = await wfsUtils.getCapabilities(url);const layerInfo = await wfsUtils.getWFSLayerInfo(capabilities, "layer");
const layer = WFSLayer.fromWFSLayerInfo(layerInfo);
// Same asconst layer = WFSLayer({ url, name: "layer"});