Skip to main content
A class to represent a height map, typically derived from LiDAR or depth data.

Fields

np.ndarray
A 2D numpy array where each cell contains a height value. The shape is (height, width).
float
The size of each cell in meters. For example, a resolution of 0.1 means each cell is 0.1m x 0.1m.
Position
The 3D world coordinates (x, y, z) of the corner of the cell (0,0) in the height map data.

Constructor

Signature

Methods

from_dict()

Signature
Deserialize from dictionary

get_world_coordinates()

Signature
Calculates the 3D world coordinates of each cell in the height map. The (i, j)-th cell in the data array corresponds to a physical location. This method computes the X, Y, and Z coordinates for all cells. X and Y are grids representing the planar coordinates. Z is the height data itself. Returns: Tuple[np.ndarray, np.ndarray, np.ndarray]: A tuple containing three 2D arrays:
  • X_coords: World X coordinates of each cell center.
  • Y_coords: World Y coordinates of each cell center.
  • Z_coords: World Z coordinates (heights) of each cell (self.data).

to_dict()

Signature
Serialize to dictionary for JSON transfer

Example