Class S57Document
Represents a complete S-57 Electronic Navigational Chart (ENC) document.
public sealed record S57Document : IEquatable<S57Document>
- Inheritance
-
S57Document
- Implements
- Inherited Members
Properties
CoordinateMultiplicationFactor
Gets the coordinate multiplication factor for converting integer coordinates to decimal degrees.
public int CoordinateMultiplicationFactor { get; }
Property Value
DataSetIdentification
Gets the data set identification (DSID field).
public S57DataSetIdentification? DataSetIdentification { get; init; }
Property Value
DataSetParameters
Gets the data set parameters (DSPM field).
public S57DataSetParameters? DataSetParameters { get; init; }
Property Value
FeatureRecords
Gets all feature records.
public IReadOnlyList<S57FeatureRecord> FeatureRecords { get; init; }
Property Value
SoundingMultiplicationFactor
Gets the sounding multiplication factor for converting integer soundings to real values.
public int SoundingMultiplicationFactor { get; }
Property Value
VectorRecords
Gets all vector (spatial) records.
public IReadOnlyList<S57VectorRecord> VectorRecords { get; init; }
Property Value
Methods
ApplyChanges(S57Document)
Applies an S-57 update document to this document and returns a new document reflecting the changes.
public S57Document ApplyChanges(S57Document update)
Parameters
updateS57DocumentAn update document (typically parsed from a .001, .002, etc. file) whose feature and vector records carry S57UpdateInstruction values indicating insert, delete, or modify operations.
Returns
- S57Document
A new S57Document with the updates applied.
Remarks
Record-level operations are driven by the RUIN field on each update record:
- Insert — adds the record to the document.
- Delete — removes the record identified by RCNM+RCID.
- Modify — updates the matching record in place.
For Modify:
- Attributes (ATTF/NATF) are merged by ATTL code; an empty ATVL deletes the attribute.
- Array fields (FSPT, FFPT, VRPT, SG2D, SG3D) are spliced using their control fields (FSPC, FFPC, VRPC, SGCC) when present.
A control field's 1-based index and count must address entries that exist in the base record's array (S-57 Part 3, 8.4.3). An insert may target any position from 1 to one past the last entry; a delete or modify must lie entirely within the array. A control field that falls outside these bounds means the update does not match the base cell, and no partial result is returned.
Exceptions
- InvalidDataException
An update control field (FSPC, FFPC, VRPC or SGCC) has an index or count outside the bounds of the base record's array. The message names the record (RCNM/RCID) and the control field.
GetFeatureRecord(S57LongName)
Gets a feature record by its long name (LNAM), such as the target of a feature pointer.
public S57FeatureRecord? GetFeatureRecord(S57LongName longName)
Parameters
longNameS57LongNameThe long name to find.
Returns
- S57FeatureRecord
The first feature record with that long name, or
nullif there is none.
Remarks
This searches every feature record. To resolve many pointers, build an S57Chart and use GetFeature(S57LongName), which uses an index.
GetFeatureRecord(S57RecordName)
Gets a feature record by its record name.
public S57FeatureRecord? GetFeatureRecord(S57RecordName name)
Parameters
nameS57RecordName
Returns
Remarks
This searches every feature record. To look up many records, build an S57Chart, whose lookups use an index.
GetFeaturesByObjectCode(S57ObjectCode)
Gets all feature records with the specified object code.
public IEnumerable<S57FeatureRecord> GetFeaturesByObjectCode(S57ObjectCode objectCode)
Parameters
objectCodeS57ObjectCode
Returns
GetVectorRecord(S57RecordName)
Gets a vector record by its record name.
public S57VectorRecord? GetVectorRecord(S57RecordName name)
Parameters
nameS57RecordName
Returns
Remarks
This searches every vector record. To look up many records, build an S57Chart, whose lookups use an index.