Class: WFS

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/wfsformat.js, line 29
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 experimental

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

readFeatureCollectionMetadata(source){ol.format.WFS.FeatureCollectionMetadata|undefined}

src/ol/format/wfsformat.js, line 172

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/wfsformat.js, line 114

Read all features from a WFS FeatureCollection.

Name Type Description
source Document | Node | Object | string

Source.

options

Read options.

Name Type Description
dataProjection ol.proj.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.

featureProjection ol.proj.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/wfsformat.js, line 745

Read the projection from a WFS source.

Name Type Description
source Document | Node | Object | string

Source.

Returns:
Projection.

readTransactionResponse(source){ol.format.WFS.TransactionResponse|undefined}

src/ol/format/wfsformat.js, line 148

Read transaction response of the source.

Name Type Description
source Document | Node | Object | string

Source.

Returns:
Transaction response.

writeGetFeature(options){Node}

src/ol/format/wfsformat.js, line 630

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

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 experimental

Geometry name to use in a BBOX filter.

bbox ol.Extent | undefined experimental

Extent to use for the BBOX filter.

Returns:
Result.

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

src/ol/format/wfsformat.js, line 685

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.

featurePrefix string

The prefix for the feature namespace.

featureType string

The feature type name.

srsName string | undefined experimental

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

handle string | undefined

Handle.

nativeElements Array.<Object> experimental

Native elements. Currently not supported.

gmlOptions olx.format.GMLOptions | undefined

GML options for the WFS transaction writer.

Returns:
Result.

Type Definitions

ol.format.WFS.FeatureCollectionMetadata{Object}

Number of features; bounds/extent.

ol.format.WFS.TransactionResponse{Object}

Total deleted; total inserted; total updated; array of insert ids.