From: Sandro Santilli Date: Sat, 19 Mar 2011 23:35:21 +0000 (+0000) Subject: Fix #874 by getting back to ST_SharedPaths use. Might try to optimize again in the... X-Git-Tag: 2.0.0alpha1~1860 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a209240f8d48b352ea2a6a39c33c038ee50ec603;p=postgis Fix #874 by getting back to ST_SharedPaths use. Might try to optimize again in the future, but correctness first! This commit also adds regression testing for the case [RT-SIGTA] git-svn-id: http://svn.osgeo.org/postgis/trunk@6942 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/topology/sql/populate.sql b/topology/sql/populate.sql index 11fe4adf6..397e3b476 100644 --- a/topology/sql/populate.sql +++ b/topology/sql/populate.sql @@ -371,10 +371,8 @@ BEGIN LOOP -- { -- Find the side of the edge on the face - right_side := ST_Line_Locate_Point(bounds, - ST_Line_Interpolate_Point(rec.geom, 0.2)) < - ST_Line_Locate_Point(bounds, - ST_Line_Interpolate_Point(rec.geom, 0.8)); + SELECT DISTINCT (st_dump(st_sharedpaths(rec.geom, bounds))).path[1] + = 1 INTO STRICT right_side; RAISE DEBUG 'Edge % (left:%, right:%) - ring : % - right_side : %', rec.edge_id, rec.left_face, rec.right_face, rrec.path, right_side; diff --git a/topology/test/regress/addface.sql b/topology/test/regress/addface.sql index bafb7ee59..c1fea2646 100644 --- a/topology/test/regress/addface.sql +++ b/topology/test/regress/addface.sql @@ -74,7 +74,7 @@ SELECT 't2.e11', topology.addEdge('t2', 'LINESTRING(12 2, 12 4, 14 4)'); -- Register left face with two holes SELECT 't2.f1', topology.addFace('t2', -'POLYGON((0 0,10 0,10 10,0 10,0 0), +'POLYGON((10 5, 10 10,0 10, 0 0,10 0,10 5), (1 1,2 1,2 2,1 2,1 1), (3 1,3 2,4 2,4 1,3 1))' );