You can use ST_Dump
to extract individual TRIANGLE
elements from the TIN
. Then, you can convert an individual TRIANGLE
to a POLYGON
using ST_ExteriorRing
and ST_MakePolygon
. If you then need to combine these polygons into a single MULTIPOLYGON
, you could use ST_Collect
. Putting that all together would look like this:
WITH test_geom AS (SELECT 'POLYGON (( 10 190, 10 70, 80 70, 80 130, 50 160, 120 160, 120 190, 10 190 ))'::geometry AS geom)
SELECT ST_Collect(geom) AS geom
FROM (
SELECT ST_MakePolygon(ST_ExteriorRing((ST_Dump(ST_Tesselate(geom))).geom)) AS geom
FROM test_geom) sq;
ST_DelaunayTriangles
collects all points and creates convex surface and trianglates it as shown on illustration on that page you provided link to. I don't need creating convex polygon, I just need trianglate existing multipolygons.