EncDotNet.S100.Renderers.Mapsui
0.12.0
dotnet add package EncDotNet.S100.Renderers.Mapsui --version 0.12.0
NuGet\Install-Package EncDotNet.S100.Renderers.Mapsui -Version 0.12.0
<PackageReference Include="EncDotNet.S100.Renderers.Mapsui" Version="0.12.0" />
<PackageVersion Include="EncDotNet.S100.Renderers.Mapsui" Version="0.12.0" />
<PackageReference Include="EncDotNet.S100.Renderers.Mapsui" />
paket add EncDotNet.S100.Renderers.Mapsui --version 0.12.0
#r "nuget: EncDotNet.S100.Renderers.Mapsui, 0.12.0"
#:package EncDotNet.S100.Renderers.Mapsui@0.12.0
#addin nuget:?package=EncDotNet.S100.Renderers.Mapsui&version=0.12.0
#tool nuget:?package=EncDotNet.S100.Renderers.Mapsui&version=0.12.0
EncDotNet.S100.Renderers.Mapsui
Rendering of S-100 data into Mapsui map layers with CRS projection.
Overview
This library bridges the S-100 portrayal pipeline output to Mapsui map layers, including full CRS projection support (EPSG:3857 Web Mercator). Key types include:
MapsuiCoverageRenderer—ICoverageRenderer<ILayer>implementation that renders coverage data as a georeferenced raster overlay (S-102 / S-104 / S-111).MapsuiCoverageArrowRenderer— renders current arrows (e.g. from S-111 data) as a georeferenced raster layer.MapsuiDisplayListRenderer— product-agnostic vector renderer that consumes a list ofDrawingInstructions plus anIFeatureGeometryProviderand produces aMemoryLayerof styled point/line/area/text features. Used by every S-100 vector product (S-101, S-124, S-129, S-421); no per-spec subclass is required.ProjNetCrsTransformFactory—ICrsTransformFactoryimplementation using ProjNet for coordinate transformations between UTM, WGS84, and Web Mercator.
MapsuiDisplayListRenderer honours the relevant S-100 Part 9 conventions:
- Pen widths and text/symbol offsets specified in millimetres on the nominal display surface are converted to screen pixels using the standard
1 px = 0.32 mmratio (S-100 Part 9 §3.10.4). <foreground>/<background>colours accept either a palette token or a literal#RRGGBB/RRGGBBAAhex value, with the optionaltransparencyattribute applied as alpha attenuation.- Text alignment, mm offsets, and
textLinestart/end offsets (Relative or Absolute) are honoured per S-100 Part 9 §11.4. LineStyleProvider,SymbolProvider, andAreaFillProvidercallbacks let the host project plug in a portrayal catalogue without coupling the renderer to a specific dataset library.
Sharing processed-SVG and pattern-tile work across renders
MapsuiDisplayListRenderer resolves SVG symbols and rasterises area-fill pattern tiles lazily on first reference. The processed-SVG output depends on the active ColorPalette (fill/stroke colours are recoloured against the palette), and pattern-tile rasterisation is comparatively expensive.
When a single dataset is re-rendered repeatedly — typical when toggling palettes, scrubbing time-steps, or changing mariner settings — assign a single MapsuiRenderAssetCache instance to the renderer's AssetCache property on every Render() call:
private readonly MapsuiRenderAssetCache _renderAssetCache = new();
// per Render():
var renderer = new MapsuiDisplayListRenderer
{
Palette = palette,
AssetCache = _renderAssetCache,
SymbolProvider = name => catalogue.GetSymbol(name).SvgContent,
AreaFillProvider = name => catalogue.GetAreaFill(name),
};
The cache segments entries per palette (Day / Dusk / Night) so flipping back and forth keeps every palette warm. When AssetCache is unset, the renderer falls back to a per-instance cache, which preserves legacy behaviour for ad-hoc / one-shot callers.
Dynamic feature sources
EncDotNet.S100.Renderers.Mapsui.DynamicSources hosts the Mapsui-bound side of the dynamic-feature-source abstraction defined in EncDotNet.S100.Core (see docs/design/dynamic-feature-source.md). Renderers turn DynamicFeature snapshots into Mapsui IFeature + IStyle instances that the viewer's DynamicSourceOverlayHost attaches to a MemoryLayer on the overlay tier of IMapHost.
IDynamicFeatureRenderer—CanRender+Rendercontract. Implementations are stateless functions of one feature; the overlay host owns the layer-level state and UI-thread marshalling.DefaultDynamicFeatureRenderer— geometry-kind-dispatching fallback: coloured disc + optional speed-scaled heading line (six-minute predictor capped at 10 nm) forPoint, stroked polyline forCurve, translucent fill + outline forSurface. Also the safety-net renderer when a source'sRendererKeyisnullor unregistered.OwnShipRenderer— own-ship symbology under key"ownship". Draws a true-scale 5-vertex hull polygon when the on-screen vessel length exceedsMinVesselPixels(22 px ≈ 6 mm @ 96 dpi), a coloured disc otherwise, plus a heading vector with filled-triangle arrowhead in both modes and a CCRP cross at the GPS antenna in outline mode. UsesDynamicFeature.VesselGeometry(CCRP offsets) to place the hull around the antenna and gates the outline / pictogram via mutually-exclusiveMinVisible/MaxVisiblestyles so the renderer stays viewport-agnostic. Falls back to pictogram-only when noVesselGeometryis supplied (e.g. AIS targets with unknown dimensions). Seedocs/design/own-ship-symbology.md.KindMatchingRenderer— dispatches byDynamicFeature.Kindvia exact match or dot-namespaced prefix match (e.g."vessel"matches"vessel.cargo"). Longest-key-first ordering keeps prefix matching deterministic.CompositeDynamicFeatureRenderer— first-CanRender-wins fallthrough over an ordered list. Conventional ordering: per-kind specialists first,DefaultDynamicFeatureRendererlast.DynamicFeatureRendererServiceCollectionExtensions— DI helpers that register renderers under the same string key a source advertises viaDynamicSourceMetadata.RendererKey:// Register a source and its renderer in one call: services.AddDynamicFeatureSource<MyAisFeed, MyVesselRenderer>("vessel"); // Or just a renderer, for cross-source sharing: services.AddDynamicFeatureRenderer<MyVesselRenderer>("vessel");The viewer's overlay host resolves the renderer at registration time via
IServiceProvider.GetKeyedService<IDynamicFeatureRenderer>(source.Metadata.RendererKey).
Installation
dotnet add package EncDotNet.S100.Renderers.Mapsui
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- EncDotNet.S100.Core (>= 0.12.0)
- EncDotNet.S100.Datasets.S101 (>= 0.12.0)
- EncDotNet.S100.Datasets.S421 (>= 0.12.0)
- EncDotNet.S100.Portrayals (>= 0.12.0)
- EncDotNet.S100.Renderers.Skia (>= 0.12.0)
- Mapsui (>= 5.0.2)
- Mapsui.Nts (>= 5.0.2)
- Mapsui.Rendering.Skia (>= 5.0.2)
- Mapsui.Tiling (>= 5.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- ProjNet (>= 2.0.0)
- SkiaSharp (>= 3.119.1)
-
net8.0
- EncDotNet.S100.Core (>= 0.12.0)
- EncDotNet.S100.Datasets.S101 (>= 0.12.0)
- EncDotNet.S100.Datasets.S421 (>= 0.12.0)
- EncDotNet.S100.Portrayals (>= 0.12.0)
- EncDotNet.S100.Renderers.Skia (>= 0.12.0)
- Mapsui (>= 5.0.2)
- Mapsui.Nts (>= 5.0.2)
- Mapsui.Rendering.Skia (>= 5.0.2)
- Mapsui.Tiling (>= 5.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- ProjNet (>= 2.0.0)
- SkiaSharp (>= 3.119.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.