Point Clouds¶
Point-cloud features are added to existing segment objects. Raster features and point-cloud features live on the same rows, which keeps labelling, review, and classification focused on one object table.
The recommended order is:
- create segment objects from a raster
- add point-cloud features to those segment objects
- label training segments
- classify the enriched segment table
Install Point-Cloud Dependencies¶
Point-cloud workflows need PDAL. Install PDAL in a conda environment first, then install OBIA with pip inside that environment:
1 2 3 | |
If you already have an environment, install PDAL from conda-forge before installing OBIA:
1 2 | |
The conda-forge PDAL package is usually more reliable than installing PDAL through pip because the Python bindings need the PDAL base library.
To include the optional pyforestscan reader, install the point-cloud extra after activating the same environment:
1 | |
Add Features to Segments¶
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
The output preserves segment rows and appends pc_* feature columns. Segment geometries are used to select points; no new object boundaries are created.
If the point cloud has no CRS, pass one explicitly:
1 2 3 4 5 | |
In-Memory Point Clouds¶
Point clouds can also be passed as a DataFrame:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
GeoDataFrames and NumPy arrays are also supported.
Structured arrays can use X, Y, Z, and Intensity fields. Plain NumPy arrays are interpreted as columns in this order:
1 | |
Feature Columns¶
Height metrics use the pc_z_* prefix:
pc_z_minpc_z_maxpc_z_meanpc_z_medianpc_z_stdpc_z_p5,pc_z_p25,pc_z_p50,pc_z_p75,pc_z_p95
Intensity metrics use the pc_intensity_* prefix. Density features include:
pc_point_countpc_density
Use in Classification¶
After enrichment, label the enriched segment table:
1 2 3 4 5 6 | |
After labelling, train the classifier with the enriched segment table:
1 2 3 4 5 6 7 8 | |
The predicted output keeps the original segment geometry and the added point-cloud columns.