Class CoveragePyramid
An in-memory coverage overview pyramid: a sequence of downsampled
grids keyed by level index, one flat row-major float[] per
(level, field name) pair (S-100 Part 10c HDF5 grids; issue #486).
public sealed class CoveragePyramid
- Inheritance
-
CoveragePyramid
- Inherited Members
Remarks
Level 0 is not stored — the base grid is already resident in the coverage source. Level 1 is the first downsampled level (half-resolution in each axis, quarter the cells); level 2 is quarter-resolution, and so on.
Storage cost of a full mipmap chain is
Σ (4ⁿ)⁻¹ for n≥1 = 1/3 of the base grid size, matching the
issue's storage estimate. A 1000×1000 float grid (base 4 MB per
field) grows by ~1.3 MB per field for the full chain.
Constructors
CoveragePyramid(IReadOnlyList<CoverageOverviewLevel>, IReadOnlyDictionary<int, IReadOnlyDictionary<string, float[]>>)
Builds a new pyramid handle. The base grid (level 0) is
represented in levels for enumeration
convenience but no data is stored for it in
levelData.
public CoveragePyramid(IReadOnlyList<CoverageOverviewLevel> levels, IReadOnlyDictionary<int, IReadOnlyDictionary<string, float[]>> levelData)
Parameters
levelsIReadOnlyList<CoverageOverviewLevel>All available levels, in increasing order, starting with level 0. Must contain at least one entry.
levelDataIReadOnlyDictionary<int, IReadOnlyDictionary<string, float[]>>Downsampled cells for levels ≥ 1, keyed by level index. Each per-level entry is a field-name → flat row-major
float[Rows*Cols]dictionary. Level 0 must not be present.
Properties
Levels
All available levels, in increasing order. Level 0 (base) is always present; subsequent entries are downsampled.
public IReadOnlyList<CoverageOverviewLevel> Levels { get; }
Property Value
Methods
GetField(int, string)
Returns the downsampled cells for the requested (level, field). Callers must not mutate the returned array.
public float[] GetField(int level, string fieldName)
Parameters
Returns
- float[]
Exceptions
- ArgumentOutOfRangeException
levelis 0 (base grid; source owns it) or outside the pyramid's range.- KeyNotFoundException
The pyramid has no data for the requested field name at this level.
GetLevel(int)
Returns the descriptor for the requested level.
public CoverageOverviewLevel GetLevel(int level)
Parameters
levelint
Returns
Exceptions
- ArgumentOutOfRangeException
levelis outside the pyramid's range.