Constructor options for GMLCodec.

Hierarchy

  • GMLCodecConstructorOptions

Properties

failOnUnsupportedGeometry?: boolean

Controls how codec will react when an unsupported geometry type is detected. This can happen when a geometry component is not part of the simple feature GML profile. If true, the codec throws an error when the geometry type is unsupported. Otherwise, a feature with an empty ShapeList is created.

idProvider?: FeatureIDProvider

Defines a custom callback function to provide IDs for decoded features that come without IDs. This callback is invoked by LuciadRIA with a decoded feature for which the ID should be returned. When the provided ID is invalid then the feature ID will be auto-generated based on feature's properties and the shape.

Note: Having features in LuciadRIA with stable IDs that do not change on each query request is important for the performance sake. For example, when features do not have intrinsic IDs on each query request, then instead of adding and removing the relevant features only, all the existing features are removed, and all the new ones are added.

// GMLCodec will use IDs from a feature property.
const codec = new GMLCodec({ idProvider: (feature: Feature) => feature.properties.id });

Since

2021.1.03

The reference in which the Feature instances should be defined when decoding GML data. Make sure the reference on your FeatureModel is the same as the reference on this codec.

Since

2022.0

swapAxes?: string[]

Indicates whether the codec should swap the axis ordering of coordinates in the GML features for the specified reference identifier(s). If undefined, the codec will respect the axis ordering dictated by the reference. For each specified reference, the order will be reversed. This is for example needed for EPSG:4326 data that is encoded in longitude-latitude order instead of latitude-longitude.