Class SampledCoverage
The result of Sample(GridRegion, CancellationToken): per-field values for a grid region, together with the geometry of the sampled sub-grid.
public class SampledCoverage
- Inheritance
-
SampledCoverage
- Inherited Members
Properties
ComputedFields
Fields derived from Values cell by cell, for example wind speed and direction from U and V components. Each one is computed the first time it is read (through GetValues(string) or GetField(string)) and kept for the life of this sample, so the source never holds a second full-grid copy. Empty by default.
public IReadOnlyList<ComputedCoverageField> ComputedFields { get; init; }
Property Value
Remarks
Names must differ from the keys of Values and from each other. Inputs must name fields in Values; a computed field cannot read another computed field.
FieldNames
The names of every field this sample can return: the keys of Values, then the names of ComputedFields.
public IEnumerable<string> FieldNames { get; }
Property Value
Metadata
Geometry of the sampled sub-grid (not the full source grid): NumRows × NumColumns is the size of each array in Values, and the origin and spacing locate those output cells in the native CRS.
public required GridMetadata Metadata { get; init; }
Property Value
Region
The region that was requested from the source.
public required GridRegion Region { get; init; }
Property Value
Values
Per-field sampled values keyed by field name. Each value is a flat
row-major float[] of length Rows*Cols. Flat storage
avoids the LOH allocations a float[,] pair (depth +
uncertainty on a 1000×1000 S-102 grid is ~8 MB) would incur per
Sample(GridRegion, CancellationToken) call (PR-F).
public required IReadOnlyDictionary<string, float[]> Values { get; init; }
Property Value
Methods
GetField(string)
Returns a 2-D view over the named stored or computed field.
public CoverageGridView GetField(string fieldName)
Parameters
fieldNamestringThe field name.
Returns
Exceptions
- KeyNotFoundException
The sample has no such field.
GetPosition(int, int)
Locates an output cell of this sample using Metadata
(row and col index the sample,
not the source grid).
public GeoPosition GetPosition(int row, int col)
Parameters
Returns
- GeoPosition
The cell position in the native CRS, with Y in Latitude and X in Longitude. For a geographic (EPSG:4326) grid it is latitude / longitude in degrees. For a projected grid these carry the northing and easting in native units, not geographic degrees: reproject through the coverage's HorizontalCRS (easting first, northing second) before treating the result as a geographic position.
GetValues(string)
The flat row-major values of a stored or computed field, of length
Rows*Cols. A computed field is computed on the first call and
the same array is returned afterwards.
public float[] GetValues(string fieldName)
Parameters
fieldNamestringThe field name.
Returns
- float[]
Exceptions
- KeyNotFoundException
The sample has no field called
fieldName, or a computed field names an input that is not in Values.
HasField(string)
Whether fieldName is a stored or a computed field of
this sample.
public bool HasField(string fieldName)
Parameters
fieldNamestringThe field name.