EncDotNet.S100.Datasets.S102 0.25.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package EncDotNet.S100.Datasets.S102 --version 0.25.0
                    
NuGet\Install-Package EncDotNet.S100.Datasets.S102 -Version 0.25.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EncDotNet.S100.Datasets.S102" Version="0.25.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EncDotNet.S100.Datasets.S102" Version="0.25.0" />
                    
Directory.Packages.props
<PackageReference Include="EncDotNet.S100.Datasets.S102" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EncDotNet.S100.Datasets.S102 --version 0.25.0
                    
#r "nuget: EncDotNet.S100.Datasets.S102, 0.25.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EncDotNet.S100.Datasets.S102@0.25.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EncDotNet.S100.Datasets.S102&version=0.25.0
                    
Install as a Cake Addin
#tool nuget:?package=EncDotNet.S100.Datasets.S102&version=0.25.0
                    
Install as a Cake Tool

EncDotNet.S100.Datasets.S102

This package reads S-102 Bathymetric Surface datasets from HDF5 files and portrays their depth grids with the S-102 portrayal catalogue. It also validates a dataset against the S-102 Edition 3.0.0 checklist. Reference it when you need the depth and uncertainty grids directly. To open and render a dataset without wiring catalogues yourself, use the EncDotNet.S100 package instead.

Install

dotnet add package EncDotNet.S100.Datasets.S102
dotnet add package EncDotNet.S100.Hdf5.PureHdf

EncDotNet.S100.Hdf5.PureHdf provides the HDF5 reader the example uses.

Read a dataset

using EncDotNet.S100.Datasets.S102;
using EncDotNet.S100.Hdf5.PureHdf;

using var file = PureHdfFile.Open("path/to/dataset.h5");
S102Dataset bathymetry = S102DatasetReader.Read(file);

BathymetryCoverage grid = bathymetry.Coverages[0];
Console.WriteLine($"EPSG:{bathymetry.HorizontalCRS}, " +
                  $"{grid.NumPointsLatitudinal} x {grid.NumPointsLongitudinal} cells");

grid.Values is row-major from the grid origin. Depths are in metres, and cells without data hold the fill value 1,000,000. Origin and spacing are in the dataset's horizontal CRS, which may be projected. For a full walk through the grid, see Reading product data.

Main types

  • S102Dataset: the dataset, with its horizontal CRS, vertical datum and bathymetry coverages.
  • S102DatasetReader: reads an S102Dataset from an IHdf5File.
    • The horizontal CRS comes from the Edition 3.0.0 horizontalCRS root attribute. If that's missing, the reader uses the Edition 2.1 horizontalDatumValue attribute, so both editions are georeferenced correctly.
    • The verticalDatum root attribute (S-102 Ed 3.0.0 §12.3) becomes S102Dataset.VerticalDatum, an S-100 register code. S102CoverageSource resolves it to a label through EncDotNet.S100.DataModel.VerticalDatums.
    • ReadMetadata(file) returns a DatasetMetadata with the declared product specification, the grid extent and HorizontalCrsEpsg (for UTM reprojection). It reads only the georeferencing attributes, not the depth and uncertainty values.
  • BathymetryCoverage and BathymetryValue: a grid and its values. BathymetryCoverage.GroupPath is the HDF5 path of the coverage, such as /BathymetryCoverage/BathymetryCoverage.01. Validation findings use it as RelatedFeatureId.
  • S102CoverageSource: the ICoverageSource for the coverage pipeline. See Downsampling.
  • S102PortrayalCatalogue: the coverage portrayal catalogue that shades depths. See Portrayal.

The S102DatasetProcessor that renders, samples and validates a dataset is in EncDotNet.S100.Datasets.Pipelines.

Portrayal

S102PortrayalCatalogue runs the bundled BathymetryCoverage.lua rule (S-102 Edition 3.0.0, Annex B) through an ILuaEngine. It resolves the colour tokens the rule emits (DEPDW, DEPMD, DEPMS, DEPVS, DEPIT, NODTA) against the bundled ColorProfiles/colorProfile.xml. The Day, Dusk and Night palettes are all loaded, and SwitchPaletteAsync selects one. Call SwitchPaletteAsync before ResolveColorScheme: it loads the Lua rule, and ResolveColorScheme throws InvalidOperationException until it has.

The four S-102 context parameters come from MarinerSettings:

  • FourShades switches between two depth bands (DEPVS and DEPDW, split at SafetyContour) and four (DEPVS, DEPMS, DEPMD and DEPDW, split at ShallowContour, SafetyContour and DeepContour).
  • SafetyContour, ShallowContour and DeepContour are depth boundaries in metres.

If the contours are out of order, the catalogue clamps them to ShallowContour ≤ SafetyContour ≤ DeepContour and logs a diagnostic instead of throwing. Settings sliders can pass through out-of-order values while you drag them, and that mustn't stop rendering.

Cells whose depth equals S102CoverageSource.FillValue (1,000,000) are painted with the active palette's NODTA colour through CoverageColorScheme.NoDataColor. Set S102PortrayalCatalogue.RenderNoDataFill = false to leave them transparent. Do this when S-102 is drawn over another layer, such as an S-101 ENC, so the unsurveyed part of the rectangular grid doesn't hide the chart underneath.

Downsampling

When S102CoverageSource draws a grid at a smaller scale, it reduces blocks of cells to one value. Both its overview pyramid and its viewport sampling keep the shallowest depth (minimum) and the largest uncertainty (maximum) in each block. Every source cell belongs to a block, so a narrow shoal can't fall between sample points. The blocks are balanced across the sampled area so the reduced grid's georeferencing stays exact, and the pyramid stops before a level would need a partial 2×2 block at an edge. Coverage read trace spans report s100.coverage.reducer=min.

Validation

The bundled rule pack, EncDotNet.S100.Datasets.S102.Validation.S102DatasetRules.Default, checks an S102Dataset against the S-102 Edition 3.0.0 checklist and returns a ValidationReport. S102DatasetProcessor.Validate() runs it for you. To run it directly:

using EncDotNet.S100.Datasets.S102.Validation;

var report = S102DatasetRules.Default.Run(dataset);
foreach (var finding in report.Findings)
    Console.WriteLine($"{finding.RuleId} {finding.Severity}: {finding.Message}");
Rule ID Severity Checks
S102-R-1.1 Error Each coverage's Values.Length equals NumPointsLatitudinal × NumPointsLongitudinal.
S102-R-2.1 Error The fill value in Depth and Uncertainty is exactly 1_000_000f. NaN and ±Infinity aren't allowed as substitutes.
S102-R-3.1 Warning HorizontalCRS, when set, is a recognised EPSG code: 4326, 4269 or a WGS 84 UTM zone.
S102-R-3.2 Warning IssueDate, when set, is an ISO 8601 date or date-time, basic (20260902) or extended (2026-09-02).
S102-R-3.3 Warning IssueTime, when set, is an ISO 8601 time of day, basic (105406+0000) or extended (10:54:06Z).
S102-R-4.1 Error Each coverage's origin is valid in HorizontalCRS: latitude in [-90, 90] and longitude in [-180, 180] when geographic; within UTM easting and northing bounds, and reprojectable to WGS 84, when projected.
S102-R-4.2 Error Each coverage's far corner is valid in HorizontalCRS in the same way. A geographic extent mustn't cross the antimeridian.
S102-R-5.1 Warning Depths other than the fill value are within [-50, 12 000] m. There's one finding per coverage with values outside the range.
S102-PROJ-SCHEMA Error The HDF5 dataset failed schema parsing inside Validate().

For the validation API and your own rules, see Custom catalogues and validation.

See also

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EncDotNet.S100.Datasets.S102:

Package Downloads
EncDotNet.S100.Datasets.Pipelines

Per-spec IDatasetProcessor implementations, the DatasetPipelineFactory (file -> processor detection), the headless image-render capability, the S-98 interoperability authority, and the validation runner for IHO S-100 product datasets. Consumed by the EncDotNet.S100 convenience package, the viewer, and the s100 CLI.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.25.1 73 10/12/2026
0.25.0 78 10/12/2026
0.24.0 129 10/4/2026
0.23.0 145 9/17/2026
0.22.0 198 7/19/2026
0.21.0 213 7/10/2026
0.20.0 188 6/29/2026
0.19.0 180 6/27/2026
0.18.0 196 6/17/2026
0.17.1 173 6/16/2026
0.17.0 189 6/15/2026
0.16.0 184 6/8/2026
0.15.0 130 6/6/2026
0.14.0 130 6/6/2026
0.13.0 125 6/3/2026
0.12.0 123 5/29/2026
0.11.0 115 5/19/2026
0.10.0 123 5/16/2026
0.9.0 118 5/15/2026
0.8.0 123 5/13/2026
Loading failed