Table of Contents

Class GmlFeatureXmlSource<TFeature>

Namespace
EncDotNet.S100.Pipelines.Vector
Assembly
EncDotNet.S100.Core.dll

Generic base class that projects GML-encoded S-100 features into the S-100 Part 9 FeatureXML intermediate format consumed by XSLT portrayal rules.

public class GmlFeatureXmlSource<TFeature> : IFeatureXmlSource where TFeature : IS100Feature

Type Parameters

TFeature

The concrete feature type constrained to IS100Feature.

Inheritance
GmlFeatureXmlSource<TFeature>
Implements
Derived
Inherited Members

Remarks

Emits the standard Dataset shape expected by the XSLT pipeline:

<Dataset>
  <Points>…</Points>
  <Features>…</Features>
</Dataset>

Subclasses can override WriteFeatureExtensions(TFeature, XElement), BuildComplexAttributeElement(IS100ComplexAttribute), and WriteDatasetExtensions(XElement) to add spec-specific elements (e.g. information types, xlink references, nested complex attributes).

S-411 does not use this class — its FeatureXML is a pass-through of the original GML document.

Constructors

GmlFeatureXmlSource(IReadOnlyList<TFeature>)

Initializes a new GmlFeatureXmlSource<TFeature>.

public GmlFeatureXmlSource(IReadOnlyList<TFeature> features)

Parameters

features IReadOnlyList<TFeature>

Properties

FeatureTypesPresent

Returns the feature type codes present in the dataset, used to select applicable portrayal rules before running any XSLT transforms.

public IReadOnlyList<string> FeatureTypesPresent { get; }

Property Value

IReadOnlyList<string>

Methods

BuildComplexAttributeElement(IS100ComplexAttribute)

Builds an XML element for a complex attribute. Override for specs that support nested complex attributes (e.g. S-128).

protected virtual XElement BuildComplexAttributeElement(IS100ComplexAttribute complex)

Parameters

complex IS100ComplexAttribute

Returns

XElement

EmitPointRef(XElement, XElement, ref int, double, double)

Emits a point into the registry and a reference into the feature.

protected static void EmitPointRef(XElement pointsElement, XElement featureElement, ref int counter, double lat, double lon)

Parameters

pointsElement XElement
featureElement XElement
counter int
lat double
lon double

GetFeatureXml(CancellationToken)

Returns an XmlReader positioned at the start of the S-100 FeatureXML document. The caller owns the reader and will dispose it.

public XmlReader GetFeatureXml(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Signals that the render has been cancelled. Implementations project FeatureXML from already-in-memory dataset state, so the work is CPU-bound rather than I/O-bound; the token lets a long projection be abandoned cooperatively (the method remains synchronous).

Returns

XmlReader

TransformAttributeValue(string, string)

Transforms an attribute value before it is written to the FeatureXML. Default returns the value unchanged. Override for specs whose upstream XSLT portrayal rules require attribute values in a canonical form (e.g. listed-value numeric codes rather than the human-readable labels emitted by some producers).

protected virtual string TransformAttributeValue(string code, string value)

Parameters

code string

The attribute code.

value string

The original attribute value.

Returns

string

The value to write into FeatureXML.

WriteDatasetExtensions(XElement)

Called after all features have been written to the root Dataset element. Override to add spec-specific dataset-level elements such as an InformationTypes section.

protected virtual void WriteDatasetExtensions(XElement root)

Parameters

root XElement

WriteFeatureExtensions(TFeature, XElement)

Called after attributes and complex attributes have been written to a feature element. Override to add spec-specific elements such as xlink references or information-type associations.

protected virtual void WriteFeatureExtensions(TFeature feature, XElement featureElement)

Parameters

feature TFeature
featureElement XElement