---
name: "getTerrainInfo"
type: command
status: ok
groups: ["Positions"]
arma3_since: "2.10"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/getTerrainInfo
revid: 377882
updated: 2026-01-04T16:22:56Z
---

# getTerrainInfo

*Command · Positions · Arma 3 v2.10*

## Description

Returns the terrain heightmap information, as well as sea level offset (due to tides, if available).

## Syntax

```sqf
getTerrainInfo
```

**Returns:** [Array](../topics/Array.md) with [landGridWidth, landGridSize, terrainGridWidth, terrainGridSize, seaLevel]
- landGridWidth: [Number](../topics/Number.md) - width of each land grid, in meters
- landGridSize: [Number](../topics/Number.md) - number of land grid pixels
- terrainGridWidth: [Number](../topics/Number.md) width of each terrain grid, in meters (also known as "cell size")
- terrainGridSize: [Number](../topics/Number.md) - number of terrain grid pixels (also known as "heightmap resolution")
- seaLevel: [Number](../topics/Number.md) - sea level without waves. The value is `0` if tides are disabled.

> [!NOTE]
> - The result of `landGridWidth * landGridSize` and `terrainGridWidth * terrainGridSize` is always equal to the [worldSize](../commands/worldSize.md).
> - "land grid" is used by the game for object placement (e.g. finding the [nearestObject](../commands/nearestObject.md)), dynamic simulation, etc.
> - "terrain grid" is the actual terrain, used to display the terrain, calculate [terrain height](../commands/getTerrainHeightASL.md), [surface normal](../commands/surfaceNormal.md), etc.

## Examples

### Example 1

```sqf
private _terrainInfo = getTerrainInfo; // Stratis: [32,256,4,2048,0]; Altis: [30,1024,7.5,4096,0]
```

### Example 2

```sqf
// Draws a 20x20 terrain grid when clicking on the map
// Each triangle of the terrain is formed by a diagonal
// that starts from the top-left corner of the cell and ends at the bottom-right corner.
// The green lines show the cell diagonals 
onMapSingleClick {
    getTerrainInfo params ["", "", "_cellsize", "_resolution"];
    gridLines = [];
    _pos apply { floor (_x / _cellsize) } params ["_x0", "_y0"];
    for "_x" from ((_x0 - 10) max 0) to ((_x0 + 10) min _resolution) do
    {
        for "_y" from ((_y0 - 10) max 0) to ((_y0 + 10) min _resolution) do
        {
            private _p1 = [_x, _y] vectorMultiply _cellsize;        // bottom-left corner
            private _p2 = [_x, _y + 1] vectorMultiply _cellsize;    // top-left corner
            private _p3 = [_x + 1, _y] vectorMultiply _cellsize;    // bottom-right corner
            // Positions are AGL, and Z value of 0 is already at the terrain surface (except on water surface). 
            // Just move them up a few centimeters so they're visible.
            _p1 set [2, 0.1];
            _p2 set [2, 0.1];
            _p3 set [2, 0.1];

            gridLines pushBack [_p1, _p2, [1,0,0,1]];
            gridLines pushBack [_p1, _p3, [1,0,0,1]];
            gridLines pushBack [_p2, _p3, [0,1,0,1]];
        };
    };

    onEachFrame {
        {
            drawLine3D _x;
        } forEach gridLines;
    }
};
```

## See also

[getTerrainHeight](../commands/getTerrainHeight.md) · [setTerrainHeight](../commands/setTerrainHeight.md) · [worldSize](../commands/worldSize.md)

<sub>Source: [BI Community Wiki — getTerrainInfo](https://community.bistudio.com/wiki/getTerrainInfo) (revision 377882).</sub>
