From: Sandro Santilli Date: Sat, 12 Nov 2011 18:20:56 +0000 (+0000) Subject: Do not consider nodes with the same bounding box as being equal. X-Git-Tag: 2.0.0alpha1~712 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8cacf6231f4388dbe44a230e8176a99d7b55b2f4;p=postgis Do not consider nodes with the same bounding box as being equal. Fixes bug #1284. Includes regression test. git-svn-id: http://svn.osgeo.org/postgis/trunk@8148 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/topology/sql/sqlmm.sql b/topology/sql/sqlmm.sql index 4f99bd0f1..520e74ce4 100644 --- a/topology/sql/sqlmm.sql +++ b/topology/sql/sqlmm.sql @@ -4039,7 +4039,7 @@ BEGIN ) FROM ( SELECT ST_StartPoint(geom) as geom FROM edges - UNION + UNION ALL SELECT ST_EndPoint(geom) FROM edges ) as endpoints INTO points; diff --git a/topology/test/regress/st_createtopogeo.sql b/topology/test/regress/st_createtopogeo.sql index 23638eb7a..b9131ab48 100644 --- a/topology/test/regress/st_createtopogeo.sql +++ b/topology/test/regress/st_createtopogeo.sql @@ -223,6 +223,30 @@ select * from print_elements_count('T16'); select * from print_isolated_nodes('T16'); select null from ( select topology.DropTopology('t') ) as dt; +-- Very close-by nodes created by intersection +-- See ticket #1284 +select null from ( select topology.CreateTopology('t') > 0 ) as ct; +select 'T17', st_asewkt(g) FROM ( +SELECT g, topology.st_createtopogeo('t', g) FROM ( SELECT ' +MULTILINESTRING( +( + 832709.937 816560.25, + 832705.813 816470.25, + 832661.937 816561.875 +), +( + 832705.812 816470.25, + 832709.937 816560.25 +), +( + 832661.938 816561.875, + 832705.813 816470.25 +)) +'::geometry as g ) as i ) as j; +select * from print_elements_count('T17'); +select * from print_isolated_nodes('T17'); +select null from ( select topology.DropTopology('t') ) as dt; + -- clean up DELETE FROM spatial_ref_sys where srid = 4326; DROP FUNCTION print_isolated_nodes(text); diff --git a/topology/test/regress/st_createtopogeo_expected b/topology/test/regress/st_createtopogeo_expected index ca5847bb4..da3243ee1 100644 --- a/topology/test/regress/st_createtopogeo_expected +++ b/topology/test/regress/st_createtopogeo_expected @@ -38,3 +38,5 @@ T15|GEOMETRYCOLLECTION(LINESTRING(-5 -2,0 0),LINESTRING(0 0,10 10),LINESTRING(0 T15|4 nodes|4 edges|1 faces T16|GEOMETRYCOLLECTION(LINESTRING(0 0,10 0),LINESTRING(0 3,20 4),LINESTRING(10 0,20 4)) T16|4 nodes|3 edges|0 faces +T17|MULTILINESTRING((832709.937 816560.25,832705.813 816470.25,832661.937 816561.875),(832705.812 816470.25,832709.937 816560.25),(832661.938 816561.875,832705.813 816470.25)) +T17|7 nodes|8 edges|2 faces