Class GmlFeatureXmlSource<TFeature>
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
TFeatureThe 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
featuresIReadOnlyList<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
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
complexIS100ComplexAttribute
Returns
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
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
cancellationTokenCancellationTokenSignals 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
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
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
rootXElement
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
featureTFeaturefeatureElementXElement