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.
A Store instance, used by a LuciadRIA feature layer, uses this method on each Store.query invocation,
passing the options
parameter containing the data to decode.
If CodecDecodeOptions.reference option is present, the decoded features' shapes are encoded with this reference.
the decoding options
featureCursor a Cursor of Feature instances 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 LuciadRIA 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);
Spatial reference
The reference for shape decoding process is determined in the following way and order:
crs
field. This reference is used if you don't specify it in step 1 or 2.
Supported versions
LuciadRIA supports the GML 3.1 and GML 3.2 specifications, with the following limitations:
LuciadRIA supports the GML Circle (a circle defined by 3 points) and GML CircleByCenterPoint geometries, described in GML 3.2.1 specification. Circle geometries are interpolated to Polyline instances.