Example of ST_DelaunayTriangles
Simon did such a good job of using R to build a ST_DelaunayTriangles, that I figured I'd reuse his example a bit, but slightly modified.
Using Simon's example from R-Based Delaunay Triangulation Function for PostGIS using Deldir Package
, but instead of using R, using the now built-in PostGIS ST_DelaunayTriangles and new closer to SQL/MM semantics of PostGIS 2+.
WITH ds(geom) AS (
SELECT ST_GeomFromText('POINT Z(-90.2618913358086 33.2184179805337 403)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2534717690058 33.2235960587115 332)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2526790106307 33.2219983038141 393)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2548360643114 33.2220152472292 349)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2569931215599 33.2220321532301 373)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2591702280608 33.2202360124111 329)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2570132117573 33.2202191464654 242)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2548561990173 33.2202022431079 311)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2526991898448 33.2201853023387 296)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2527193654874 33.2183723003489 375)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2548763301557 33.2183892384722 331)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2570332983911 33.2184061391864 246)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2591902701899 33.2184230024914 292)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2602038624534 33.2165408049195 228)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2580468665807 33.2165321889039 295)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2558898738654 33.2165235354584 305)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2537328843112 33.2165148445831 396)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2537432444696 33.2147017821533 329)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.255900189497 33.2147104705514 213)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2580571376854 33.2147191215224 218)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2602140890308 33.2147277350661 226)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.2591415442112 33.2133037851107 310)',4326)
UNION ALL
SELECT ST_GeomFromText('POINT Z(-90.254879330931 33.2133111535788 228)',4326)
)
SELECT ST_AsText(ST_DelaunayTriangles(ST_Collect(ds.geom)))
FROM ds ;
The output looks like this, which I haven't verified how different it is from Simon's output since the order is different
GEOMETRYCOLLECTION Z (
POLYGON Z ((-90.2618913358086 33.2184179805337 403
,-90.2602140890308 33.2147277350661 226
,-90.2602038624534 33.2165408049195 228
,-90.2618913358086 33.2184179805337 403))
,POLYGON Z ((-90.2618913358086 33.2184179805337 403
,-90.2602038624534 33.2165408049195 228
,-90.2591902701899 33.2184230024914 292
,-90.2618913358086 33.2184179805337 403))
,POLYGON Z ((-90.2618913358086 33.2184179805337 403
,-90.2591902701899 33.2184230024914 292
,-90.2591702280608 33.2202360124111 329
,-90.2618913358086 33.2184179805337 403))
,POLYGON Z ((-90.2618913358086 33.2184179805337 403
,-90.2591702280608 33.2202360124111 329
,-90.2569931215599 33.2220321532301 373
,-90.2618913358086 33.2184179805337 403))
,POLYGON Z ((-90.2569931215599 33.2220321532301 373
,-90.2591702280608 33.2202360124111 329
,-90.2570132117573 33.2202191464654 242
,-90.2569931215599 33.2220321532301 373))
,POLYGON Z ((-90.2569931215599 33.2220321532301 373
,-90.2570132117573 33.2202191464654 242
,-90.2548561990173 33.2202022431079 311
,-90.2569931215599 33.2220321532301 373))
,POLYGON Z ((-90.2569931215599 33.2220321532301 373
,-90.2548561990173 33.2202022431079 311
,-90.2548360643114 33.2220152472292 349
,-90.2569931215599 33.2220321532301 373))
,POLYGON Z ((-90.2569931215599 33.2220321532301 373
,-90.2548360643114 33.2220152472292 349
,-90.2534717690058 33.2235960587115 332
,-90.2569931215599 33.2220321532301 373))
,POLYGON Z ((-90.2534717690058 33.2235960587115 332
,-90.2548360643114 33.2220152472292 349
,-90.2526790106307 33.2219983038141 393
,-90.2534717690058 33.2235960587115 332))
,POLYGON Z ((-90.2526790106307 33.2219983038141 393
,-90.2548360643114 33.2220152472292 349
,-90.2526991898448 33.2201853023387 296
,-90.2526790106307 33.2219983038141 393))
,POLYGON Z ((-90.2591415442112 33.2133037851107 310
,-90.254879330931 33.2133111535788 228
,-90.2580571376854 33.2147191215224 218
,-90.2591415442112 33.2133037851107 310))
,POLYGON Z ((-90.2591415442112 33.2133037851107 310
,-90.2580571376854 33.2147191215224 218
,-90.2602140890308 33.2147277350661 226
,-90.2591415442112 33.2133037851107 310))
,POLYGON Z ((-90.2602140890308 33.2147277350661 226
,-90.2580571376854 33.2147191215224 218
,-90.2602038624534 33.2165408049195 228
,-90.2602140890308 33.2147277350661 226))
,POLYGON Z ((-90.2602038624534 33.2165408049195 228
,-90.2580571376854 33.2147191215224 218
,-90.2580468665807 33.2165321889039 295
,-90.2602038624534 33.2165408049195 228))
,POLYGON Z ((-90.2602038624534 33.2165408049195 228
,-90.2580468665807 33.2165321889039 295
,-90.2591902701899 33.2184230024914 292
,-90.2602038624534 33.2165408049195 228))
,POLYGON Z ((-90.2591902701899 33.2184230024914 292
,-90.2580468665807 33.2165321889039 295
,-90.2570332983911 33.2184061391864 246
,-90.2591902701899 33.2184230024914 292))
,POLYGON Z ((-90.2591902701899 33.2184230024914 292
,-90.2570332983911 33.2184061391864 246
,-90.2591702280608 33.2202360124111 329
,-90.2591902701899 33.2184230024914 292))
,POLYGON Z ((-90.2591702280608 33.2202360124111 329
,-90.2570332983911 33.2184061391864 246
,-90.2570132117573 33.2202191464654 242
,-90.2591702280608 33.2202360124111 329))
,POLYGON Z ((-90.2570132117573 33.2202191464654 242
,-90.2570332983911 33.2184061391864 246
,-90.2548763301557 33.2183892384722 331
,-90.2570132117573 33.2202191464654 242))
,POLYGON Z ((-90.2570132117573 33.2202191464654 242
,-90.2548763301557 33.2183892384722 331
,-90.2548561990173 33.2202022431079 311
,-90.2570132117573 33.2202191464654 242))
,POLYGON Z ((-90.2548561990173 33.2202022431079 311
,-90.2548763301557 33.2183892384722 331
,-90.2527193654874 33.2183723003489 375
,-90.2548561990173 33.2202022431079 311))
,POLYGON Z ((-90.2548561990173 33.2202022431079 311
,-90.2527193654874 33.2183723003489 375
,-90.2526991898448 33.2201853023387 296
,-90.2548561990173 33.2202022431079 311))
,POLYGON Z ((-90.2548561990173 33.2202022431079 311
,-90.2526991898448 33.2201853023387 296
,-90.2548360643114 33.2220152472292 349
,-90.2548561990173 33.2202022431079 311))
,POLYGON Z ((-90.2527193654874 33.2183723003489 375
,-90.2548763301557 33.2183892384722 331
,-90.2537328843112 33.2165148445831 396
,-90.2527193654874 33.2183723003489 375))
,POLYGON Z ((-90.2527193654874 33.2183723003489 375
,-90.2537328843112 33.2165148445831 396
,-90.2537432444696 33.2147017821533 329
,-90.2527193654874 33.2183723003489 375))
,POLYGON Z ((-90.2537432444696 33.2147017821533 329
,-90.2537328843112 33.2165148445831 396
,-90.2558898738654 33.2165235354584 305
,-90.2537432444696 33.2147017821533 329))
,POLYGON Z ((-90.2537432444696 33.2147017821533 329
,-90.2558898738654 33.2165235354584 305
,-90.255900189497 33.2147104705514 213
,-90.2537432444696 33.2147017821533 329))
,POLYGON Z ((-90.2537432444696 33.2147017821533 329
,-90.255900189497 33.2147104705514 213
,-90.254879330931 33.2133111535788 228
,-90.2537432444696 33.2147017821533 329))
,POLYGON Z ((-90.254879330931 33.2133111535788 228
,-90.255900189497 33.2147104705514 213
,-90.2580571376854 33.2147191215224 218
,-90.254879330931 33.2133111535788 228))
,POLYGON Z ((-90.2580571376854 33.2147191215224 218
,-90.255900189497 33.2147104705514 213
,-90.2580468665807 33.2165321889039 295
,-90.2580571376854 33.2147191215224 218))
,POLYGON Z ((-90.2580468665807 33.2165321889039 295
,-90.255900189497 33.2147104705514 213
,-90.2558898738654 33.2165235354584 305
,-90.2580468665807 33.2165321889039 295))
,POLYGON Z ((-90.2580468665807 33.2165321889039 295
,-90.2558898738654 33.2165235354584 305
,-90.2570332983911 33.2184061391864 246
,-90.2580468665807 33.2165321889039 295))
,POLYGON Z ((-90.2570332983911 33.2184061391864 246
,-90.2558898738654 33.2165235354584 305
,-90.2548763301557 33.2183892384722 331
,-90.2570332983911 33.2184061391864 246))
,POLYGON Z ((-90.2548763301557 33.2183892384722 331
,-90.2558898738654 33.2165235354584 305
,-90.2537328843112 33.2165148445831 396
,-90.2548763301557 33.2183892384722 331)))
Now all it needs is an option to expose it as a TIN.