Changes between Version 2 and Version 3 of UsersWikiBuildPolygonsWithLines


Ignore:
Timestamp:
04/08/15 20:45:08 (10 years ago)
Author:
Mike Taves
Comment:

use ST_UnaryUnion for (e.g.) LINESTRING (50 40, 200 300, 300 50, 50 50)

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiBuildPolygonsWithLines

    v2 v3  
    66#!sql
    77CREATE OR REPLACE FUNCTION ST_BuildAreaLinework(linework geometry) RETURNS geometry AS
    8 'WITH data AS (SELECT * FROM ST_Dump($1))
     8'WITH data AS (SELECT * FROM ST_Dump(ST_UnaryUnion($1)))
    99SELECT ST_SetSRID(ST_BuildArea(ST_Collect(geom)), ST_SRID($1))
    1010FROM