How to do it...

ST_DelaunayTriangles will calculate a 3D TIN with the correct flag: geometry ST_DelaunayTriangles (geometry g1, float tolerance, int4 flags):

DROP TABLE IF EXISTS chp07.uas_tin; 
CREATE TABLE chp07.uas_tin AS WITH pts AS  
( 
   SELECT PC_Explode(pa) AS pt  
   FROM chp07.uas_flights 
) 
SELECT ST_DelaunayTriangles(ST_Union(pt::geometry), 0.0, 2) AS the_geom  
FROM pts; 

Now, we have a full TIN of a digital surface model at our disposal:

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.