ground_level

Contents

ground_level#

rapidtools.processing.street_structures.ground_level(points: ndarray, at: ndarray, cell_m: float = 2.0, reach_m: float = 4.0, min_cell_points: int = 5) → ndarray[source]#

Altitude of the ground under points of a cloud, read from the cloud.

A reconstruction holds the lawn, the driveway and the foot of every wall as well as the walls. The ground under a point is taken from the cells of a cell_m grid within reach_m of it: the level of a cell is the altitude a tenth of its points lie below, and the ground is the third lowest of those levels, so that neither a stray point nor a clump of them far under the surface is taken for it.

Parameters:
  • points – (n, 3) points of the whole cloud.

  • at – (m, 3) or (m, 2) points to find the ground under.

  • cell_m – Ground cell size.

  • reach_m – How far around a point ground is looked for.

  • min_cell_points – Fewest points a cell needs to count.

Returns:

np.ndarray – Ground altitude for every point of at; nan where fewer than three cells within reach hold enough points.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> lawn = np.c_[rng.uniform(0, 10, (400, 2)), np.full(400, 95.0)]
>>> wall = np.c_[np.full(50, 5.0), np.full(50, 5.0), np.linspace(95, 100, 50)]
>>> under = ground_level(np.vstack([lawn, wall]), np.array([[5.0, 5.0, 99.0]]))
>>> float(under[0])
95.0