[postgis-devel] [PostGIS] #1383: Topology: ST_AddEdgeNewFaces() fail to add an edge

PostGIS trac at osgeo.org
Thu Jan 12 06:47:49 PST 2012


#1383: Topology: ST_AddEdgeNewFaces() fail to add an edge
-----------------------+----------------------------------------------------
 Reporter:  aperi2007  |       Owner:  strk         
     Type:  defect     |      Status:  assigned     
 Priority:  medium     |   Milestone:  PostGIS 2.0.0
Component:  topology   |     Version:  trunk        
 Keywords:             |  
-----------------------+----------------------------------------------------

Comment(by strk):

 forceRHR isn't doing what it should:

 {{{
 strk=# with foo as ( select 'LINESTRING(0.1 0.3,-0.1 0.2,-0.1 0.1,-0.1
 1.38777878078145e-16,0.2 -0.2,0.2 -0.4,-0.2 -0.4,-0.4 -0.4,-0.4 0.4,-0.3
 0.4,-0.2 0.4,-2.77555756156289e-17 0.4,0.1 0.4,0.1 0.3)'::geometry as a,
 'LINESTRING(-2.77555756156289e-17 0.4,0.1 0.4,0.1 0.3,-0.1 0.2,-0.1
 0.1,-0.1 1.38777878078145e-16,0.2 -0.2,0.2 -0.4,-0.2 -0.4,-0.4 -0.4,-0.4
 0.4,-0.3 0.4,-0.2 0.4,-2.77555756156289e-17 0.4)'::geometry as b ) select
 st_equals(a,b), st_astext(st_forcerhr(st_makepolygon(b))) as b_frhr,
 st_astext(st_makepolygon(b)) as b_orig,
 st_astext(st_forcerhr(st_makepolygon(a))) as a_frhr,
 st_astext(st_makepolygon(a)) as a_orig from foo;
 -[ RECORD 1
 ]------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 st_equals | t
 b_frhr    | POLYGON((-2.77555756156289e-17 0.4,0.1 0.4,0.1 0.3,-0.1
 0.2,-0.1 0.1,-0.1 1.38777878078145e-16,0.2 -0.2,0.2 -0.4,-0.2 -0.4,-0.4
 -0.4,-0.4 0.4,-0.3 0.4,-0.2 0.4,-2.77555756156289e-17 0.4))
 b_orig    | POLYGON((-2.77555756156289e-17 0.4,0.1 0.4,0.1 0.3,-0.1
 0.2,-0.1 0.1,-0.1 1.38777878078145e-16,0.2 -0.2,0.2 -0.4,-0.2 -0.4,-0.4
 -0.4,-0.4 0.4,-0.3 0.4,-0.2 0.4,-2.77555756156289e-17 0.4))
 a_frhr    | POLYGON((0.1 0.3,-0.1 0.2,-0.1 0.1,-0.1
 1.38777878078145e-16,0.2 -0.2,0.2 -0.4,-0.2 -0.4,-0.4 -0.4,-0.4 0.4,-0.3
 0.4,-0.2 0.4,-2.77555756156289e-17 0.4,0.1 0.4,0.1 0.3))
 a_orig    | POLYGON((0.1 0.3,-0.1 0.2,-0.1 0.1,-0.1
 1.38777878078145e-16,0.2 -0.2,0.2 -0.4,-0.2 -0.4,-0.4 -0.4,-0.4 0.4,-0.3
 0.4,-0.2 0.4,-2.77555756156289e-17 0.4,0.1 0.4,0.1 0.3))
 }}}

 The above is basically showing that two spatially equal lines forming a
 polygon do not become the _same_ polygon when passed trough ST_ForceRHR,
 while they should...

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1383#comment:6>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list