terraware
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
st_bdpolyfromtext
Parameters
Name
Type
Mode
$1
text
IN
$2
integer
IN
Definition
DECLARE geomtext alias for $1; srid alias for $2; mline public.geometry; geom public.geometry; BEGIN mline := public.ST_MultiLineStringFromText(geomtext, srid); IF mline IS NULL THEN RAISE EXCEPTION 'Input is not a MultiLinestring'; END IF; geom := public.ST_BuildArea(mline); IF public.GeometryType(geom) != 'POLYGON' THEN RAISE EXCEPTION 'Input returns more then a single polygon, try using BdMPolyFromText instead'; END IF; RETURN geom; END;