-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- -- PostGIS - Spatial Types for PostgreSQL -- http://postgis.net -- -- Copyright (C) 2010, 2011 Sandro Santilli -- -- This is free software; you can redistribute and/or modify it under -- the terms of the GNU General Public Licence. See the COPYING file. -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- -- TopoElement management functions -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- -- Developed by Sandro Santilli -- for Faunalia (http://www.faunalia.it) with funding from -- Regione Toscana - Sistema Informativo per la Gestione del Territorio -- e dell' Ambiente [RT-SIGTA]. -- For the project: "Sviluppo strumenti software per il trattamento di dati -- geografici basati su QuantumGIS e Postgis (CIG 0494241492)" -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --{ -- -- TopoElementArray TopoElementArray_append() -- -- Append a TopoElement to a TopoElementArray -- CREATE OR REPLACE FUNCTION topology.TopoElementArray_append(topology.TopoElementArray, topology.TopoElement) RETURNS topology.TopoElementArray AS $$ SELECT CASE WHEN $1 IS NULL THEN topology.TopoElementArray('{' || $2::text || '}') ELSE topology.TopoElementArray($1::int[][]||$2::int[]) END; $$ LANGUAGE 'sql' IMMUTABLE; --} TopoElementArray_append --{ -- -- TopoElementArray TopoElementArray_agg() -- -- Aggregates a set of TopoElement values into a TopoElementArray -- -- Availability: 2.0.0 DROP AGGREGATE IF EXISTS topology.TopoElementArray_agg(topology.TopoElement); CREATE AGGREGATE topology.TopoElementArray_agg( sfunc = topology.TopoElementArray_append, basetype = topology.TopoElement, stype = topology.TopoElementArray ); --} TopoElementArray_agg