Creates a GML codec. This codec has support for GML 3.1.1 and GML 3.2.1 with a simple feature profile level SF-0.
an object literal that contains configuration settings for the codec.
Decodes the server response, which is valid GML, to a Cursor of Feature instances.
The ID of decoded feature is retrieved from the gml:id
attribute.
If the attribute does not exist, the ID is auto-generated using
GMLCodecConstructorOptions.idProvider.
the decoding options
featureCursor A Cursor
of Feature
s corresponding to the server response.
Encoding is currently not supported. Calling this method will throw an error.
A GMLCodec is responsible for decoding a GML document object into a set of LuciadRIA Feature objects containing LuciadRIA geometries and properties.
The codec decodes GML geometries to shapes as follows:
A GMLCodec can be used in combination with a WFSFeatureStore to decode GML data directly from a WFS service.
const storePromise = WFSFeatureStore.createFromURL("http://sampleservices.luciad.com/wfs", "usrivers", { codec: new GMLCodec(), outputFormat: "text/xml; subtype=gml/3.1.1" });
A GMLCodec can also be used to decode a file directly from a url, using a UrlStore:
//Create a Store with a GeoJson codec to decode the data const store = new UrlStore({ target: url, codec: new GMLCodec() }); //Use the store to create a model const model = new FeatureModel(store); //Create a layer for the model const layer = new FeatureLayer(model); //Add the layer to the map map.layerTree.addChild(layer);
Supported versions
LuciadRIA supports the GML 3.1 and GML 3.2 specifications, with the following limitations: