Documentation / @interstellar-tools/maps / terrainRoughnessIndexGrid
Function: terrainRoughnessIndexGrid()
ts
function terrainRoughnessIndexGrid(grid: GridInterface): GridInterface;Defined in: terrain/terrain-roughness-index.ts:92
Compute the Terrain Roughness Index of every cell of an elevation grid, as a new grid in metres.
See terrainRoughnessIndexAt. Cells on the edge and next to a missing cell are NaN.
Parameters
| Parameter | Type | Description |
|---|---|---|
grid | GridInterface | Elevation grid, heights in m. |
Returns
A grid of the same shape, TRI in m.
Throws
- If a size or cell size is not finite.
- If the grid's parts don't fit together.
Example
ts
const roughness = terrainRoughnessIndexGrid(grid);
gridValueAt(roughness, 1, 1); // 2