[pgpointcloud] How to create a PcPoint table in PostGIS?

Regina Obe lr at pcorp.us
Tue Mar 28 13:08:26 PDT 2023


You can use the PC_Explode function to access individual points.  It converts a patch into individual PcPoints.

 

https://pgpointcloud.github.io/pointcloud/functions/patchs.html#pc-explode

 

 

You can use the PC_PointN to access individual points by index number in the patch.

 

https://pgpointcloud.github.io/pointcloud/functions/patchs.html#pc-pointn

 

 

So for example to pick at random 3 points, you can do something like (NOT TESTED)

 

SELECT PC_PointN(pa, index) AS pcp

FROM patches AS p,  PC_NumPoints(p.pa) AS np

CROSS JOIN LATERAL (SELECT index FROM generate_series(1, np) AS index ORDER BY random() LIMIT 3) AS pi(index);

 

Hope that helps,

Regina

 

 

From: pgpointcloud [mailto:pgpointcloud-bounces at lists.osgeo.org] On Behalf Of Neil Underhill
Sent: Tuesday, March 28, 2023 12:47 PM
To: pgpointcloud at lists.osgeo.org
Subject: [pgpointcloud] How to create a PcPoint table in PostGIS?

 

I have a .laz file with about 51m points in it  (225 MB in size), and want to run a RANSAC algorithm to detect roof planes. 

 

I would like to add the LIDAR data to a PostGIS database so I can interact with other geospatial layers (e.g. use a mask to filter the points to consider) and also access individual points to input into the algorithm. 

I have been following the information here (https://pgpointcloud.github.io/pointcloud/concepts/objects.html) about the different Point Cloud Objects. 

 

My question is, if I store the data as a PcPatch, will I be able to access the individual points (e.g. select three points at random, that may or may not be in the same patch) ? 

 

If not, it seems I will need to store as PcPoint. If it's the latter, I am not clear how I create a database with PcPoint objects, as the example in the Quickstart (https://pgpointcloud.github.io/pointcloud/quickstart.html) only creastes a PcPatch table.  

 

Thanks for any advice,

Neil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgpointcloud/attachments/20230328/1d99e41d/attachment.htm>


More information about the pgpointcloud mailing list