EncDotNet.S100.Portrayals
0.28.0
dotnet add package EncDotNet.S100.Portrayals --version 0.28.0
NuGet\Install-Package EncDotNet.S100.Portrayals -Version 0.28.0
<PackageReference Include="EncDotNet.S100.Portrayals" Version="0.28.0" />
<PackageVersion Include="EncDotNet.S100.Portrayals" Version="0.28.0" />
<PackageReference Include="EncDotNet.S100.Portrayals" />
paket add EncDotNet.S100.Portrayals --version 0.28.0
#r "nuget: EncDotNet.S100.Portrayals, 0.28.0"
#:package EncDotNet.S100.Portrayals@0.28.0
#addin nuget:?package=EncDotNet.S100.Portrayals&version=0.28.0
#tool nuget:?package=EncDotNet.S100.Portrayals&version=0.28.0
EncDotNet.S100.Portrayals
EncDotNet.S100.Portrayals parses S-100 portrayal catalogues (S-100 Part 9):
the symbols, line styles, area fills, colour profiles, rules, viewing groups
and display modes used to draw S-100 data. Reference it when you need to read
a portrayal catalogue or its assets directly. The
EncDotNet.S100 facade uses it for you through
S100PortrayalCatalogue.
Install
dotnet add package EncDotNet.S100.Portrayals
Example: open a catalogue folder
using EncDotNet.S100.Core;
using EncDotNet.S100.Portrayals;
using var provider = await PortrayalCatalogueProvider.OpenAsync(
FileSystemAssetSource.Create("path/to/PortrayalCatalog"));
PortrayalCatalogue catalogue = provider.Catalogue;
Console.WriteLine($"{catalogue.ProductId} {catalogue.Version}: {catalogue.RuleFiles.Count} rule files");
OpenAsync reads portrayal_catalogue.xml from the source unless you pass
another path. The provider disposes the source when you dispose it.
Main entry points
PortrayalCatalogueProviderloads a catalogue and fetches the assets it references (rule files, symbols, line styles and others) from anIAssetSource.PortrayalCatalogueis the parsed model: symbols, line styles, area fills, colour profiles, pixmaps, style sheets, rule files, viewing groups, display modes, display planes and context parameters.PortrayalCatalogueReaderparses portrayal catalogue XML from a stream or a file path.ColorProfileReader,LineStyleReaderandAreaFillReaderparse individual portrayal components.ViewingGroup,DisplayMode,DisplayPlaneandContextParameterdescribe display configuration.PortrayalCatalogueManagermanages the portrayal catalogues for several product specifications.SetPathandSetSourceset where a product's catalogue comes from.- It implements
ICatalogueProvider<PortrayalCatalogueProvider>, includingGetCatalogueHashAsync(spec). That returns a lowercase hexadecimal SHA-256 over the catalogue XML and the bytes of every asset it declares: rule files, symbols, line styles, area fills, colour profiles, pixmaps and style sheets. Use it as a cache-invalidation key. - The hash is computed once per product, when first requested, and cleared
by
SetPathandSetSource. A failure (null) isn't cached, so the next call tries again.
- It implements
Code-defined portrayal
Some products have no portrayal catalogue: S-104 Ed 2.0.0 defines no
symbology, and weather grids and CAP warnings aren't S-100 products. The
EncDotNet.S100.Portrayals.Application namespace holds the pieces for drawing
them in code, producing the same drawing instructions, palettes and symbols a
catalogue does:
ApplicationPaletteholds named colour tokens, each with a Day, Dusk and Night value (PaletteColors).GetColorPalette(palette)returns theColorPalettethat instruction colour tokens and SVG palette classes resolve against.SymbolSetreads S-100 SVG symbols from a project's embedded resources. ItsProvideris theFunc<string, string?>symbol provider a sub-layer takes.InstructionBuilderbuilds point-symbol, text, simple line, complex line (ComplexLine), solid area and pattern area (AreaPattern, such as hatching)DrawingInstructions, stamping its viewing group, drawing priority, display plane and scale limits on each.PointAtandPathbuild a symbol at a given position and a line along given coordinates (S-100 Part 9 augmented geometry), which draw and pick as the feature they name, such as a vessel's course vector.TextInstructionStyledescribes a label's font, colours, halo and offset.ComplexLineStyledescribes a line style with symbols repeated along the line: a pen (solid or dashed), the symbols placed in turn everySymbolSpacingmillimetres fromSymbolStart, and theSidethey go on, optionally alternating (AlternateSides). Sizes are millimetres on the display, so the spacing on screen is the same at every scale. A symbol is drawn with its pivot on the line and its x axis along it, so draw it above its x axis for the left side; the right side turns it through 180°.LineStyleSetservesComplexLineStyles by name. ItsProvideris theFunc<string, LineStyle?>line style provider a portrayal result takes.LegendBuilderbuilds the rows of a sub-layer's legend (LegendEntry) for one palette, from the same tokens, symbols and line styles the portrayal draws with: colour swatches, outlined areas, point symbols and line samples. A viewer shows them under the sub-layer's layer stack entry (VectorSubLayer.Legend,CoverageSubLayerBase.Legend).IDynamicFeaturePortrayalis a code-defined portrayal of a dynamic feature source's features: drawing instructions (feature reference = the feature id), with the palette and symbols they resolve against. The NDBC station-model glyph (EncDotNet.S100.DynamicSources.Ndbc) is one; the Mapsui renderer isPortrayedDynamicFeatureRenderer.VesselPortrayalis the vessel symbology, for own-ship (VesselPortrayal.OwnShip) and AIS targets (VesselPortrayal.Ais, coloured by ship type class): a six-minute course vector with an arrowhead, and either a disc or, while the hull is at least 22 px long on screen, the true-scale outline fromDynamicFeature.VesselGeometrywith a cross at the antenna. The outline and disc switch by scale denominator, so the switch is the same at every latitude, and the outline is drawn as a line, as S-52 draws it.ApplicationContentScope.For(style, version)is the style's part of the tile disk-cache content scope: the style name and version plus the toolkit assembly's version. A code-defined style has no catalogue files to hash, so bump its version when its symbols or colours change.
using EncDotNet.S100.Pipelines;
using EncDotNet.S100.Portrayals.Application;
var palette = new ApplicationPalette("Weather", new Dictionary<string, PaletteColors>
{
["WXINK"] = PaletteColors.FromHex(day: "#0F5E73", dusk: "#9FD3DE", night: "#3E7C88"),
});
var symbols = new SymbolSet(typeof(MyStyle).Assembly, "My.Product.Symbols");
var stations = new InstructionBuilder { ViewingGroup = 31050, DrawingPriority = 15 };
var instruction = stations.Point("station:42", "WXSTATION");
ColorPalette night = palette.GetColorPalette(PaletteType.Night);
string scope = ApplicationContentScope.For("Weather", version: 1);
// A line with a triangle every 9 mm on its left, starting 4 mm in.
var cold = new ComplexLineStyle
{
Name = "WXCOLD",
ColorToken = "WXINK",
Width = 0.7,
Symbols = ["WXTRIANGLE"],
};
var lineStyles = new LineStyleSet([cold]);
var front = stations.ComplexLine("front:7", cold.Name);
// The matching legend row, in the Night palette.
var legend = new LegendBuilder(palette, PaletteType.Night, symbols.Provider);
LegendEntry row = legend.Line(cold, "Cold front");
Pass symbols.Provider and lineStyles.Provider as the portrayal result's
SymbolProvider and LineStyleProvider, and set the sub-layer's Legend
again whenever the palette changes.
S104CoverageStyle in
EncDotNet.S100.Datasets.S104
is built this way.
See also
- Custom catalogues and validation: use your own portrayal catalogue with the facade.
EncDotNet.S100.Specifications: the official catalogues bundled with the library.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.28.0)
NuGet packages (24)
Showing the top 5 NuGet packages that depend on EncDotNet.S100.Portrayals:
| Package | Downloads |
|---|---|
|
EncDotNet.S100.Datasets.S101
Libraries for manipulating S-100 based nautical charts. |
|
|
EncDotNet.S100.Renderers.Skia
Headless SkiaSharp rasteriser for the IHO S-100 portrayal pipeline. Renders the backend-neutral scene IR from EncDotNet.S100.Rendering.Scene (VectorScene / PaintOp) to an image with no GUI or map framework: SkiaDisplayListRenderer.RenderOnto, HeadlessVectorRenderer, CoverageHeadlessRenderer, and the multi-layer HeadlessCompositeRenderer. Lets a consumer embed just the renderer + IR without the EncDotNet.S100 facade or Mapsui. |
|
|
EncDotNet.S100.Datasets.S102
Libraries for manipulating S-100 based nautical charts. |
|
|
EncDotNet.S100.Datasets.S111
Libraries for manipulating S-100 based nautical charts. |
|
|
EncDotNet.S100.Renderers.Mapsui
Libraries for manipulating S-100 based nautical charts. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.28.0 | 0 | 11/14/2026 |
| 0.27.0 | 320 | 11/9/2026 |
| 0.26.0 | 505 | 10/24/2026 |
| 0.25.1 | 434 | 10/12/2026 |
| 0.25.0 | 433 | 10/12/2026 |
| 0.24.0 | 484 | 10/4/2026 |
| 0.23.0 | 448 | 9/17/2026 |
| 0.22.0 | 525 | 7/19/2026 |
| 0.21.0 | 540 | 7/10/2026 |
| 0.20.0 | 523 | 6/29/2026 |
| 0.19.0 | 527 | 6/27/2026 |
| 0.18.0 | 512 | 6/17/2026 |
| 0.17.1 | 502 | 6/16/2026 |
| 0.17.0 | 496 | 6/15/2026 |
| 0.16.0 | 503 | 6/8/2026 |
| 0.15.0 | 230 | 6/6/2026 |
| 0.14.0 | 236 | 6/6/2026 |
| 0.13.0 | 209 | 6/3/2026 |
| 0.12.0 | 209 | 5/29/2026 |
| 0.11.0 | 207 | 5/19/2026 |