VectorGridField
Defined in: packages/core/src/renderer/grid-host.ts:105
A vector field: two components per node.
Extends
Section titled “Extends”GridFieldBase
Properties
Section titled “Properties”| Property | Modifier | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
bounds | readonly | readonly [number, number, number, number] | The field’s cell edges, [west, south, east, north]. | - | GridFieldBase.bounds | packages/core/src/renderer/grid-host.ts:58 |
grid | readonly | GridGeometry | The node geometry (both authored forms normalize to it). | - | GridFieldBase.grid | packages/core/src/renderer/grid-host.ts:60 |
kind | readonly | "vector" | - | GridFieldBase.kind | - | packages/core/src/renderer/grid-host.ts:106 |
nx | readonly | number | Columns and rows (grid.nx, grid.ny). | - | GridFieldBase.nx | packages/core/src/renderer/grid-host.ts:64 |
ny | readonly | number | - | - | GridFieldBase.ny | packages/core/src/renderer/grid-host.ts:65 |
range | readonly | readonly [number, number] | undefined | The values bytes 0 and 255 stand for (byte encodings only). | - | GridFieldBase.range | packages/core/src/renderer/grid-host.ts:67 |
units | readonly | string | undefined | The unit label the document gave (units:), if any. | - | GridFieldBase.units | packages/core/src/renderer/grid-host.ts:56 |
wraps | readonly | boolean | Whether the grid spans the globe in longitude, so sampling wraps at the date line. | - | GridFieldBase.wraps | packages/core/src/renderer/grid-host.ts:62 |
Methods
Section titled “Methods”contains()
Section titled “contains()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
position | GridPosition |
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”GridFieldBase.contains
isMissing()
Section titled “isMissing()”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).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
col | number |
row | number |
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”GridFieldBase.isMissing
rescale()
Section titled “rescale()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
range | readonly [number, number] |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”GridFieldBase.rescale
sample()
Section titled “sample()”sample(
position):VectorSample|null
Defined in: packages/core/src/renderer/grid-host.ts:108
As ScalarGridField.sample, with u, v and speed.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
position | GridPosition |
Returns
Section titled “Returns”VectorSample | null
values()
Section titled “values()”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.
Returns
Section titled “Returns”object
| Name | Type | Defined in |
|---|---|---|
missing | Uint8Array | packages/core/src/renderer/grid-host.ts:110 |
u | Float32Array | packages/core/src/renderer/grid-host.ts:110 |
v | Float32Array | packages/core/src/renderer/grid-host.ts:110 |