Class IsolineTracer
Traces isolines through a regular grid of values with marching squares. Nodes holding the no-data value break the lines: a cell with any no-data corner contributes nothing.
public static class IsolineTracer
- Inheritance
-
IsolineTracer
- Inherited Members
Remarks
A coarse grid gives angular lines, so the grid is first subdivided with bilinear interpolation until it is at least TargetNodes nodes along its longer side (at most MaxSubdivision times). Saddle cells are resolved with the cell-centre average.
Fields
MaxSubdivision
The largest subdivision factor.
public const int MaxSubdivision = 8
Field Value
TargetNodes
The node count along the longer side the subdivision aims for.
public const int TargetNodes = 64
Field Value
Methods
Trace(float[], int, int, float, IReadOnlyList<double>)
Traces each of levels through values.
public static IReadOnlyList<TracedIsoline> Trace(float[] values, int rows, int columns, float noData, IReadOnlyList<double> levels)
Parameters
valuesfloat[]Row-major values,
rows×columns.rowsintNumber of rows.
columnsintNumber of columns.
noDatafloatThe no-data value; NaN is always no-data.
levelsIReadOnlyList<double>The levels to trace.
Returns
- IReadOnlyList<TracedIsoline>
The isolines, one or more per level that crosses the grid.