Table of Contents

Class FeatureInfoBuilder

Namespace
EncDotNet.S100.Datasets.Pipelines
Assembly
EncDotNet.S100.Datasets.Pipelines.dll

Shared helpers for assembling PickAttribute trees from the (simple-attribute dictionary + complex-attribute list) shape that every GML dataset reader exposes today. Centralised here so each product processor's GetFeatureInfo implementation stays a thin adapter.

public static class FeatureInfoBuilder
Inheritance
FeatureInfoBuilder
Inherited Members

Fields

FileReferenceAttributeCodes

S-100 attribute codes (and their S-57-era aliases) whose value names an externally referenced text file co-located in the exchange set. Defined by the S-101 Feature Catalogue simple attribute fileReference ("The file name of an externally referenced text file"), aliases TXTDSC and NTXTDS. Matched case-insensitively when resolving file references.

public static readonly IReadOnlySet<string> FileReferenceAttributeCodes

Field Value

IReadOnlySet<string>

Methods

Build(IEnumerable<KeyValuePair<string, string>>, IEnumerable<ComplexAttributeRow>, FeatureCatalogueDecoder?)

Builds a PickAttribute tree from raw simple/complex attribute payloads. When decoder is non-null, each row is decorated with FC-resolved name/label; otherwise only the raw shape is populated.

public static IReadOnlyList<PickAttribute> Build(IEnumerable<KeyValuePair<string, string>> simpleAttributes, IEnumerable<FeatureInfoBuilder.ComplexAttributeRow> complexAttributes, FeatureCatalogueDecoder? decoder)

Parameters

simpleAttributes IEnumerable<KeyValuePair<string, string>>
complexAttributes IEnumerable<FeatureInfoBuilder.ComplexAttributeRow>
decoder FeatureCatalogueDecoder

Returns

IReadOnlyList<PickAttribute>

BuildDepthLeaf(string, string, double)

Builds a depth-typed PickAttribute for a value that is already known to be metres (e.g. an S-102 coverage sample). Sets DepthMetresValue so the viewer can re-format the value through the active DepthUnit without re-parsing RawValue.

public static PickAttribute BuildDepthLeaf(string code, string name, double metres)

Parameters

code string
name string
metres double

Returns

PickAttribute

BuildFlat(IEnumerable<KeyValuePair<string, string?>>, FeatureCatalogueDecoder?)

Creates a flat PickAttribute list from a plain dictionary of code → value pairs. ISO 8211 records keep their repeated and complex attributes through BuildTree(IReadOnlyList<AttributeRow>, FeatureCatalogueDecoder?).

public static IReadOnlyList<PickAttribute> BuildFlat(IEnumerable<KeyValuePair<string, string?>> attributes, FeatureCatalogueDecoder? decoder)

Parameters

attributes IEnumerable<KeyValuePair<string, string>>
decoder FeatureCatalogueDecoder

Returns

IReadOnlyList<PickAttribute>

BuildTree(IReadOnlyList<AttributeRow>, FeatureCatalogueDecoder?)

Builds a PickAttribute tree from ISO 8211 attribute rows (S-100 Part 10a ATTR with its PAIX parent index): every row is kept, so a repeated attribute gives one row per value, and each complex attribute nests its sub-attributes, to any depth, as Children. Leaves with no value and complex attributes with no valued leaves are left out. A row whose parent index doesn't name an earlier row is treated as top-level.

public static IReadOnlyList<PickAttribute> BuildTree(IReadOnlyList<FeatureInfoBuilder.AttributeRow> rows, FeatureCatalogueDecoder? decoder)

Parameters

rows IReadOnlyList<FeatureInfoBuilder.AttributeRow>

The record's attribute rows, in record order.

decoder FeatureCatalogueDecoder

Decodes names and listed values, or null.

Returns

IReadOnlyList<PickAttribute>

The top-level rows, in record order.

CollectResolvedFileReferences(IReadOnlyList<PickAttribute>)

Walks attributes (including complex-attribute children) and returns every resolved file-reference leaf in document order. Used by presentation layers to lift externally referenced text out of the attribute table into a dedicated section.

public static IReadOnlyList<PickAttribute> CollectResolvedFileReferences(IReadOnlyList<PickAttribute> attributes)

Parameters

attributes IReadOnlyList<PickAttribute>

Returns

IReadOnlyList<PickAttribute>

IsResolvedFileReference(PickAttribute)

true when attr is a file-reference leaf (see FileReferenceAttributeCodes) whose external text has already been resolved (HasExternalText). Such rows are surfaced as standalone "referenced text" blocks rather than crammed into the key/value attribute table.

public static bool IsResolvedFileReference(PickAttribute attr)

Parameters

attr PickAttribute

Returns

bool

ResolveFileReferences(IReadOnlyList<PickAttribute>, Func<string, string?>)

Returns a copy of attributes in which every file-reference leaf (see FileReferenceAttributeCodes) has its ExternalText populated from resolver. The resolver is invoked with the referenced file name (the attribute's RawValue) and should return the file's textual content, or null when it cannot be resolved (missing, oversized, unreadable). Complex-attribute children are walked recursively, since fileReference is bound as a sub-attribute of the S-101 information / textContent complex attributes (S-101 Feature Catalogue).

public static IReadOnlyList<PickAttribute> ResolveFileReferences(IReadOnlyList<PickAttribute> attributes, Func<string, string?> resolver)

Parameters

attributes IReadOnlyList<PickAttribute>

The attribute tree to enrich.

resolver Func<string, string>

File-name → text resolver, typically backed by the dataset's exchange-set asset source. Must not be null.

Returns

IReadOnlyList<PickAttribute>

A new list with resolved file references; rows that are not file references, carry no value, or whose file could not be resolved are returned with ExternalText left null. The input list is returned unchanged when it contains no file references.

WithoutResolvedFileReferences(IReadOnlyList<PickAttribute>)

Returns a copy of attributes with every resolved file-reference leaf (see IsResolvedFileReference(PickAttribute)) removed. Complex-attribute parents whose children become empty after pruning are dropped as well, so the attribute table never shows a header with no rows beneath it. The input list is returned unchanged when it contains no resolved file references.

public static IReadOnlyList<PickAttribute> WithoutResolvedFileReferences(IReadOnlyList<PickAttribute> attributes)

Parameters

attributes IReadOnlyList<PickAttribute>

Returns

IReadOnlyList<PickAttribute>