Class: WFS

ol/format/WFS~WFS


import WFS from 'ol/format/WFS';

Feature format for reading and writing data in the WFS format. By default, supports WFS version 1.1.0. You can pass a GML format as option if you want to read a WFS that contains GML2 (WFS 1.0.0). Also see module:ol/format/GMLBase~GMLBase which is used by this format.

new WFS(opt_options)

format/WFS.js, line 205
Name Type Description
options

Optional configuration object.

Name Type Description
featureNS Object.<string, string> | string

The namespace URI used for features.

featureType Array.<string> | string

The feature type to parse. Only used for read operations.

gmlFormat module:ol/format/GMLBase~GMLBase

The GML format to use to parse the response. Default is ol/format/GML3.

schemaLocation string

Optional schemaLocation to use for serialization, this will override the default.

Methods

readFeatureCollectionMetadata(source){module:ol/format/WFS~FeatureCollectionMetadata|undefined}

format/WFS.js, line 307

Read feature collection metadata of the source.

Name Type Description
source Document | Node | Object | string

Source.

Returns:
FeatureCollection metadata.

readTransactionResponse(source){module:ol/format/WFS~TransactionResponse|undefined}

format/WFS.js, line 285

Read transaction response of the source.

Name Type Description
source Document | Node | Object | string

Source.

Returns:
Transaction response.

writeGetFeature(options){Node}

format/WFS.js, line 381

Encode format as WFS GetFeature and return the Node.

Name Type Description
options

Options.

Name Type Description
featureNS string

The namespace URI used for features.

featurePrefix string

The prefix for the feature namespace.

featureTypes Array.<string>

The feature type names.

srsName string

SRS name. No srsName attribute will be set on geometries when this is not provided.

handle string

Handle.

outputFormat string

Output format.

maxFeatures number

Maximum number of features to fetch.

geometryName string

Geometry name to use in a BBOX filter.

propertyNames Array.<string>

Optional list of property names to serialize.

startIndex number

Start index to use for WFS paging. This is a WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services.

count number

Number of features to retrieve when paging. This is a WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services. Please note that some Web Feature Services have repurposed maxfeatures instead.

bbox module:ol/extent~Extent

Extent to use for the BBOX filter.

filter module:ol/format/filter/Filter~Filter

Filter condition. See module:ol/format/Filter for more information.

resultType string

Indicates what response should be returned, E.g. hits only includes the numberOfFeatures attribute in the response and no features.

Returns:
Result.

writeTransaction(inserts, updates, deletes, options){Node}

format/WFS.js, line 446

Encode format as WFS Transaction and return the Node.

Name Type Description
inserts Array.<module:ol/Feature~Feature>

The features to insert.

updates Array.<module:ol/Feature~Feature>

The features to update.

deletes Array.<module:ol/Feature~Feature>

The features to delete.

options

Write options.

Name Type Default Description
featureNS string

The namespace URI used for features.

featurePrefix string

The prefix for the feature namespace.

featureType string

The feature type name.

srsName string

SRS name. No srsName attribute will be set on geometries when this is not provided.

handle string

Handle.

hasZ boolean

Must be set to true if the transaction is for a 3D layer. This will allow the Z coordinate to be included in the transaction.

nativeElements Array.<Object>

Native elements. Currently not supported.

gmlOptions module:ol/format/GMLBase~Options

GML options for the WFS transaction writer.

version string '1.1.0'

WFS version to use for the transaction. Can be either 1.0.0 or 1.1.0.

Returns:
Result.