Creates a GML codec. This codec has support for the GML 3.1.1 and GML 3.2.1 with a simple feature profile level SF-0.
Optionaloptions: GMLCodecConstructorOptionsan object literal that contains configuration settings for the codec.
Decodes the server response, which contains valid GML, into Feature instances.
The ID of each decoded feature is retrieved from the gml:id attribute.
If this attribute is not present, the ID is automatically generated using
GMLCodecConstructorOptions.idProvider.
This method is invoked as part of a Store.query call, with the options parameter containing the data to decode.
If the CodecDecodeOptions.reference option is provided, the decoded feature shapes are created using that reference.
the decoding options
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:
Pointis mapped to a Point.LineStringis mapped to a Polyline.LinearRingis mapped to a Polygon.PolygonandPolygonPatchare mapped to a Polygon if no interiorRingis defined, or to a ComplexPolygon, if at least one interiorRingis present.Curveis mapped to a Polyline, Arc, Circle, or a ShapeList if multiple curve segments are defined.Surfaceis mapped to Polygon instances (if the GML geometry does not define the interiorRing), and ComplexPolygon instances (if the GML geometry defines at least one interiorRing).MultiPoint,MultiLineString,MultiPolygon,MultiCurveandMultiSurfaceare mapped to ShapeList instances containing the corresponding decoded shapes.Circles defined by
CircleorCircleByCenterPointare represented as Circle shapes. Arc segments defined byArcByCenterPointare represented as Arc shapes. Circle and Arc geometries are interpolated only when processing curves as part of polygon ring construction.The current implementation of GMLCodec is limited to the decoding of features containing the aforementioned geometry elements. Encoding is currently not supported.
A GMLCodec can be used in combination with a WFSFeatureStore to decode GML data directly from a WFS service.
A GMLCodec can also be used to decode a file directly from a url, using a UrlStore:
Spatial reference
The reference used for the shape decoding process is determined in the following order:
decode()request.decode()call, as described in the previous step.crsfield. This is used if no reference is provided in the previous steps.Arc interpretation
When a multi-segment
CurvecontainsArcByCenterPointsegments, the arc direction can be controlled via thecurveArcInterpretationoption. See CurveArcInterpretation for the available modes and their semantics.Supported versions
LuciadRIA supports the GML 3.1 and GML 3.2 specifications, with the following characteristics:
Circle,CircleByCenterPoint, andArcByCenterPoint.