Skip to content

GridSource

Namespace: ThinkGeo.Core

A regular grid of values over an extent - a model's output, an elevation grid, a weather product - and the one way every renderer reads it: the classic map's grid overlay and the GPU map's fills and contours alike. How it draws is the renderer's and its style's; this is only the data.

public abstract class GridSource

Inheritance object → GridSource

Remarks:

The extent is divided into GridSource.ColumnCount by GridSource.RowCount cells, which need not be square; row 0 is the extent's north edge. A value is a float, and a cell with no data is float.NaN.

A renderer asks for the cells it needs through GridSource.FillValues(GridSlot[]), so a grid kept in a file - AscGridSource - is read only where it is drawn. Keep the values in memory with InMemoryGridSource, or derive from this class for a format of your own, and raise when the values change so the maps drawing it draw them again.

Properties

ColumnCount

How many cells across.

public int ColumnCount { get; }

Property Value

int

RowCount

How many cells down.

public int RowCount { get; }

Property Value

int

Extent

The ground the grid covers, in GridSource.SourceProjection.

public RectangleShape Extent { get; }

Property Value

RectangleShape

SourceProjection

The coordinate system GridSource.Extent is in, or null when it is the map's.

public Projection SourceProjection { get; }

Property Value

Projection

Methods

FillValues(GridSlot[])

Sets the GridSlot.Value of every slot whose GridSlot.Column is zero or more - NaN for a cell with no data - and leaves the others, which lie outside the grid.

public void FillValues(GridSlot[] slots)

Parameters

slots GridSlot[]
The cells a renderer needs, their column and row already set.

Returns

void

FillValuesCore(GridSlot[])

Sets the GridSlot.Value of every slot whose GridSlot.Column is zero or more, and leaves the others.

protected abstract void FillValuesCore(GridSlot[] slots)

Parameters

slots GridSlot[]
The cells a renderer needs, their column and row already set.

Returns

void

OnChanged()

Raises GridSource.Changed: call it when the values change.

protected void OnChanged()

Returns

void

A()

internal Single[] A()

Returns

Single[]

A(Single[])

internal static Nullable<ValueTuple<double, double>> A(Single[] values)

Parameters

values Single[]

Returns

Nullable<ValueTuple<double, double>>

A(Single[], double, double)

internal static Byte[] A(Single[] , double , double )

Parameters

`` Single[]

`` double

`` double

Returns

Byte[]

Events

Changed

Raised when the values change, so the maps drawing the grid draw it again.

public event EventHandler Changed;