[postgis-devel] [PostGIS] #781: topology: wrong result when add an edge intersecting a face.

PostGIS trac at osgeo.org
Mon Jan 17 13:57:30 PST 2011


#781: topology: wrong result when add an edge intersecting a face.
-----------------------+----------------------------------------------------
 Reporter:  aperi2007  |       Owner:  pramsey      
     Type:  defect     |      Status:  new          
 Priority:  medium     |   Milestone:  PostGIS 2.0.0
Component:  postgis    |     Version:  trunk        
 Keywords:             |  
-----------------------+----------------------------------------------------
 I try this code:
 ----
 DROP SCHEMA IF EXISTS schema_out CASCADE;
 CREATE SCHEMA schema_out AUTHORIZATION dbtopowrite;
 --
 DROP TABLE IF EXISTS SCHEMA_OUT.TEST;
 CREATE TABLE SCHEMA_OUT.TEST(ID INTEGER PRIMARY KEY, CODICE TEXT);
 SELECT topology.DropTopology('schema_topo');
 SELECT topology.CreateTopology('schema_topo',3003, 0.00005);
 SELECT topology.AddTopoGeometryColumn('schema_topo', 'schema_out', 'test',
 'topo_line', 'LINE');
 --
 select
 topology.AddEdge('schema_topo',ST_GeomFromEWKT('SRID=3003;LINESTRING(1 4,
 4 4)'));
 select
 topology.AddEdge('schema_topo',ST_GeomFromEWKT('SRID=3003;LINESTRING(1 4,
 4 7)'));
 select
 topology.AddEdge('schema_topo',ST_GeomFromEWKT('SRID=3003;LINESTRING(4 7,
 6 9)'));
 select
 topology.AddEdge('schema_topo',ST_GeomFromEWKT('SRID=3003;LINESTRING(2 2,
 4 4)'));
 select
 topology.AddEdge('schema_topo',ST_GeomFromEWKT('SRID=3003;LINESTRING(4 4,
 5 5, 6 6)'));
 select
 topology.AddEdge('schema_topo',ST_GeomFromEWKT('SRID=3003;LINESTRING(6 6,
 6 9)'));
 select
 topology.AddEdge('schema_topo',ST_GeomFromEWKT('SRID=3003;LINESTRING(6 9,
 10 3)'));
 select
 topology.AddEdge('schema_topo',ST_GeomFromEWKT('SRID=3003;LINESTRING(10 3,
 10 9)'));
 select
 topology.AddEdge('schema_topo',ST_GeomFromEWKT('SRID=3003;LINESTRING(10 9,
 12 1)'));

 -- questo nodo dovrebbe essere un errore perche' viene aggiunto sulla
 intersezione di un edge
 select topology.AddNode('schema_topo',ST_GeomFromEWKT('SRID=3003;POINT(5
 5)'));
 select
 topology.AddFace('schema_topo',ST_GeomFromEWKT('SRID=3003;POLYGON((1 4, 6
 9, 6 6, 5 5, 4 4, 1 4))'));
 --

 I have a face:
 I can see the geometry with this sql:
 select st_astext(topology.st_getfacegeometry('schema_topo',1));

 POLYGON((4 4,1 4,4 7,6 9,6 6,5 5,4 4))

 But is I add another edge intersecting the face:
 select
 topology.AddEdge('schema_topo',ST_GeomFromEWKT('SRID=3003;LINESTRING(4 7,
 4 4)'));

 and after see the geometry of the face:
 I see again:
 POLYGON((4 4,1 4,4 7,6 9,6 6,5 5,4 4))

 I think this is wrong.
 It must be generate an exception or (better) split the face in two faces.

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