Changeset: b1099e1ce4c4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b1099e1ce4c4
Added Files:
geom/sql/functions/Tests/ST_Collect.test
Branch: geo-update
Log Message:
Adds some tests for ST_Collect implementation
diffs (82 lines):
diff --git a/geom/sql/functions/Tests/ST_Collect.test
b/geom/sql/functions/Tests/ST_Collect.test
new file mode 100644
--- /dev/null
+++ b/geom/sql/functions/Tests/ST_Collect.test
@@ -0,0 +1,77 @@
+# column aggregation
+
+## points
+query T rowsort
+SELECT
+ ST_COLLECT(pts)
+FROM (
+ VALUES
+ (ST_GeomFromText('POINT(1 1)')),
+ (ST_GeomFromText('POINT(2 2)'))
+) AS REL(pts)
+----
+MULTIPOINT (1 1, 2 2)
+
+## lines
+query T rowsort
+SELECT
+ ST_COLLECT(lns)
+FROM (
+ VALUES
+ (ST_GeomFromText('LINESTRING(10 20, 30 40, 60 40, 10 20)')),
+ (ST_GeomFromText('LINESTRING(10 10, 50 50)'))
+) AS REL(lns)
+----
+MULTILINESTRING ((10 20, 30 40, 60 40, 10 20), (10 10, 50 50))
+
+## polygons
+query T rowsort
+SELECT
+ ST_COLLECT(pgs)
+FROM (
+ VALUES
+ (ST_GeomFromText('POLYGON((10 10, 30 40, 50 50, 40 30, 10 10))')),
+ (ST_GeomFromText('POLYGON( EMPTY )')),
+ (ST_GeomFromText('POLYGON((30 30, 30 50, 50 30, 30 30))'))
+) AS REL(pgs)
+----
+MULTIPOLYGON (((10 10, 30 40, 50 50, 40 30, 10 10)), EMPTY, ((30 30, 30 50, 50
30, 30 30)))
+
+# per row aggregation
+
+## points-points
+query T rowsort
+SELECT
+ ST_COLLECT(p1, p2) AS points
+FROM (
+ VALUES
+ (
+ ST_GeomFromText('POINT(1 2)'),
+ ST_GeomFromText('POINT(3 4)')
+ ),
+ (
+ ST_GeomFromText('POINT(10 20)'),
+ ST_GeomFromText('POINT(30 40)')
+ )
+) AS REL(p1, p2)
+----
+MULTIPOINT (1 2, 3 4)
+MULTIPOINT (10 20, 30 40)
+
+## points-lines
+# TODO
+
+## points-polygons
+# TODO
+
+## lines-lines
+# TODO
+
+## lines-polygons
+# TODO
+
+## polygons-polygons
+# TODO
+
+## what about multi-types
+
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list