This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- thank to http://gis.stackexchange.com/questions/209825/converting-tin-to-multipolygon-in-postgis | |
CREATE OR REPLACE FUNCTION tesselate_to_multipolygon( | |
geometry) | |
RETURNS geometry AS | |
$BODY$ | |
SELECT ST_Collect(geom) AS geom | |
FROM ( | |
SELECT ST_MakePolygon(ST_ExteriorRing((ST_Dump(ST_Tesselate($1))).geom)) AS geom) as geom_item; | |
$BODY$ | |
LANGUAGE sql |