Created
September 7, 2016 13:41
-
-
Save romanshuvalov/8ac44a84c365e31cf049245c8a4852d7 to your computer and use it in GitHub Desktop.
Postgis ST_Tesselate to a multipolygon
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment