EncDotNet.S100.Routes.Rtz 0.26.0

dotnet add package EncDotNet.S100.Routes.Rtz --version 0.26.0
                    
NuGet\Install-Package EncDotNet.S100.Routes.Rtz -Version 0.26.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.Routes.Rtz" Version="0.26.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EncDotNet.S100.Routes.Rtz" Version="0.26.0" />
                    
Directory.Packages.props
<PackageReference Include="EncDotNet.S100.Routes.Rtz" />
                    
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.Routes.Rtz --version 0.26.0
                    
#r "nuget: EncDotNet.S100.Routes.Rtz, 0.26.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.Routes.Rtz@0.26.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.Routes.Rtz&version=0.26.0
                    
Install as a Cake Addin
#tool nuget:?package=EncDotNet.S100.Routes.Rtz&version=0.26.0
                    
Install as a Cake Tool

EncDotNet.S100.Routes.Rtz

EncDotNet.S100.Routes.Rtz reads and writes RTZ route plans, the route exchange format of IEC 61174 Annex S that ECDIS and route planning tools use. It handles RTZ 1.0 (IEC 61174 Ed. 4.0:2015), 1.1 (the STM extended Annex S) and 1.2 (IEC PAS 61174-1:2021).

The package depends on EncDotNet.S100.Core and EncDotNet.S100.Navigation (for the passage plan conversion). RTZ isn't an S-100 product, so it lives beside the S-421 package rather than in it. A tool that reads both formats installs both.

Install

dotnet add package EncDotNet.S100.Routes.Rtz

Read a route

using EncDotNet.S100.Routes.Rtz;

var route = RtzReader.Read("Nab to Southampton.rtz");
Console.WriteLine($"{route.Info.RouteName} (RTZ {route.Version}), {route.Waypoints.Count} waypoints");

// A waypoint's leg is the leg directed to it, so leg i of the route is the
// leg of waypoint i + 1. GetEffectiveLeg applies the defaultWaypoint values.
for (var i = 1; i < route.Waypoints.Count; i++)
{
    var leg = route.GetEffectiveLeg(i);
    Console.WriteLine($"Leg {i}: XTD {leg?.PortsideXtd} / {leg?.StarboardXtd} NM, draught {leg?.MaxDraught} m");
}

// The calculated table wins over the manual one where both are present.
if (route.GetPlanningSchedule() is { } schedule)
    Console.WriteLine($"Departs {schedule.ElementFor(route.Waypoints[0].Id)?.Departure:u}");

To recognise a file before reading it, pass its first few kilobytes to RtzVersions.Sniff. It returns the version the file declares, or null when the file isn't RTZ.

Write a route

RtzWriter.Write(route, "Nab to Southampton.rtz", RtzVersions.V1_0);

The writer uses the target version's spelling (sheduleElement in 1.0, scheduleElement later), time format (xsd:time windows in 1.0, xsd:duration later) and extension layout.

Check a route

ToPassagePlan converts the route to the PassagePlan that the EncDotNet.S100.Navigation route and clearance checks take:

using EncDotNet.S100.Routes.Rtz;

var plan = RtzReader.Read("Nab to Southampton.rtz").ToPassagePlan();
Console.WriteLine($"{plan.Legs.Count} legs, departs {plan.Departure:u}");

It applies RTZ's semantics. Leg i reads the leg of waypoint i + 1, with the default waypoint's values filled in. Cross-track limits are converted from nautical miles to metres, and the draft is the deeper of the forward and aft draughts. Speeds and the departure come from the planning schedule; a leg without a speed gets one implied by the previous departure and its ETA. RTZ has no squat allowance.

What round-trips

The model names every attribute in the RTZ schema. Everything else is kept:

  • Attributes the model doesn't know, or can't parse, are kept in each element's ExtraAttributes.
  • The children of every extensions element are kept as XElements, with the root's namespace prefixes, so a vendor extension (such as STM's RouteInfoEx) is written back unchanged.

A route read and written in the same version keeps its content. Writing another version changes only what the versions differ in: a bare 1.0 extension element is wrapped in an extension element (manufacturer "unknown") for 1.1 and 1.2, leg extensions (a 1.2 addition) are left out of 1.0 and 1.1, and 1.2 gives every waypoint a revision.

This package is a data exchange library. It isn't for navigation.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.26.0 48 10/24/2026