[postgis-tickets] [SCM] PostGIS branch main updated. 3.1.0rc1-399-g9f12ffa

git at osgeo.org git at osgeo.org
Fri Aug 13 00:59:37 PDT 2021


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, main has been updated
       via  9f12ffaa0bc2495e7b9f6f027f32bdaf6941ce4c (commit)
      from  9ee72d5cb6e9b049c1b048f77d28140e18b18504 (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 9f12ffaa0bc2495e7b9f6f027f32bdaf6941ce4c
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri Aug 13 09:33:58 2021 +0200

    Improve test for getFaceContainingPoint
    
    Allow inspecting query points graphically
    
    Add tests for query point near the start
    of a dangling edge

diff --git a/topology/test/regress/getfacecontainingpoint.sql b/topology/test/regress/getfacecontainingpoint.sql
index d4befbd..8780423 100644
--- a/topology/test/regress/getfacecontainingpoint.sql
+++ b/topology/test/regress/getfacecontainingpoint.sql
@@ -24,56 +24,52 @@ FROM city_data.face
 WHERE face_id > 0
 ORDER BY face_id;
 
--- Query point near isolated edge in a face
-SELECT 't1', topology.GetFaceContainingPoint('city_data', 'POINT(11 34)');
+-- Query point on a node incident to multiple faces
+SELECT 'e1', topology.GetFaceContainingPoint('city_data', 'POINT(21 14)');
 
--- Query point near node of closed edge, outside of it
-SELECT 't2', topology.GetFaceContainingPoint('city_data', 'POINT(3.8 30.8)');
+-- Query point on a node incident to universe face and proper face
+SELECT 'e2', topology.GetFaceContainingPoint('city_data', 'POINT(9 22)');
 
--- Query point near node of closed edge, inside of it
-SELECT 't3', topology.GetFaceContainingPoint('city_data', 'POINT(4.2 31.2)');
+-- Query point on a non-dangling edge binding 2 faces
+SELECT 'e3', topology.GetFaceContainingPoint('city_data', 'POINT(28 14)');
 
--- Query point on a node of degree 1 incident to single face
-SELECT 't4', topology.GetFaceContainingPoint('city_data', 'POINT(25 35)');
+-- Query point on a non-dangling edge binding universe and proper face
+SELECT 'e4', topology.GetFaceContainingPoint('city_data', 'POINT(28 22)');
 
+CREATE TABLE city_data.query_points(id int primary key, g geometry);
+INSERT INTO city_data.query_points VALUES
+-- Query point near isolated edge in a face
+( 1, 'POINT(11 34)' ),
+-- Query point near node of closed edge, outside of it
+( 2, 'POINT(3.8 30.8)' ),
+-- Query point near node of closed edge, inside of it
+( 3, 'POINT(4.2 31.2)' ),
+-- Query point on a node of degree 1 incident to single face
+( 4, 'POINT(25 35)' ),
 -- Query point on an dangling edge
-SELECT 't5', topology.GetFaceContainingPoint('city_data', 'POINT(25 33)');
-
+( 5, 'POINT(25 33)' ),
 -- Query point on a node of degree 2 incident to single face
-SELECT 't6', topology.GetFaceContainingPoint('city_data', 'POINT(57 33)');
-
+( 6, 'POINT(57 33)' ),
 -- Query point in hole touching shell, near edge having hole on the left
-SELECT 't7', topology.GetFaceContainingPoint('city_data', 'POINT(32 16.9)');
-
+( 7, 'POINT(32 16.9)' ),
 -- Query point in hole touching shell, near edge having hole on the right
-SELECT 't8', topology.GetFaceContainingPoint('city_data', 'POINT(24 16.9)');
-
+( 8, 'POINT(24 16.9)' ),
 -- Query point collinear with closest incoming segment (right of next one)
-SELECT 't9', topology.GetFaceContainingPoint('city_data', 'POINT(7.1 31)');
-
+( 9, 'POINT(7.1 31)' ),
 -- Query point on the right of the closest segment but left of ring
-SELECT 't10', topology.GetFaceContainingPoint('city_data', 'POINT(26 16.8)');
-
+( 10, 'POINT(26 16.8)' ),
 -- Query point on the left of the closest segment and left of ring
-SELECT 't11', topology.GetFaceContainingPoint('city_data', 'POINT(26 17.2)');
-
+( 11, 'POINT(26 17.2)' ),
 -- Query point on the left of the closest segment but right of ring
-SELECT 't12', topology.GetFaceContainingPoint('city_data', 'POINT(33.1 17.8)');
-
+( 12, 'POINT(33.05 17.21)' ),
 -- Query point on the right of the closest segment and right of ring
-SELECT 't13', topology.GetFaceContainingPoint('city_data', 'POINT(33.1 17.2)');
-
--- Query point on a node incident to multiple faces
-SELECT 'e1', topology.GetFaceContainingPoint('city_data', 'POINT(21 14)');
+( 13, 'POINT(33.1 17.2)' ),
+-- Query point near the start of a dangling edge
+( 14, 'POINT(8 36)' );
 
--- Query point on a node incident to universe face and proper face
-SELECT 'e2', topology.GetFaceContainingPoint('city_data', 'POINT(9 22)');
-
--- Query point on a non-dangling edge binding 2 faces
-SELECT 'e3', topology.GetFaceContainingPoint('city_data', 'POINT(28 14)');
-
--- Query point on a non-dangling edge binding universe and proper face
-SELECT 'e4', topology.GetFaceContainingPoint('city_data', 'POINT(28 22)');
+SELECT 't'||id, topology.GetFaceContainingPoint('city_data', g)
+FROM city_data.query_points
+ORDER BY id;
 
 
 
diff --git a/topology/test/regress/getfacecontainingpoint_expected b/topology/test/regress/getfacecontainingpoint_expected
index ef034b2..d284e60 100644
--- a/topology/test/regress/getfacecontainingpoint_expected
+++ b/topology/test/regress/getfacecontainingpoint_expected
@@ -9,6 +9,10 @@ pos|8|8
 pos|9|9
 pos|10|10
 pos|11|11
+ERROR:  Two or more faces found
+ERROR:  Two or more faces found
+ERROR:  Two or more faces found
+ERROR:  Two or more faces found
 t1|1
 t2|1
 t3|9
@@ -22,7 +26,4 @@ t10|10
 t11|10
 t12|10
 t13|10
-ERROR:  Two or more faces found
-ERROR:  Two or more faces found
-ERROR:  Two or more faces found
-ERROR:  Two or more faces found
+t14|1

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

Summary of changes:
 topology/test/regress/getfacecontainingpoint.sql   | 68 ++++++++++------------
 .../test/regress/getfacecontainingpoint_expected   |  9 +--
 2 files changed, 37 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list