API / geotoolkit / contour / grid / ContourRectangularGrid / 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.
↳
ContourRectangularGrid
Constructors
Accessors
Methods
Constructors
• new ContourRectangularGrid(gridRange?, data?)
| Name | Type |
|---|---|
Optional gridRange | GridRange |
Optional data | Float64Array |
ContourAbstractGrid.constructor
Accessors
• Static get SpaceReserveRatio(): number
The space reserve ratio
number
ContourAbstractGrid.SpaceReserveRatio
Methods
▸ 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.
| Name | Type | Description |
|---|---|---|
holeValue | number | The hole value |
void
▸ clearGrid(): void
Empties the Grid
void
▸ convertToSafeFloat64(value): number
Converts the value that is not altered when setting to a Float64Array value.
| Name | Type | Description |
|---|---|---|
value | number | The value that will be converted to a safe double. |
number
safeValue The converted value.
ContourAbstractGrid.convertToSafeFloat64
▸ getBorders(): number
Gets the border bits
number
The border bits
▸ getBuildRange(netRange, realRange): void
Gets the build range
| Name | Type | Description |
|---|---|---|
netRange | GridRange | The range for the net |
realRange | GridRange | The range for the data |
void
ContourAbstractGrid.getBuildRange
▸ getClassName(): string
string
ContourAbstractGrid.getClassName
▸ getData(): Float64Array[]
Returns grid data
Float64Array[]
data
▸ getGridPointFromModelPoint(modelPoint): Point
Converts the model point to grid coordinates
| Name | Type | Description |
|---|---|---|
modelPoint | Point | The model point |
gridPoint The grid point
▸ getGridToModel(): Transformation
Gets the grid-to-model transformation
transformation Grid-To-Model transformation
ContourAbstractGrid.getGridToModel
▸ 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).
number
max The maximum value
ContourAbstractGrid.getMaxValue
▸ 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).
number
min The minimum value
ContourAbstractGrid.getMinValue
▸ getModelLimits(): Rect
Gets the model limits of the data
model limits
ContourAbstractGrid.getModelLimits
▸ getRange(): GridRange
Gets the Grid Range for contour grid.
gridRange
▸ getValue(x, y): number
Returns the grid data value by its coordinates in grid coordinate system.
Throws
Error x or y is outside range
| Name | Type | Description |
|---|---|---|
x | number | The x-coordinate |
y | number | The x-coordinate |
number
▸ getValueAtModelPoint(modelPoint): number
Gets the altitude at the give model point location.
| Name | Type | Description |
|---|---|---|
modelPoint | Point | The model point |
number
value The model point's value
ContourAbstractGrid.getValueAtModelPoint
▸ 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
| Name | Type | Description |
|---|---|---|
x | number | The x-coordinate |
y | number | The y-coordinate |
boolean
isHole True if the grid node with specified coordinates is a hole
▸ isHoleValue(value): boolean
Tests if argument is hole value
| Name | Type | Description |
|---|---|---|
value | number | The value to be tested |
boolean
isHole True if the value is a hole.
▸ needRebuild(): boolean
Returns grid rebuild state.
boolean
needRebuild True if grid is to be rebuilt (data changed)
ContourAbstractGrid.needRebuild
▸ setBorders(value): ContourRectangularGrid
Sets the border bits
| Name | Type | Description |
|---|---|---|
value | number | The border bits |
this
▸ setData(x, y, value): ContourRectangularGrid
Sets the data using algorithms that depend on the number of parameters
Throws
Error invalid number of arguments
| Name | Type | Description |
|---|---|---|
x | number | x-index |
y | number | y-index |
value | number | The value |
▸ setData(x, y): ContourRectangularGrid
Sets the data using algorithms that depend on the number of parameters
Throws
Error invalid number of arguments
| Name | Type | Description |
|---|---|---|
x | GridRange | grid range |
y | Float64Array | data array |
▸ setData(x): ContourRectangularGrid
Sets the data using algorithms that depend on the number of parameters
Throws
Error invalid number of arguments
| Name | Type | Description |
|---|---|---|
x | Float64Array | data array |
▸ 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.
| Name | Type | Description |
|---|---|---|
data | Float64Array | The data array |
this
▸ 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
| Name | Type | Description |
|---|---|---|
range | GridRange | The new grid range |
data | Float64Array | The data array |
this
▸ setGridToModel(transformation): void
Sets the grid-to-model transformation
| Name | Type | Description |
|---|---|---|
transformation | Transformation | Grid-To-Model transformation |
void
ContourAbstractGrid.setGridToModel
▸ setMaxValue(value): ContourRectangularGrid
Sets the maximum value in the contour grid
| Name | Type | Description |
|---|---|---|
value | number | The new maximum value |
this
▸ setMinValue(value): ContourRectangularGrid
Sets the minimum value in the contour grid
| Name | Type | Description |
|---|---|---|
value | number | The new minimum value |
this
▸ setRange(gridRange): void
Sets the Grid Range for contour grid.
| Name | Type | Description |
|---|---|---|
gridRange | GridRange | The grid z-value range. |
void
▸ setValue(x, y, value): ContourRectangularGrid
Sets the grid data value by its coordinates in grid coordinate system.
| Name | Type | Description |
|---|---|---|
x | number | The x-coordinate |
y | number | The y-coordinate |
value | number | The new value |
this
▸ updateDataArray(data): void
Updates the data array with new data
| Name | Type | Description |
|---|---|---|
data | Float64Array | The new data |
void
▸ Static getClassName(): string
string