footprint_rectangle

footprint_rectangle#

rapidtools.processing.street_structures.footprint_rectangle(wall_points: ndarray, depth_points: ndarray, camera: ndarray, street: ndarray, assumed_depth_m: float = 10.0, max_depth_m: float = 20.0, axis_points: ndarray | None = None) → tuple[list[tuple[float, float]], float, float, float, str, float][source]#

Rectangle footprint of a structure seen from the street.

The rectangle runs along the facade (the direction near the street’s that the walls line up with), starts at the wall nearest the camera and reaches back as far as points were seen, or assumed_depth_m when the survey saw less than that.

Parameters:
  • wall_points – (n, 2) dense points of the structure.

  • depth_points – (m, 2) further points that may belong to the structure (sparse roof points), used to measure the depth seen.

  • camera – Position of the nearest camera.

  • street – Unit vector along the driven path there.

  • assumed_depth_m – Depth used when less was observed.

  • max_depth_m – Points farther behind the front than this are taken for another structure and do not extend the depth.

  • axis_points – (k, 2) points the facade direction is read from, when not all of wall_points: the longest straight wall of a structure made of several pieces.

Returns:

tuple – (footprint, frontage_m, depth_m, observed_depth_m, depth_source, facade_bearing).

Example

>>> import numpy as np
>>> wall = np.c_[np.linspace(0, 12, 60), np.full(60, 10.0)]
>>> fp, front, depth, seen, source, facing = footprint_rectangle(
...     wall, wall, np.array([6.0, 0.0]), np.array([1.0, 0.0]))
>>> round(front), round(depth), source, round(facing)
(12, 10, 'assumed', 180)