voxcity.utils.shapeยถ

Functionsยถ

normalize_voxcity_shape(โ†’ voxcity.models.VoxCity)

Return a new VoxCity with arrays padded/cropped to target (x, y, z).

Module Contentsยถ

voxcity.utils.shape.normalize_voxcity_shape(city: voxcity.models.VoxCity, target_shape: Tuple[int, int, int], *, align_xy: str = 'center', pad_values: Dict[str, Any] | None = None, allow_crop_xy: bool = True, allow_crop_z: bool = False) voxcity.models.VoxCity[source]ยถ

Return a new VoxCity with arrays padded/cropped to target (x, y, z).

  • XY alignment can be โ€˜centerโ€™ (default) or โ€˜top-leftโ€™.

  • Z padding is added at the TOP to preserve ground level at z=0.

  • By default, Z is never cropped (allow_crop_z=False). If target z is smaller than current, target z is expanded to current to avoid losing data.