Digging a little deeper. Ran the chipper on a smaller number of points and then am doing a little hacking to get height per chip (if you start to get lost, go to Paul Ramsey’s tutorial).
Here’s my pipeline file. Note the small chipper size– 20 points per chip.
<?xml version="1.0" encoding="utf-8"?> <Pipeline version="1.0"> <Writer type="drivers.pgpointcloud.writer"> <Option name="connection">dbname='pggis' user='pggis' host='localhost'</Option> <Option name="table">test1</Option> <Option name="srid">3362</Option> <Filter type="filters.chipper"> <Option name="capacity">20</Option> <Filter type="filters.cache"> <Reader type="drivers.las.reader"> <Option name="filename">60002250PAN.las</Option> <Option name="spatialreference">EPSG:3362</Option> </Reader> </Filter> </Filter> </Writer> </Pipeline>
Easy enough to load (though slow for the sake of the chip size):
pdal pipeline las2pg.xml
Now we can do some really quick and dirty height calculations per chip — like what’s the difference between the minimum and maximum value in the chip:
DROP TABLE IF EXISTS test1_patches; CREATE TABLE patch_heights AS SELECT pa::geometry(Polygon, 3362) AS geom, PC_PatchAvg(pa, 'Z') AS elevation, PC_PatchMax(pa, 'Z') - PC_PatchMin(pa, 'Z') AS height FROM test1;