Class: WFS

ol.format.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 ol.format.GMLBase which is used by this format.

new ol.format.WFS(opt_options)

src/ol/format/wfs.js, line 30
Name Type Description
options

Optional configuration object.

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

The namespace URI used for features.

featureType Array.<string> | string | undefined

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

gmlFormat ol.format.GMLBase | undefined

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

schemaLocation string | undefined

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

Extends

Methods

ol.format.WFS.writeFilter(filter){Node}

src/ol/format/wfs.js, line 903

Encode filter as WFS Filter and return the Node.

Name Type Description
filter ol.format.filter.Filter

Filter.

Returns:
Result.

readFeatureCollectionMetadata(source){ol.WFSFeatureCollectionMetadata|undefined}

src/ol/format/wfs.js, line 201

Read feature collection metadata of the source.

Name Type Description
source Document | Node | Object | string

Source.

Returns:
FeatureCollection metadata.

readFeatures(source, opt_options){Array.<ol.Feature>}

src/ol/format/wfs.js, line 144

Read all features from a WFS FeatureCollection.

Name Type Description
source Document | Node | Object | string

Source.

options

Read options.

Name Type Description
dataProjection ol.ProjectionLike

Projection of the data we are reading. If not provided, the projection will be derived from the data (where possible) or the defaultDataProjection of the format is assigned (where set). If the projection can not be derived from the data and if no defaultDataProjection is set for a format, the features will not be reprojected.

extent ol.Extent

Tile extent of the tile being read. This is only used and required for ol.format.MVT. Required.

featureProjection ol.ProjectionLike

Projection of the feature geometries created by the format reader. If not provided, features will be returned in the dataProjection.

Returns:
Features.

readProjection(source){ol.proj.Projection}

src/ol/format/wfs.js, line 1071

Read the projection from a WFS source.

Name Type Description
source Document | Node | Object | string

Source.

Returns:
Projection.

readTransactionResponse(source){ol.WFSTransactionResponse|undefined}

src/ol/format/wfs.js, line 178

Read transaction response of the source.

Name Type Description
source Document | Node | Object | string

Source.

Returns:
Transaction response.

writeGetFeature(options){Node}

src/ol/format/wfs.js, line 934

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. Required.

featurePrefix string

The prefix for the feature namespace. Required.

featureTypes Array.<string>

The feature type names. Required.

srsName string | undefined

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

handle string | undefined

Handle.

outputFormat string | undefined

Output format.

maxFeatures number | undefined

Maximum number of features to fetch.

geometryName string | undefined

Geometry name to use in a BBOX filter.

propertyNames Array.<string> | undefined

Optional list of property names to serialize.

startIndex number | undefined

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 | undefined

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 ol.Extent | undefined

Extent to use for the BBOX filter.

filter ol.format.filter.Filter | undefined

Filter condition. See ol.format.filter for more information.

resultType string | undefined

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}

src/ol/format/wfs.js, line 1001

Encode format as WFS Transaction and return the Node.

Name Type Description
inserts Array.<ol.Feature>

The features to insert.

updates Array.<ol.Feature>

The features to update.

deletes Array.<ol.Feature>

The features to delete.

options

Write options.

Name Type Description
featureNS string

The namespace URI used for features. Required.

featurePrefix string

The prefix for the feature namespace. Required.

featureType string

The feature type name. Required.

srsName string | undefined

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

handle string | undefined

Handle.

hasZ boolean | undefined

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. Required.

gmlOptions olx.format.GMLOptions | undefined

GML options for the WFS transaction writer.

version string | undefined

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

Returns:
Result.