wfsUtils

AMD: require(["esri/layers/ogc/wfsUtils"], (wfsUtils) => { /* code goes here */ });
ESM: import * as wfsUtils from "@arcgis/core/layers/ogc/wfsUtils.js";
Object: esri/layers/ogc/wfsUtils
Since: ArcGIS Maps SDK for JavaScript 4.20

Provides utility functions for the WFSLayer.

See also

Method Overview

Name Return Type Summary Object

Fetches the GetCapabilities document of a WFS service which contains information about the list of layers in the service and the available operations.

wfsUtils

Returns the WFSLayerInfo from the capabilities of the WFS service.

wfsUtils

Method Details

getCapabilities

Method
getCapabilities(url, options){Promise<WFSCapabilities>}

Fetches the GetCapabilities document of a WFS service which contains information about the list of layers in the service and the available operations.

Parameters
Specification
url String

The URL to the WFS endpoint.

options Object
optional
Specification
customParameters Object
optional

A list of key-value pairs of parameters to append to the url.

signal AbortSignal
optional

An AbortSignal to abort the executions of the remote method. If canceled, the promise will be rejected with an error named AbortError. See also AbortController.

Returns
Type Description
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 as
const layer = WFSLayer({
  url,
  name: "layer"
});

getWFSLayerInfo

Method
getWFSLayerInfo(capabilities, name, namespaceUri, options){Promise<WFSLayerInfo>}

Returns the WFSLayerInfo from the capabilities of the WFS service. Can be used in conjunction with getCapabilities

Parameters
Specification
capabilities WFSCapabilities

The capabilities of the WFS service.

name String
optional

The type name to get information for. If not specified, the first layer of the service is chosen.

namespaceUri String
optional

The namespace URI of the type name. If not specified, the first namespace found for the name is chosen.

options Object
optional

An object specifying additional options. See the object specification table below for the required properties of this object.

Specification
customParameters Object
optional

A list of key-value pairs of parameters to append to the url.

spatialReference Object
optional

The desired spatial reference for the layer. By default will use the default spatial reference of the feature type.

signal AbortSignal
optional

An AbortSignal to abort the executions of the remote method. If canceled, the promise will be rejected with an error named AbortError. See also AbortController.

Returns
Type Description
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 as
const layer = WFSLayer({
  url,
  name: "layer"
});

Type Definitions

WFSCapabilities

Type Definition
WFSCapabilities

WFS service information about the available layers and operations.

Properties
operations WFSOperations

Information about the operations needed to consume the WFS service.

featureTypes WFSFeatureType[]

An array of featureTypes (or layers) available in the WFS service.

See also

WFSFeatureType

Type Definition
WFSFeatureType

Provides information about an individual feature type, or layer, found in the WFS service.

Properties
typeName String

The type name of the featureType. This will be of the format namespacePrefix:name.

name String

The name of the featureType.

title String

The title of the featureType.

description String

The description of the featureType.

The extent of the features.

namespacePrefix String

The prefix of the namespace.

namespaceUri String

The namespaceUri of the featureType.

defaultSpatialReference Number

the default spatialReference wkid used when not explicitely specified in the GetFeature call.

supportedSpatialReferences Number[]

An array of spatialReference wkids that are supported on the featureType.

See also

WFSLayerInfo

Type Definition
WFSLayerInfo

The layer info from the WFS service.

Properties
url String

The URL to the WFS service.

name String

The name of the layer in the WFS service to display.

namespaceUri String

The namespace URI for the layer name.

fields Field[]

The fields on the layer.

geometryType String

The geometry type of the features in the layer.

Possible Values:"point"|"multipoint"|"polyline"|"polygon"

objectIdField String

The field containing the object ID.

spatialReference SpatialReference

The spatial reference of the layer.

extent Extent

The extent of the layer.

Determines whether the X and Y coordinates should be swapped.

wfsCapabilities WFSCapabilities
customParameters Object

The custom parameters applied to the layer.

See also

WFSOperations

Type Definition
WFSOperations

Information about some operations of the WFS service.

Properties
GetCapabilities Object
Specification
url String

The URL to the GetCapabilities endpoint.

DescribeFeatureType Object
Specification
url String

The URL to the DescribeFeatureType endpoint.

GetFeature Object
Specification
url String

The URL to the GetFeature endpoint.

outputFormat String|null

Value of the output format parameter to send with the GetFeature call.

supportsPagination Boolean

Indicates if the GetFeature request supports pagination.

See also

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.