pggeodb.nancy.inra.fr/db_toff - db_toff on pggeodb.nancy.inra.fr
Previous topic Chapter index Next topic

Function: st_bdpolyfromtext

 

 

Schema

public

 

Owner

postgres

 

Descriptions

args: WKT, srid - Construct a Polygon given an arbitrary collection of closed linestrings as a MultiLineString Well-Known text representation.

 

Options

Option

Value

Returns

public.geometry

Language

plpgsql

Parameters

text

integer

 

Definition

CREATE OR REPLACE FUNCTION public.st_bdpolyfromtext (
 text,
 integer
)
RETURNS public.geometry AS
$span$
DECLARE

geomtext alias for $1;
srid alias for $2;
mline geometry;
geom 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 GeometryType(geom) != 'POLYGON'
THEN
RAISE EXCEPTION
'Input returns more then a single polygon, try using BdMPolyFromText instead';
END IF;

RETURN geom;
END;
$span$
LANGUAGE
'plpgsql'
IMMUTABLE
RETURNS NULL ON NULL INPUT
SECURITY INVOKER
COST
100;

COMMENT ON FUNCTION public.st_bdpolyfromtext(text, integer)
IS 'args: WKT, srid - Construct a Polygon given an arbitrary collection of closed linestrings as a MultiLineString Well-Known text representation.';

This file was generated with SQL Manager for PostgreSQL (www.pgsqlmanager.com) at 13/03/2014 13:23
Previous topic Chapter index Next topic