Interface IDatasetProcessor
Processes a dataset file and exposes feature/coverage pick info,
enumeration, and validation. Rendering is performed separately by a
renderer that consumes the processor's portrayal-output seam (e.g.
IVectorPortrayalSource / ICoveragePortrayalSource), so this
abstraction carries no renderer (Mapsui) type. Constructed once per file.
public interface IDatasetProcessor
Properties
AxisOrder
The outcome of the dataset-level axis-order check the reader ran on
the dataset's positions (issue #650), or null when the product
has no positions to check or the reader does not run it. A
Swapped outcome
means the reader swapped latitude and longitude for the whole dataset
(when Normalized
is set). Surfaced by hosts (CLI info, the viewer's dataset list)
and, when swapped or inconsistent, as a {product}-PROJ-AXIS
warning in Validate().
AxisOrderAssessment? AxisOrder { get; }
Property Value
Metadata
The lightweight, product-agnostic DatasetMetadata for this dataset — its declared specification and, where cheaply derivable, its geographic extent, horizontal CRS, display-scale window, and temporal coverage. Overriding processors derive it once from the already-parsed dataset (never a second parse) and cache it, so hosts can frame a viewport, register a layer, draw an out-of-scale indicator, or gate visibility without re-reading the dataset. The default implementation does not override this and instead returns a fresh, minimal value carrying only Spec on each access; processors that can supply an extent (and other facts) override it with the derive-once-and-cache behaviour above. See issue #467 / #460.
DatasetMetadata Metadata { get; }
Property Value
PortrayalSpec
The specification whose Feature Catalogue, Portrayal Catalogue, and
ECDIS display conventions are actually used to process and draw this
dataset. Equal to Spec for every native S-100 product;
for a legacy S-57 cell (translated in-memory to S-101) this is
"S-101" while Spec stays "S-57". Callers
resolving a portrayal / feature catalogue, keying viewing-group or
display-category state, or selecting a display mode must key off this
rather than Spec; callers labelling, validating, or
version-assessing the dataset use Spec. The default is
Spec; a processor that portrays its product through another
specification's catalogue (the S-57 processor) overrides it.
SpecRef PortrayalSpec { get; }
Property Value
Spec
The product specification (name + edition) this dataset declares
conformance to. Each per-spec processor returns a fixed name (e.g.
"S-101"); the edition portion is populated from the dataset itself
(HDF5 productSpecification attribute, GML application
namespace, S-101 ProductSpecificationEdition, etc.) when known,
otherwise defaults to SpecVersion default.
SpecRef Spec { get; }
Property Value
VersionAssessment
How the dataset's declared product specification edition
(Spec) relates to the version of the catalogue used to
process it, or null when no catalogue self-describes its
version (so no assessment can be made). Computed once at construction
— catalogue resolution is a one-shot per processor — and surfaced by
hosts (CLI info/render, viewer layer list) to warn on a
version mismatch per S-100 Edition 5.2.1 Part 2 §6.
SpecVersionAssessment? VersionAssessment { get; }
Property Value
Methods
EnumerateFeatures()
Enumerates a lightweight summary of every feature exposed by this processor — used to seed the viewer's feature-search index without forcing a full GetFeatureInfo(string) call per feature.
IEnumerable<FeatureSummary> EnumerateFeatures()
Returns
Remarks
Coverage products (S-102, S-104, S-111) and any processor that does not expose discrete features should leave this returning the default empty enumeration.
GetCoverageInfo(double, double, DateTime?)
Samples this dataset at the supplied geographic position and
returns a synthetic FeatureInfo describing the
underlying coverage value(s) — used by the viewer to provide a
pick experience on raster / coverage products (S-102, S-104,
S-111). Vector products do not implement this method and the
default implementation returns null.
FeatureInfo? GetCoverageInfo(double latitude, double longitude, DateTime? time)
Parameters
latitudedoubleClick position latitude in WGS84 degrees.
longitudedoubleClick position longitude in WGS84 degrees.
timeDateTime?The selected time step for time-aware coverages (S-104, S-111); ignored by static coverages (S-102). When
nullthe implementation chooses the dataset's first available time step.
Returns
- FeatureInfo
A FeatureInfo whose Attributes carry the sampled coverage values, or
nullif the click falls outside the dataset extent or this processor does not expose coverage data.
GetFeatureGeometryAt(int)
Returns the renderer-neutral geometry of the feature at the given enumeration ordinal — the same index reported by Ordinal and carried by Ordinal, so a pick resolves to its outline the same collision-free way GetFeatureInfoAt(int) resolves its attributes. Lets a host highlight or outline a picked feature without reaching into a product's feature model.
S100FeatureGeometry? GetFeatureGeometryAt(int ordinal)
Parameters
ordinalint
Returns
- S100FeatureGeometry
The feature's geometry, or
nullwhen the ordinal is out of range or this processor does not expose discrete vector features (coverage / non-vector products leave the default and pick through GetCoverageInfo(double, double, DateTime?)).
GetFeatureInfo(string)
Returns information about a feature identified by its reference string
(as stored in the rendered feature via the renderer's feature-ref key),
or null if the feature cannot be found.
FeatureInfo? GetFeatureInfo(string featureRef)
Parameters
featureRefstring
Returns
Remarks
Real-world datasets occasionally contain features that share a
gml:id (a producer bug), so callers that already know the
feature's position within the dataset should prefer
GetFeatureInfoAt(int) for a collision-free lookup.
GetFeatureInfoAt(int)
Returns information about the feature at the given enumeration
ordinal — the same index reported via
Ordinal from
EnumerateFeatures(). Used by the search index so
duplicate gml:ids (a real producer bug) still route to
the correct feature.
FeatureInfo? GetFeatureInfoAt(int ordinal)
Parameters
ordinalint
Returns
- FeatureInfo
Feature info, or
nullwhen the ordinal is out of range or this processor does not expose discrete features.
GetNavigationalWarningMessage()
Returns the dataset's navigational warning as a whole (S-124: its
NavwarnPreamble and References), with no part's validity,
text or geometry. A cancellation or an in-force bulletin may have no
parts, so GetNavigationalWarnings() doesn't list it, yet it
ends other warnings; build a NavigationalWarningSet from it.
NavigationalWarningInfo? GetNavigationalWarningMessage()
Returns
- NavigationalWarningInfo
The warning, or
nullwhen the product carries none.
GetNavigationalWarnings()
Returns every navigational warning part in the dataset (each S-124
NavwarnPart) with its message, in dataset order, including parts
with no geometry. Lets a host list warnings without picking them: a
part with no location draws nothing, so a pick can never reach it.
IReadOnlyList<NavigationalWarningFeature> GetNavigationalWarnings()
Returns
- IReadOnlyList<NavigationalWarningFeature>
One entry per warning part, or an empty list when the product carries no warnings.
HitTestFeatures(double, double, double)
Hit-tests this dataset's vector features against a geographic point,
returning every feature whose geometry contains the point (area
features) or lies within radiusMeters of it (point /
curve features), in feature-enumeration order. The reusable geographic
complement to GetCoverageInfo(double, double, DateTime?): a caller resolves each hit
to full attributes via GetFeatureInfoAt(int) (or
GetFeatureInfo(string)) and ranks the results across datasets
itself — for example by a rendering paint stack, which the processor
contract deliberately knows nothing about.
IReadOnlyList<FeatureGeometryHit> HitTestFeatures(double latitude, double longitude, double radiusMeters)
Parameters
latitudedoublePick latitude in WGS-84 degrees.
longitudedoublePick longitude in WGS-84 degrees.
radiusMetersdoubleSearch tolerance for point/curve features in metres; area features use exact containment and ignore it. Negative or non-finite values are treated as 0.
Returns
- IReadOnlyList<FeatureGeometryHit>
The matching features in enumeration order — each Ordinal aligns with GetFeatureInfoAt(int) — or an empty list. Vector processors override this; coverage / non-vector processors leave the default empty implementation and expose picks through GetCoverageInfo(double, double, DateTime?) instead.
Validate()
Runs the spec's normative validation rule pack against this
processor's parsed dataset and returns the aggregated report,
or null when no rule pack is available for the spec
(e.g. coverage products and S-101 / S-201 / S-57 today).
ValidationReport? Validate()
Returns
Remarks
Validation is a pure function of the parsed dataset and does
not depend on the current palette, opacity, or selected time
step; callers cache the report rather than re-running it on
every render. Implementations should run the projection
(S125AtonDataset.From(...), etc.) lazily and cache the
resulting ValidationReport on a private field so
repeated calls are cheap.
A return value of null means "no rule pack is yet
defined for this spec" — distinct from
Empty, which means "rules were
evaluated and found nothing".