Point Cloud API¶
obia.pointcloud¶
obia.pointcloud
¶
Optional point-cloud feature extraction for OBIA segment objects.
add_pointcloud_features(segments, pointcloud, *, metrics=DEFAULT_METRICS, crs=None, reader='auto', predicate='within')
¶
Add point-cloud features to segment objects.
Parameters¶
segments:
Segment polygons. The output preserves the same rows and appends
pc_* feature columns.
pointcloud:
LAS/LAZ path or in-memory point cloud. Path inputs require optional
pointcloud dependencies.
metrics:
Feature groups to calculate: "height", "intensity", and
"density".
crs:
CRS assigned to point clouds that do not already have one.
reader:
Backend for path inputs: "auto", "pdal", or "pyforestscan".
predicate:
Spatial join predicate used to attach points to polygons.
Source code in obia/pointcloud/segment_features.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 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 | |
calculate_pointcloud_features(points, *, metrics=DEFAULT_METRICS, area=None, height_column='z', intensity_column='intensity')
¶
Calculate point-cloud features for one segment.
Parameters¶
points:
Points inside one segment. The table may contain z and
intensity columns.
metrics:
Feature groups to calculate. Supported values are "height",
"intensity", and "density".
area:
Segment area in CRS units squared. Required for density.
height_column:
Column used for height metrics.
intensity_column:
Column used for intensity metrics.
Source code in obia/pointcloud/features.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
read_pointcloud(pointcloud, *, crs=None, reader='auto')
¶
Return point-cloud data as a point GeoDataFrame.
Parameters¶
pointcloud:
LAS/LAZ path, structured NumPy array, (n, >=3) NumPy array,
pandas DataFrame, or GeoDataFrame.
crs:
CRS assigned to in-memory point clouds when one is not already present.
CRS alignment with segment polygons is checked later by
add_pointcloud_features.
reader:
Reader used for path inputs. "auto" tries PDAL first and then
pyforestscan. "pdal" and "pyforestscan" force one backend.
Source code in obia/pointcloud/io.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
obia.pointcloud.io¶
obia.pointcloud.io
¶
Point-cloud input normalization.
Path-based LAS/LAZ reading is optional and requires either PDAL or pyforestscan. In-memory arrays and GeoDataFrames are supported without those dependencies, which keeps the core package importable in lightweight environments.
read_pointcloud(pointcloud, *, crs=None, reader='auto')
¶
Return point-cloud data as a point GeoDataFrame.
Parameters¶
pointcloud:
LAS/LAZ path, structured NumPy array, (n, >=3) NumPy array,
pandas DataFrame, or GeoDataFrame.
crs:
CRS assigned to in-memory point clouds when one is not already present.
CRS alignment with segment polygons is checked later by
add_pointcloud_features.
reader:
Reader used for path inputs. "auto" tries PDAL first and then
pyforestscan. "pdal" and "pyforestscan" force one backend.
Source code in obia/pointcloud/io.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
obia.pointcloud.features¶
obia.pointcloud.features
¶
Point-cloud feature calculations.
calculate_pointcloud_features(points, *, metrics=DEFAULT_METRICS, area=None, height_column='z', intensity_column='intensity')
¶
Calculate point-cloud features for one segment.
Parameters¶
points:
Points inside one segment. The table may contain z and
intensity columns.
metrics:
Feature groups to calculate. Supported values are "height",
"intensity", and "density".
area:
Segment area in CRS units squared. Required for density.
height_column:
Column used for height metrics.
intensity_column:
Column used for intensity metrics.
Source code in obia/pointcloud/features.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
empty_pointcloud_features(*, metrics=DEFAULT_METRICS)
¶
Return a feature dictionary filled with empty values.
Source code in obia/pointcloud/features.py
65 66 67 68 69 70 | |
obia.pointcloud.segment_features¶
obia.pointcloud.segment_features
¶
Join point-cloud feature groups onto segment objects.
add_pointcloud_features(segments, pointcloud, *, metrics=DEFAULT_METRICS, crs=None, reader='auto', predicate='within')
¶
Add point-cloud features to segment objects.
Parameters¶
segments:
Segment polygons. The output preserves the same rows and appends
pc_* feature columns.
pointcloud:
LAS/LAZ path or in-memory point cloud. Path inputs require optional
pointcloud dependencies.
metrics:
Feature groups to calculate: "height", "intensity", and
"density".
crs:
CRS assigned to point clouds that do not already have one.
reader:
Backend for path inputs: "auto", "pdal", or "pyforestscan".
predicate:
Spatial join predicate used to attach points to polygons.
Source code in obia/pointcloud/segment_features.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 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 | |