[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-658-gc70c0762b

git at osgeo.org git at osgeo.org
Tue Feb 21 15:33:42 PST 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  c70c0762b0b9210288a2b0a7f9caed50e3db9bd4 (commit)
       via  cf2b98cd0067bcb83ebebf06b9d46e0d79c921a5 (commit)
      from  a4c05cdefab572a3f54b1323cf392f0f837a804f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c70c0762b0b9210288a2b0a7f9caed50e3db9bd4
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Feb 22 00:32:17 2023 +0100

    Simplify test, make easier to debug on failure

diff --git a/topology/test/regress/topoelement_cast.sql b/topology/test/regress/topoelement_cast.sql
index 727cac145..4460d53cc 100644
--- a/topology/test/regress/topoelement_cast.sql
+++ b/topology/test/regress/topoelement_cast.sql
@@ -13,33 +13,47 @@ SELECT NULL FROM AddTopoGeometryColumn('tt', 'tt', 'f_hier_point', 'g', 'POINT',
 
 -- populate base
 INSERT INTO tt.f_point(lbl,g)
-SELECT x::text||y::text, ToTopoGeom( ST_Point(x,y,4326), 'tt', l.layer_id )
-FROM generate_series(50,60, 10) AS x CROSS JOIN generate_series(10,90, 20) AS y
-    CROSS JOIN (SELECT l.layer_id
-                    FROM topology.layer AS l WHERE l.table_name = 'f_point' AND l.schema_name = 'tt' AND l.feature_column = 'g'
-               ) AS l;
+SELECT
+  x::text||y::text,
+  topology.toTopoGeom(
+    ST_Point(x,y,4326),
+    'tt',
+    layer_id(findLayer('tt','f_point', 'g'))
+  )
+FROM generate_series(50,60, 10) AS x
+CROSS JOIN generate_series(70,90, 20) AS y;
 
 -- populate hierarchy, cast
 INSERT INTO  tt.f_hier_point(lbl, g)
-SELECT left(f.lbl,2) AS lbl, CreateTopoGeom('tt',1, l.layer_id, TopoElementArray_agg(f.g::topology.topoelement ORDER BY f.lbl) )
-FROM  tt.f_point AS f CROSS JOIN
-    (SELECT l.layer_id FROM topology.layer AS l WHERE l.table_name = 'f_hier_point' AND l.schema_name = 'tt' AND l.feature_column = 'g' ) AS l
-GROUP BY l.layer_id, left(f.lbl,2);
-
-SELECT ST_AsText(g::geometry)
-FROM tt.f_hier_point;
+SELECT
+  format('bycast:%s', left(f.lbl,2)),
+  createTopoGeom(
+    'tt',
+    1,
+    layer_id(findLayer('tt','f_hier_point', 'g')),
+    TopoElementArray_agg( f.g::topology.topoelement ORDER BY f.lbl)
+  )
+FROM  tt.f_point AS f
+GROUP BY left(f.lbl,2);
 
 -- using FUNCTION
 
 -- populate hierarchy
 INSERT INTO  tt.f_hier_point(lbl, g)
-SELECT 'all' AS lbl, CreateTopoGeom('tt',1, l.layer_id, TopoElementArray_agg(topology.topoelement(f.g) ORDER BY f.lbl) )
-FROM  tt.f_point AS f CROSS JOIN
-    (SELECT l.layer_id FROM topology.layer AS l WHERE l.table_name = 'f_hier_point' AND l.schema_name = 'tt' AND l.feature_column = 'g' ) AS l
-GROUP BY l.layer_id;
-
-SELECT ST_AsText(g::geometry)
-FROM tt.f_hier_point WHERE lbl = 'all';
+SELECT
+  format('byfunc:%s', right(f.lbl,2)),
+  createTopoGeom(
+    'tt',
+    1,
+    layer_id(findLayer('tt','f_hier_point', 'g')),
+    TopoElementArray_agg( f.g::topology.topoelement ORDER BY f.lbl)
+  )
+FROM  tt.f_point AS f
+GROUP BY right(f.lbl,2);
+
+SELECT 't1', lbl, ST_AsText(g::geometry)
+FROM tt.f_hier_point
+ORDER BY lbl;
 
 -- Cleanup
 SELECT NULL FROM DropTopology('tt');
diff --git a/topology/test/regress/topoelement_cast_expected b/topology/test/regress/topoelement_cast_expected
index edf63a426..1a3420f13 100644
--- a/topology/test/regress/topoelement_cast_expected
+++ b/topology/test/regress/topoelement_cast_expected
@@ -1,3 +1,4 @@
-MULTIPOINT((50 10),(50 30),(50 50),(50 70),(50 90))
-MULTIPOINT((60 10),(60 30),(60 50),(60 70),(60 90))
-MULTIPOINT((50 10),(50 30),(50 50),(50 70),(50 90),(60 10),(60 30),(60 50),(60 70),(60 90))
+t1|bycast:50|MULTIPOINT((50 70),(50 90))
+t1|bycast:60|MULTIPOINT((60 70),(60 90))
+t1|byfunc:70|MULTIPOINT((50 70),(60 70))
+t1|byfunc:90|MULTIPOINT((50 90),(60 90))

-----------------------------------------------------------------------

Summary of changes:
 doc/extras_topology.xml                         | 47 ++++++++++++++++++--
 topology/test/regress/topoelement_cast.sql      | 59 +++++++++++++++++++++++++
 topology/test/regress/topoelement_cast_expected |  4 ++
 topology/test/tests.mk                          |  3 +-
 topology/topology.sql.in                        | 25 +++++++++++
 5 files changed, 134 insertions(+), 4 deletions(-)
 create mode 100644 topology/test/regress/topoelement_cast.sql
 create mode 100644 topology/test/regress/topoelement_cast_expected


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list