Class WeatherPortrayal
Builds the renderer-neutral portrayal of a WeatherCoverageSource: one coverage sub-layer per WeatherCoverageStyle, carrying the style's S-98 plane, priority and opacity, ready for the Mapsui renderer or the headless compositor.
public static class WeatherPortrayal
- Inheritance
-
WeatherPortrayal
- Inherited Members
Remarks
Each style runs through the ordinary CoveragePipeline. A fill becomes a GridCoverageSubLayer at the style's Opacity, flagged ClipToWater when the style is (wave height) and carrying the band legend (Legend); symbols become an ArrowCoverageSubLayer served from Symbols, with southern-hemisphere barbs south of the equator; isolines (pressure) are traced from the style's Contours through the sampled grid (CoverageContours) into an IsolineCoverageSubLayer. Styles whose fields the source lacks (AppliesTo(WeatherCoverageSource)) are skipped.
This is the part of a weather dataset processor that doesn't depend on a file format; a processor adds the overview level choice and the product registration. It selects the context's time step on the source, so serialise calls that share a source.
Methods
BuildAsync(WeatherCoverageSource, IReadOnlyList<WeatherCoverageStyle>, string, RenderContext?, string?, CancellationToken)
Builds the sub-layers of styles over
source, in the order given.
public static Task<CoveragePortrayalResult> BuildAsync(WeatherCoverageSource source, IReadOnlyList<WeatherCoverageStyle> styles, string sourceDatasetId, RenderContext? context = null, string? datasetContentHash = null, CancellationToken cancellationToken = default)
Parameters
sourceWeatherCoverageSourceThe coverage source.
stylesIReadOnlyList<WeatherCoverageStyle>The styles, e.g. CreateFor(WeatherCoverageSource).
sourceDatasetIdstringThe dataset's stable id, typically its file name.
contextRenderContextThe render context: its TimeStep (the nearest step; the source's current step when unset), Palette, Viewport (to sample only what is in view), SymbolScale and Mariner. null draws the whole grid by Day.
datasetContentHashstringA hash of the dataset's content, or null. When given, ContentScope is
ds:{hash}|{ContentScope}.cancellationTokenCancellationTokenCancellation token.
Returns
- Task<CoveragePortrayalResult>
The portrayal; its sub-layers may be empty when no style applies.
BuildSubLayerAsync(WeatherCoverageSource, WeatherCoverageStyle, string, RenderContext?, CancellationToken)
Builds the one sub-layer of style over
source at the source's selected time step.
public static Task<CoverageSubLayerBase> BuildSubLayerAsync(WeatherCoverageSource source, WeatherCoverageStyle style, string sourceDatasetId, RenderContext? context = null, CancellationToken cancellationToken = default)
Parameters
sourceWeatherCoverageSourceThe coverage source.
styleWeatherCoverageStyleThe style; it must apply to the source (AppliesTo(WeatherCoverageSource)).
sourceDatasetIdstringThe dataset's stable id, used in the layer name.
contextRenderContextThe render context; see BuildAsync(WeatherCoverageSource, IReadOnlyList<WeatherCoverageStyle>, string, RenderContext?, string?, CancellationToken). Its time step isn't applied here.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<CoverageSubLayerBase>
A GridCoverageSubLayer for a fill, an ArrowCoverageSubLayer for symbols, an IsolineCoverageSubLayer for isolines.
Exceptions
- ArgumentException
The source lacks a field the style reads.