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

PostGIS trac at osgeo.org
Sat Dec 17 14:56:54 PST 2011


#1383: Topology: ST_AddEdgeNewFaces() fail to add an edge
-----------------------+----------------------------------------------------
 Reporter:  aperi2007  |       Owner:  strk         
     Type:  defect     |      Status:  new          
 Priority:  medium     |   Milestone:  PostGIS 2.0.0
Component:  topology   |     Version:  trunk        
 Keywords:             |  
-----------------------+----------------------------------------------------
 Hi,
 Im having an error try-ing to insert a new edge on a building topology.

 I'm use a postgres 9.1.2 on windows with experimental postgis r8404 oon
 windows.
 But it came also with older version of postgis.

 This is the query sql I run:


 {{{
 select topology.DropTopology('gb_topo');
 select topology.CreateTopology('gb_topo',3003);

  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(-0.4
 0.4)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(-0.3
 0.4)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(-0.2
 -0.4)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(-0.2
 0.4)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(-0.2
 0.7)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(-0.1
 0.6)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(-2.77555756156289e-017
 0.4)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.1
 0.3)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.2
 -0.4)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.2
 -0.2)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.2
 0.2)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.2
 0.4)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.2
 0.7)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.2
 0.8)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.4
 0.9)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.5
 0.1)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.5
 0.2)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.5
 0.6)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.6
 0.1)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.7
 -0.4)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.7
 0.2)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(0.9
 0.6)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(1
 0.6)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(1.1
 -0.4)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(1.1
 -0.0999999999999999)'));
  select
 topology.ST_AddIsoNode('gb_topo',0,ST_GeomFromEWKT('SRID=3003;POINT(1.1
 0.4)'));


  select
 topology.ST_AddEdgeNewFaces('gb_topo',20,24,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.7
 -0.4,1.1 -0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',3,9,ST_GeomFromEWKT('SRID=3003;LINESTRING(-0.2
 -0.4,-0.2 -0.5,0.2 -0.5,0.2 -0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',3,9,ST_GeomFromEWKT('SRID=3003;LINESTRING(-0.2
 -0.4,0.2 -0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',9,20,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.2
 -0.4,0.7 -0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',19,19,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.6
 0.1,0.8 0.1,0.8 -0.0999999999999999,0.6 -0.0999999999999999,0.6 0.1)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',24,25,ST_GeomFromEWKT('SRID=3003;LINESTRING(1.1
 -0.4,1.1 -0.0999999999999999)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',10,9,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.2
 -0.2,0.2 -0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',14,15,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.2
 0.8,0.3 0.8,0.4 0.9)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',22,23,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.9
 0.6,1 0.6)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',13,18,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.2
 0.7,0.3 0.6,0.5 0.6)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',6,13,ST_GeomFromEWKT('SRID=3003;LINESTRING(-0.1
 0.6,-2.77555756156289e-017 0.7,0.2 0.7)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',18,22,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.5
 0.6,0.5 0.8,0.7 0.8,0.8 0.6,0.9 0.6)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',14,13,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.2
 0.8,0.2 0.7)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',5,14,ST_GeomFromEWKT('SRID=3003;LINESTRING(-0.2
 0.7,-0.2 0.9,0.2 0.9,0.2 0.8)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',15,23,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.4
 0.9,1 0.9,1 0.6)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',3,1,ST_GeomFromEWKT('SRID=3003;LINESTRING(-0.2
 -0.4,-0.4 -0.4,-0.4 0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',25,26,ST_GeomFromEWKT('SRID=3003;LINESTRING(1.1
 -0.0999999999999999,1.1 0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',10,21,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.2
 -0.2,0.3 -0.2,0.6 -0.2,0.9 -0.0999999999999999,0.9 0.1,0.7 0.2)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',8,10,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.1
 0.3,-0.1 0.2,-0.1 0.1,-0.1 1.38777878078145e-016,0.2 -0.2)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',11,16,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.2
 0.2,0.2 1.38777878078145e-016,0.5 1.38777878078145e-016,0.5 0.1)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',16,17,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.5
 0.1,0.5 0.2)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',11,17,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.2
 0.2,0.5 0.2)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',12,17,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.2
 0.4,0.4 0.4,0.5 0.2)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',26,23,ST_GeomFromEWKT('SRID=3003;LINESTRING(1.1
 0.4,1.1 0.6,1 0.6)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',21,22,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.7
 0.2,0.7 0.3,0.9 0.4,0.9 0.6)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',11,12,ST_GeomFromEWKT('SRID=3003;LINESTRING(0.2
 0.2,0.2 0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',7,8,ST_GeomFromEWKT('SRID=3003;LINESTRING(-2.77555756156289e-017
 0.4,0.1 0.4,0.1 0.3)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',2,4,ST_GeomFromEWKT('SRID=3003;LINESTRING(-0.3
 0.4,-0.2 0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',1,2,ST_GeomFromEWKT('SRID=3003;LINESTRING(-0.4
 0.4,-0.3 0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',4,7,ST_GeomFromEWKT('SRID=3003;LINESTRING(-0.2
 0.4,-2.77555756156289e-017 0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',7,6,ST_GeomFromEWKT('SRID=3003;LINESTRING(-2.77555756156289e-017
 0.4,-0.1 0.5,-0.1 0.6)'));

 -- with this last two Adding I have the error.

  select
 topology.ST_AddEdgeNewFaces('gb_topo',5,4,ST_GeomFromEWKT('SRID=3003;LINESTRING(-0.2
 0.7,-0.2 0.4)'));
  select
 topology.ST_AddEdgeNewFaces('gb_topo',2,5,ST_GeomFromEWKT('SRID=3003;LINESTRING(-0.3
 0.4,-0.3 0.7,-0.2 0.7)'));

 }}}

 Running this last two I have this errors in psql:

 test=>  select
 topology.ST_AddEdgeNewFaces('gb_topo',5,4,ST_GeomFromEWKT('SRID=3
 003;LINESTRING(-0.2 0.7,-0.2 0.4)'));

 ERROR:  Left(7)/right(0) faces mismatch: invalid topology ?

 test=>  select
 topology.ST_AddEdgeNewFaces('gb_topo',2,5,ST_GeomFromEWKT('SRID=3
 003;LINESTRING(-0.3 0.4,-0.3 0.7,-0.2 0.7)'));

 NOTICE:  ST_AddEdgeNewFaces: edge 33 splitted face 0

 ERROR:  Edge 28 has face 0 registered on the side of this face, while edge
 30 ha
 s face 7 on the same side

 CONTEXT: SQL statement "SELECT topology.AddFace(atopology, rec.geom,
 true)"
 funzione PL/pgSQL "st_addedgenewfaces" linea 594 a istruzione SQL

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1383>
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