tiling¶
occulus.tiling
¶
Spatial tiling and chunked processing for large point clouds.
Splits point clouds into spatial tiles for processing datasets that exceed available RAM. Tiles can be processed independently and optionally in parallel.
Tile
dataclass
¶
A spatial tile within a tiled point cloud.
Attributes:
| Name | Type | Description |
|---|---|---|
index |
tuple[int, int]
|
Grid column and row index. |
bounds |
tuple[float, float, float, float]
|
Spatial bounds (xmin, ymin, xmax, ymax). |
point_count |
int
|
Number of points in this tile. |
path |
Path or None
|
Path to the tile file on disk, if written. |
Source code in src/occulus/tiling/__init__.py
iter_tiles(path, *, tile_size=500.0)
¶
Iterate over spatial tiles of a point cloud file.
Yields tiles one at a time to keep memory usage bounded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
Path to a point cloud file. |
required |
tile_size
|
float
|
Tile edge length in coordinate units. |
500.0
|
Yields:
| Type | Description |
|---|---|
tuple[Tile, PointCloud]
|
Tile metadata and the corresponding point cloud subset. |
Source code in src/occulus/tiling/__init__.py
process_tiles(tiles, operation, *, output_dir, max_workers=1)
¶
Apply an operation to each tile and write results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tiles
|
list[Tile]
|
Tiles to process (must have .path set). |
required |
operation
|
callable
|
Function that takes a PointCloud and returns a PointCloud. |
required |
output_dir
|
str or Path
|
Directory for processed tile outputs. |
required |
max_workers
|
int
|
Number of parallel workers (1 = sequential). |
1
|
Returns:
| Type | Description |
|---|---|
list[Path]
|
Paths to processed tile files. |
Source code in src/occulus/tiling/__init__.py
tile_point_cloud(cloud_or_path, output_dir, *, tile_size=500.0, overlap=0.0, output_format='xyz')
¶
Split a point cloud into spatial grid tiles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cloud_or_path
|
PointCloud or str or Path
|
Input point cloud object or path to a file. |
required |
output_dir
|
str or Path
|
Directory to write tile files. |
required |
tile_size
|
float
|
Tile edge length in point-cloud coordinate units (default 500 m). |
500.0
|
overlap
|
float
|
Buffer overlap between adjacent tiles in coordinate units. |
0.0
|
output_format
|
str
|
Output format for tile files ('xyz', 'laz', 'las', 'ply'). |
'xyz'
|
Returns:
| Type | Description |
|---|---|
list[Tile]
|
List of tiles with metadata and file paths. |
Raises:
| Type | Description |
|---|---|
OcculusValidationError
|
If tile_size <= 0 or input is invalid. |
Source code in src/occulus/tiling/__init__.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |