From: Sandro Santilli Date: Wed, 5 Nov 2003 18:26:54 +0000 (+0000) Subject: Added fast collect() and geomunion() aggregates implementations X-Git-Tag: pgis_0_8_0~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73e62e75f5296847d37f7f75adafabc2013207a1;p=postgis Added fast collect() and geomunion() aggregates implementations git-svn-id: http://svn.osgeo.org/postgis/trunk@352 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/Attic/postgis_sql_common.sql.in b/Attic/postgis_sql_common.sql.in index 554392bb2..f8b37370b 100644 --- a/Attic/postgis_sql_common.sql.in +++ b/Attic/postgis_sql_common.sql.in @@ -12,6 +12,9 @@ -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- $Log$ +-- Revision 1.19 2003/11/05 18:26:54 strk +-- Added fast collect() and geomunion() aggregates implementations +-- -- Revision 1.18 2003/10/28 11:18:27 strk -- Added Algorithms section and simplify() enabler code -- @@ -1022,6 +1025,11 @@ CREATE FUNCTION box3dtobox(box3d) -- Aggregate functions -- +CREATE FUNCTION geom_accum (geometry[],geometry) + RETURNS geometry[] + AS '@MODULE_FILENAME@' + LANGUAGE 'C'; + CREATE FUNCTION combine_bbox(box3d,geometry) RETURNS box3d AS '@MODULE_FILENAME@' @@ -1038,12 +1046,25 @@ CREATE FUNCTION collector(geometry,geometry) AS '@MODULE_FILENAME@' LANGUAGE 'C'; -CREATE AGGREGATE collect( +CREATE AGGREGATE memcollect( sfunc = collector, basetype = geometry, stype = geometry ); +CREATE FUNCTION collect_garray (geometry[]) + RETURNS geometry + AS '@MODULE_FILENAME@' + LANGUAGE 'C'; + +CREATE AGGREGATE collect ( + sfunc = geom_accum, + basetype = geometry, + stype = geometry[], + finalfunc = collect_garray + ); + + -- -- Operator definitions -- @@ -1235,23 +1256,36 @@ CREATE FUNCTION buffer(geometry,float8) RETURNS geometry AS '@MODULE_FILENAME@','symdifference' LANGUAGE 'C' WITH (isstrict); - - - CREATE FUNCTION symmetricdifference(geometry,geometry) - RETURNS geometry - AS '@MODULE_FILENAME@','symdifference' - LANGUAGE 'C' WITH (isstrict); - - - CREATE FUNCTION GeomUnion(geometry,geometry) - RETURNS geometry - AS '@MODULE_FILENAME@','geomunion' - LANGUAGE 'C' WITH (isstrict); -CREATE AGGREGATE unite ( + +CREATE FUNCTION symmetricdifference(geometry,geometry) + RETURNS geometry + AS '@MODULE_FILENAME@','symdifference' + LANGUAGE 'C' WITH (isstrict); + + +CREATE FUNCTION GeomUnion(geometry,geometry) + RETURNS geometry + AS '@MODULE_FILENAME@','geomunion' + LANGUAGE 'C' WITH (isstrict); + +CREATE AGGREGATE MemGeomUnion ( basetype = geometry, sfunc = geomunion, - stype = geometry ); + stype = geometry + ); + +CREATE FUNCTION unite_garray (geometry[]) + RETURNS geometry + AS '@MODULE_FILENAME@' + LANGUAGE 'C'; + +CREATE AGGREGATE GeomUnion ( + sfunc = geom_accum, + basetype = geometry, + stype = geometry[], + finalfunc = unite_garray + ); CREATE FUNCTION relate(geometry,geometry)