Table of Contents

Class S421DatasetWriter

Namespace
EncDotNet.S100.Datasets.S421
Assembly
EncDotNet.S100.Datasets.S421.dll

Writes a typed S421Route as an S-421 Route Plan dataset: S-100 Part 10b GML in the S-421 Edition 1.0.0 application schema (http://www.iho.int/S421/gml/cs0/1.0), which Open(Stream) reads back.

public static class S421DatasetWriter
Inheritance
S421DatasetWriter
Inherited Members

Remarks

The dataset holds one Route feature with its RouteInfo, a RouteWaypoints collection, one RouteWaypoint per waypoint, one RouteWaypointLeg per leg, and, when the route has them, schedules and action points. Objects refer to each other with xlink:href, in both directions, as the feature catalogue's compositions do.

A leg is referenced from the waypoint it ends at (S-421 Edition 1.0.0, RouteWaypoint.routeWaypointLeg), so the first waypoint has none. Each leg's geometry is its Coordinates, or the straight line between its waypoints when it has fewer than two.

Positions are written latitude first, as EPSG:4326 requires (S-100 Part 10b). Numbers use the invariant culture and round-trip exactly; times are written in UTC. Attributes the typed model doesn't know (ExtraAttributes) are written after the known ones, in ordinal order. The output is UTF-8 without a byte-order mark, with \n line endings, so the same route gives the same bytes.

Fields

Namespace

The S-421 Edition 1.0.0 GML application-schema namespace.

public const string Namespace = "http://www.iho.int/S421/gml/cs0/1.0"

Field Value

string

Methods

ToBytes(S421Route, S421WriteOptions?)

Writes route to a byte array.

public static byte[] ToBytes(S421Route route, S421WriteOptions? options = null)

Parameters

route S421Route

The route.

options S421WriteOptions

Options, or null for the defaults.

Returns

byte[]

The UTF-8 encoded dataset.

Write(S421Route, Stream, S421WriteOptions?)

Writes route to stream.

public static void Write(S421Route route, Stream stream, S421WriteOptions? options = null)

Parameters

route S421Route

The route.

stream Stream

The stream to write to; it is left open.

options S421WriteOptions

Options, or null for the defaults.

Exceptions

ArgumentException

The route has fewer than two waypoints.

WriteToFile(string, S421Route, S421WriteOptions?)

Writes route to a file, replacing it if it exists.

public static void WriteToFile(string path, S421Route route, S421WriteOptions? options = null)

Parameters

path string

The file to write.

route S421Route

The route.

options S421WriteOptions

Options, or null for the defaults.