MappingHorizontalPlane#

For deeper information about the concept see: Horizontal Plane Mapper

Class Methods

MappingHorizontalPlane.from_dict(mapper_dict)

Create a MappingHorizontalPlane instance from a configuration dictionary.

Main API Methods

MappingHorizontalPlane.map_coordinates_from_rays(...)

Map coordinates from rays to a horizontal plane.

MappingHorizontalPlane.map_heights_from_coordinates(...)

Assign the plane altitude as height for given coordinates.

Properties

MappingHorizontalPlane.type

Return the mapper type.

MappingHorizontalPlane.param_dict

Return the mapper configuration dictionary.

MappingHorizontalPlane.crs

Return the CRS of the mapper (if set).

MappingHorizontalPlane.crs_wkt

Return the CRS as WKT string, or None if not set.

class weitsicht.MappingHorizontalPlane(plane_altitude: float | int = 0.0, crs: CRS | None = None)[source]#

Bases: MappingBase

Mapping backend for a horizontal plane at a fixed altitude.

The plane is defined by plane_altitude (Z coordinate in mapper CRS) and a fixed normal (0, 0, 1). If a CRS transformation is performed, the plane altitude is transformed appropriately via the provided crs_s/transformer inputs.

Parameters:
  • plane_altitude (float | int)

  • crs (CRS | None)

__init__(plane_altitude: float | int = 0.0, crs: CRS | None = None)[source]#

Create a horizontal plane mapper.

Parameters:
  • plane_altitude (float | int) – Altitude of the horizontal plane (Z value in mapper CRS), defaults to 0.0.

  • crs (CRS | None) – CRS of the plane, defaults to None.

classmethod from_dict(mapper_dict: Mapping[str, Any]) MappingHorizontalPlane[source]#

Create a MappingHorizontalPlane instance from a configuration dictionary.

Required keys: - type: must be horizontalPlane

Optional keys: - plane_altitude: plane altitude (float), defaults to 0.0 - crs: CRS WKT string, defaults to None

Parameters:

mapper_dict (Mapping[str, Any]) – Mapper configuration dictionary (typically created via mapper.param_dict).

Returns:

Instantiated mapper.

Return type:

MappingHorizontalPlane

Raises:
  • KeyError – If the dictionary key type is missing.

  • ValueError – If the mapper type is unsupported.

  • CRSInputError – If the CRS WKT string is invalid.

property type#

Return the mapper type.

property param_dict#

Return the mapper configuration dictionary.

Returns:

Mapper configuration dictionary.

Return type:

dict[str, Any]

map_coordinates_from_rays(ray_vectors_crs_s: ArrayNx3, ray_start_crs_s: ArrayNx3, crs_s: CRS | None = None, transformer: CoordinateTransformer | None = None) MappingResultSuccess | ResultFailure[Issue][source]#

Map coordinates from rays to a horizontal plane.

Parameters:
  • ray_vectors_crs_s (ArrayNx3) – Ray direction vectors (N×3).

  • ray_start_crs_s (ArrayNx3) – Ray start points (N×3), same shape as ray_vectors_crs_s.

  • crs_s (CRS | None) – CRS of the input rays, defaults to None.

  • transformer (CoordinateTransformer | None) – Coordinate transformer to mapper CRS, defaults to None.

Returns:

Mapping result containing intersection coordinates and a validity mask.

Return type:

MappingResult

Raises:
map_heights_from_coordinates(coordinates_crs_s: ArrayNx3 | ArrayNx2, crs_s: CRS | None = None, transformer: CoordinateTransformer | None = None) MappingResultSuccess | ResultFailure[Issue][source]#

Assign the plane altitude as height for given coordinates.

Parameters:
  • coordinates_crs_s (ArrayNx3 | ArrayNx2) – Coordinates to sample (N×2 or N×3).

  • crs_s (CRS | None) – CRS of the input coordinates, defaults to None.

  • transformer (CoordinateTransformer | None) – Coordinate transformer to mapper CRS, defaults to None.

Returns:

Mapping result containing coordinates with plane altitude and a validity mask.

Return type:

MappingResult

Raises: