LuciadRIA (2026.0.07)
    Preparing search index...

    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:

    • Point is mapped to a Point.
    • LineString is mapped to a Polyline.
    • LinearRing is mapped to a Polygon.
    • Polygon and PolygonPatch are mapped to a Polygon if no interior Ring is defined, or to a ComplexPolygon, if at least one interior Ring is present.
    • Curve is mapped to a Polyline, Arc, Circle, or a ShapeList if multiple curve segments are defined.
    • Surface is mapped to Polygon instances (if the GML geometry does not define the interior Ring), and ComplexPolygon instances (if the GML geometry defines at least one interior Ring).
    • MultiPoint, MultiLineString, MultiPolygon, MultiCurve and MultiSurface are mapped to ShapeList instances containing the corresponding decoded shapes.

    Circles defined by Circle or CircleByCenterPoint are represented as Circle shapes. Arc segments defined by ArcByCenterPoint are 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.

      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 GML 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);

    The reference used for the shape decoding process is determined in the following order:

    • The reference passed to decode. Use this if you want to override the reference for a specific decode() request.
    • The reference passed to the constructor. This allows you to explicitly set a reference, overriding any reference specified in the data. You can still override it for a particular decode() call, as described in the previous step.
    • The reference specified in the data with the legacy crs field. This is used if no reference is provided in the previous steps.
    • If none of the above are specified, the specification’s default WGS 84 reference is used.

    When a multi-segment Curve contains ArcByCenterPoint segments, the arc direction can be controlled via the curveArcInterpretation option. See CurveArcInterpretation for the available modes and their semantics.

    LuciadRIA supports the GML 3.1 and GML 3.2 specifications, with the following characteristics:

    • The files must adhere to the Simple Feature Level-0 profile. In addition, selected curve segment types are supported: Circle, CircleByCenterPoint, and ArcByCenterPoint.
    • All geometries are assumed to use the same reference.
    • Envelopes are not decoded.

    Type Parameters

    • TFeature extends Feature = Feature

      Represents the type of Feature instances that are decoded by the codec. Default type is Feature without restrictions on shape and properties.

    Hierarchy (View Summary)

    Constructors

    Methods

    Constructors

    Methods