Table of Contents

Class CoverageHeadlessRenderer

Namespace
EncDotNet.S100.Renderers.Skia
Assembly
EncDotNet.S100.Renderers.Skia.dll

Source-agnostic, Mapsui-free entry point for rendering a StyledCoverageLayer (colour-band fill and/or oriented arrow symbology) to a standalone SKBitmap of caller-requested pixel dimensions. The coverage's geographic extent is projected to EPSG:3857 and fitted into the output rectangle preserving aspect (letter-boxed against the background), so non-square requests do not distort the data.

public sealed class CoverageHeadlessRenderer
Inheritance
CoverageHeadlessRenderer
Inherited Members

Remarks

The colour raster produced by SkiaCoverageRenderer is one pixel per grid cell; it is resampled into the fitted destination rectangle. Grid rows are mapped linearly in latitude, so the Web-Mercator latitude non-linearity is approximated across the (typically small) coverage extent — the same approximation the existing direct-Skia coverage path makes. Arrow symbols are projected exactly through WebMercator.

Properties

ArrowRenderer

Optional arrow renderer used when the layer carries a SymbolScheme. When null, arrow symbology is skipped even if the layer defines a scheme.

public SkiaCoverageArrowRenderer? ArrowRenderer { get; init; }

Property Value

SkiaCoverageArrowRenderer

Background

Background fill painted before the coverage. Defaults to opaque white.

public RgbaColor Background { get; init; }

Property Value

RgbaColor

LandAreas

Optional S-101 LandArea surface geometries (WGS84 (latitude, longitude)) used to clip the colour surface to water at output-pixel resolution: the up-scaled raster is clipped with these polygons (even–odd, honouring interior water rings) so the surface never bleeds over land regardless of the grid's cell resolution. Set by the S-98 water-area clip rule for the S-104 gridded surface (issue #483). null or empty disables clipping.

public IReadOnlyList<FeatureGeometry>? LandAreas { get; init; }

Property Value

IReadOnlyList<FeatureGeometry>

NativeToWgs84

Transform from the grid's native CRS to WGS84, used to project arrow positions. Defaults to identity (geographic grids).

public ICrsTransform NativeToWgs84 { get; init; }

Property Value

ICrsTransform

NoDataColor

Colour used for no-data cells in the colour raster. Defaults to transparent.

public RgbaColor NoDataColor { get; init; }

Property Value

RgbaColor

Methods

DrawOnto(SKCanvas, Viewport, StyledCoverageLayer, double, double, double, double)

Draws the styled coverage layer onto an existing canvas, projecting the coverage's geographic extent into a shared Viewport's pixel space rather than auto-fitting a centred rectangle. This is the entry point used by the multi-layer headless compositor, where every layer must share one viewport so that overlaid datasets register.

public void DrawOnto(SKCanvas canvas, Viewport viewport, StyledCoverageLayer layer, double westLongitude, double eastLongitude, double southLatitude, double northLatitude)

Parameters

canvas SKCanvas

Target canvas (already cleared to the composite background).

viewport Viewport

The shared composite viewport defining the pixel space.

layer StyledCoverageLayer

The styled coverage layer (colour scheme and/or symbol scheme).

westLongitude double

Western extent edge in WGS84 degrees.

eastLongitude double

Eastern extent edge in WGS84 degrees.

southLatitude double

Southern extent edge in WGS84 degrees.

northLatitude double

Northern extent edge in WGS84 degrees.

Render(StyledCoverageLayer, double, double, double, double, int, int, BasemapKind)

Renders the styled coverage layer to a bitmap of the requested size.

public SKBitmap Render(StyledCoverageLayer layer, double westLongitude, double eastLongitude, double southLatitude, double northLatitude, int widthPixels, int heightPixels, BasemapKind basemap = BasemapKind.None)

Parameters

layer StyledCoverageLayer

The styled coverage layer (colour scheme and/or symbol scheme).

westLongitude double

Western extent edge in WGS84 degrees.

eastLongitude double

Eastern extent edge in WGS84 degrees.

southLatitude double

Southern extent edge in WGS84 degrees.

northLatitude double

Northern extent edge in WGS84 degrees.

widthPixels int

Output bitmap width in pixels.

heightPixels int

Output bitmap height in pixels.

basemap BasemapKind

Optional basemap drawn beneath the coverage (issue #411). When Offline, the bundled Natural Earth land layer is filled through the same centred-fit projection so it registers exactly with the coverage. Land is hidden where the coverage is opaque (e.g. S-102) but shows through transparent no-data cells (e.g. S-104 / S-111). Defaults to None (no basemap; output unchanged).

Returns

SKBitmap

A newly allocated bitmap owned by the caller.