Last updated

API / geotoolkit / contour / grid / ContourRectangularGrid / ContourRectangularGrid

Class: ContourRectangularGrid

grid.ContourRectangularGrid.ContourRectangularGrid

A contour grid is rectangular grid of nodes. Each node contains an altitude value. The dimensional characteristics of contour grid are described with the help of GridRange class.

The grid coordinate system is orthogonal. The node indices may be only non-negative (starting from 0). You may think about grid data as of two-dimensional array.

Hierarchy

Table of contents

Constructors
Accessors
Methods

Contents

Constructors

new ContourRectangularGrid(gridRange, data)

new ContourRectangularGrid(gridRange?, data?)

Parameters

Name Type
Optional gridRangeGridRange
Optional dataFloat64Array

Overrides

ContourAbstractGrid.constructor

Accessors

SpaceReserveRatio

Static get SpaceReserveRatio(): number

The space reserve ratio

Returns

number

Inherited from

ContourAbstractGrid.SpaceReserveRatio

Methods

addHoleValue

addHoleValue(holeValue): void

Adds a value that will serve as an indicator for a hole in data grid. It is assumed that grid data may have more than one hole value.

Parameters

Name Type Description
holeValuenumberThe hole value

Returns

void


clearGrid

clearGrid(): void

Empties the Grid

Returns

void

Overrides

ContourAbstractGrid.clearGrid


convertToSafeFloat64

convertToSafeFloat64(value): number

Converts the value that is not altered when setting to a Float64Array value.

Parameters

Name Type Description
valuenumberThe value that will be converted to a safe double.

Returns

number

safeValue The converted value.

Inherited from

ContourAbstractGrid.convertToSafeFloat64


getBorders

getBorders(): number

Gets the border bits

Returns

number

The border bits


getBuildRange

getBuildRange(netRange, realRange): void

Gets the build range

Parameters

Name Type Description
netRangeGridRangeThe range for the net
realRangeGridRangeThe range for the data

Returns

void

Overrides

ContourAbstractGrid.getBuildRange


getClassName

getClassName(): string

Returns

string

Inherited from

ContourAbstractGrid.getClassName


getData

getData(): Float64Array[]

Returns grid data

Returns

Float64Array[]

data


getGridPointFromModelPoint

getGridPointFromModelPoint(modelPoint): Point

Converts the model point to grid coordinates

Parameters

Name Type Description
modelPointPointThe model point

Returns

Point

gridPoint The grid point


getGridToModel

getGridToModel(): Transformation

Gets the grid-to-model transformation

Returns

Transformation

transformation Grid-To-Model transformation

Overrides

ContourAbstractGrid.getGridToModel


getMaxValue

getMaxValue(): number

Gets the maximum value in the contour grid. If the max value has not been set this method will scan whole grid to find maximum altitude value (but only once, then it will remember it).

Returns

number

max The maximum value

Overrides

ContourAbstractGrid.getMaxValue


getMinValue

getMinValue(): number

Gets the minimum value in the contour grid. If the min value has not been set this method will scan whole grid to find minimal altitude value (but only once, then it will remember it).

Returns

number

min The minimum value

Overrides

ContourAbstractGrid.getMinValue


getModelLimits

getModelLimits(): Rect

Gets the model limits of the data

Returns

Rect

model limits

Overrides

ContourAbstractGrid.getModelLimits


getRange

getRange(): GridRange

Gets the Grid Range for contour grid.

Returns

GridRange

gridRange

Overrides

ContourAbstractGrid.getRange


getValue

getValue(x, y): number

Returns the grid data value by its coordinates in grid coordinate system.

Throws

Error x or y is outside range

Parameters

Name Type Description
xnumberThe x-coordinate
ynumberThe x-coordinate

Returns

number


getValueAtModelPoint

getValueAtModelPoint(modelPoint): number

Gets the altitude at the give model point location.

Parameters

Name Type Description
modelPointPointThe model point

Returns

number

value The model point's value

Overrides

ContourAbstractGrid.getValueAtModelPoint


isHole

isHole(x, y): boolean

Determines whether the grid node with specified coordinates doesn't have an altitude value (is a hole)

Throws

Error x or y is outside range

Parameters

Name Type Description
xnumberThe x-coordinate
ynumberThe y-coordinate

Returns

boolean

isHole True if the grid node with specified coordinates is a hole


isHoleValue

isHoleValue(value): boolean

Tests if argument is hole value

Parameters

Name Type Description
valuenumberThe value to be tested

Returns

boolean

isHole True if the value is a hole.


needRebuild

needRebuild(): boolean

Returns grid rebuild state.

Returns

boolean

needRebuild True if grid is to be rebuilt (data changed)

Overrides

ContourAbstractGrid.needRebuild


setBorders

setBorders(value): ContourRectangularGrid

Sets the border bits

Parameters

Name Type Description
valuenumberThe border bits

Returns

ContourRectangularGrid

this


setData

setData(x, y, value): ContourRectangularGrid

Sets the data using algorithms that depend on the number of parameters

Throws

Error invalid number of arguments

Parameters

Name Type Description
xnumberx-index
ynumbery-index
valuenumberThe value

Returns

ContourRectangularGrid

setData(x, y): ContourRectangularGrid

Sets the data using algorithms that depend on the number of parameters

Throws

Error invalid number of arguments

Parameters

Name Type Description
xGridRangegrid range
yFloat64Arraydata array

Returns

ContourRectangularGrid

setData(x): ContourRectangularGrid

Sets the data using algorithms that depend on the number of parameters

Throws

Error invalid number of arguments

Parameters

Name Type Description
xFloat64Arraydata array

Returns

ContourRectangularGrid


setDataWithArray

setDataWithArray(data): ContourRectangularGrid

Sets the grid data using specified data array. It is assumed that the size of data array matches to dimensions of the current grid range.

Parameters

Name Type Description
dataFloat64ArrayThe data array

Returns

ContourRectangularGrid

this


setDataWithRangeAndArray

setDataWithRangeAndArray(range, data): ContourRectangularGrid

Sets the grid range and grid data using specified parameters. It is assumed that the dimensions of new grid range match to the size of data array.

Throws

Error if data is null

Parameters

Name Type Description
rangeGridRangeThe new grid range
dataFloat64ArrayThe data array

Returns

ContourRectangularGrid

this


setGridToModel

setGridToModel(transformation): void

Sets the grid-to-model transformation

Parameters

Name Type Description
transformationTransformationGrid-To-Model transformation

Returns

void

Overrides

ContourAbstractGrid.setGridToModel


setMaxValue

setMaxValue(value): ContourRectangularGrid

Sets the maximum value in the contour grid

Parameters

Name Type Description
valuenumberThe new maximum value

Returns

ContourRectangularGrid

this


setMinValue

setMinValue(value): ContourRectangularGrid

Sets the minimum value in the contour grid

Parameters

Name Type Description
valuenumberThe new minimum value

Returns

ContourRectangularGrid

this


setRange

setRange(gridRange): void

Sets the Grid Range for contour grid.

Parameters

Name Type Description
gridRangeGridRangeThe grid z-value range.

Returns

void

Overrides

ContourAbstractGrid.setRange


setValue

setValue(x, y, value): ContourRectangularGrid

Sets the grid data value by its coordinates in grid coordinate system.

Parameters

Name Type Description
xnumberThe x-coordinate
ynumberThe y-coordinate
valuenumberThe new value

Returns

ContourRectangularGrid

this


updateDataArray

updateDataArray(data): void

Updates the data array with new data

Parameters

Name Type Description
dataFloat64ArrayThe new data

Returns

void


getClassName

Static getClassName(): string

Returns

string

Inherited from

ContourAbstractGrid.getClassName