Skip to content
DuckDB community extension

pdal

Extension that adds support for manipulating point cloud data using SQL.

01 / SETUP

Install and load

Run these commands in a Haybarn SQL session. The extension is available from the community repository.

Haybarn 2.0.0 Β· SQL
INSTALL pdal FROM community;
LOAD pdal FROM community;

Using upstream DuckDB? Follow the maintainer’s installation instructions.

02 / QUERY

Usage example

SQL session and output
SELECT * FROM PDAL_Read('path/to/your/pointcloud.las');
---
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”
β”‚     X     β”‚     Y     β”‚   Z    β”‚       β”‚
β”‚   double  β”‚   double  β”‚ double β”‚  ...  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 637177.98 β”‚ 849393.95 β”‚ 411.19 β”‚  ...  β”‚
β”‚ 637177.30 β”‚ 849396.95 β”‚ 411.25 β”‚  ...  β”‚
β”‚ 637176.34 β”‚ 849400.84 β”‚ 411.01 β”‚  ...  β”‚
β”‚ 637175.45 β”‚ 849404.62 β”‚ 410.99 β”‚  ...  β”‚
β”‚ 637174.33 β”‚ 849407.37 β”‚ 411.38 β”‚  ...  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”˜

WITH __input AS (
    SELECT
        X, Y, RasterValue
    FROM
        PDAL_Pipeline('./test/data/overlay-sample.tiff', './test/data/overlay-sample-pipeline.json')
)
SELECT
    COUNT(*) AS c,
    SUM(RasterValue) AS s
FROM
    __input
;
---
β”Œβ”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   c   β”‚    s     β”‚
β”‚ int64 β”‚  double  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 57600 β”‚ 576000.0 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Provided by ahuarte47. Not yet verified on Haybarn 2.0.0.

Sample data & setup

About this extension

This is an extension for DuckDB for manipulating point cloud data using SQL.

You can use the extension to read point cloud data from various formats (e.g., LAS, LAZ) and perform transformations on them.

Project overview from the community descriptor.

Documentation and resources

Project and build details
Repository
ahuarte47/duckdb-pdal
License
MIT / Overall PDAL license (BSD) - https://pdal.org/en/latest/copyright.html
Maintainers
ahuarte47
Written in
C++
Build source
1fecc62fa37a
Build definition
Community descriptor