Skip to content

VectorGridField

Defined in: packages/core/src/renderer/grid-host.ts:105

A vector field: two components per node.

  • GridFieldBase
PropertyModifierTypeDescriptionOverridesInherited fromDefined in
boundsreadonlyreadonly [number, number, number, number]The field’s cell edges, [west, south, east, north].-GridFieldBase.boundspackages/core/src/renderer/grid-host.ts:58
gridreadonlyGridGeometryThe node geometry (both authored forms normalize to it).-GridFieldBase.gridpackages/core/src/renderer/grid-host.ts:60
kindreadonly"vector"-GridFieldBase.kind-packages/core/src/renderer/grid-host.ts:106
nxreadonlynumberColumns and rows (grid.nx, grid.ny).-GridFieldBase.nxpackages/core/src/renderer/grid-host.ts:64
nyreadonlynumber--GridFieldBase.nypackages/core/src/renderer/grid-host.ts:65
rangereadonlyreadonly [number, number] | undefinedThe values bytes 0 and 255 stand for (byte encodings only).-GridFieldBase.rangepackages/core/src/renderer/grid-host.ts:67
unitsreadonlystring | undefinedThe unit label the document gave (units:), if any.-GridFieldBase.unitspackages/core/src/renderer/grid-host.ts:56
wrapsreadonlybooleanWhether the grid spans the globe in longitude, so sampling wraps at the date line.-GridFieldBase.wrapspackages/core/src/renderer/grid-host.ts:62

contains(position): boolean

Defined in: packages/core/src/renderer/grid-host.ts:82

Whether position lies on the grid: on or between its columns (any longitude, when the grid wraps), at any latitude (latitude clamps to the first and last row, as sample does). Exactly where sample would answer with a value or null for a missing node — a missing node does not make it false — so callers can tell “outside” from “missing”. False for a position that isn’t a finite pair.

ParameterType
positionGridPosition

boolean

GridFieldBase.contains


isMissing(col, row): boolean

Defined in: packages/core/src/renderer/grid-host.ts:73

Whether node (col, row) carries no value: marked by the document’s nodata: rule or by the encoding’s own marker (alpha 0, a JSON null, a GeoTIFF’s nodata).

ParameterType
colnumber
rownumber

boolean

GridFieldBase.isMissing


rescale(range): GridField

Defined in: packages/core/src/renderer/grid-host.ts:88

The same field with another range: — a new field from the retained bytes, no decode. Byte encodings only (rg-uv, scalar-r); a field carrying physical values throws.

ParameterType
rangereadonly [number, number]

GridField

GridFieldBase.rescale


sample(position): VectorSample | null

Defined in: packages/core/src/renderer/grid-host.ts:108

As ScalarGridField.sample, with u, v and speed.

ParameterType
positionGridPosition

VectorSample | null


values(): object

Defined in: packages/core/src/renderer/grid-host.ts:110

Every node’s components, row-major from the north-west node, and the missing mask (1 = missing). Built once, on first call.

object

NameTypeDefined in
missingUint8Arraypackages/core/src/renderer/grid-host.ts:110
uFloat32Arraypackages/core/src/renderer/grid-host.ts:110
vFloat32Arraypackages/core/src/renderer/grid-host.ts:110