[postgis-users] PostGIS let me remove an edge shared by a topogeometry

Jose Carlos Martinez Llario jomarlla at cgf.upv.es
Tue Apr 10 12:50:05 PDT 2012


Dear List,
Dont know why PostGIS let me remove an edge which is needed by a 
topogeometry (see point c) )
This is a bug or it is the expected behavior?
Thanks in advance,
Jose


a) Layer t3.parcelas with 3 polygons:

SELECT CreateTopology('t3', 0, 0.1);

create table t3.parcelas (gid serial primary key, codigo varchar);
select addtopogeometrycolumn ('t3','t3','parcelas','topogeom','POLYGON');
INSERT INTO t3.parcelas (codigo, topogeom) VALUES ('A',  totopogeom 
('MULTIPOLYGON(((0 0, 100 0, 100 100, 0 100, 0 0)))'::geometry, 't3', 1, 
0.1));
INSERT INTO t3.parcelas (codigo, topogeom) VALUES ('B',  totopogeom 
('MULTIPOLYGON(((100 0, 200 0, 200 100, 100 100, 100 0)))'::geometry, 
't3', 1, 0.1));
INSERT INTO t3.parcelas (codigo, topogeom) VALUES ('C',  totopogeom 
('MULTIPOLYGON(((200 0, 300 0, 300 100, 200 100, 200 0)))'::geometry, 
't3', 1, 0.1));

b) when I try to remove an edge which is needed by a topogeometry 
PostGIS throws an error which is ok.
s6=# select ST_RemEdgeModFace ('t3', 2);
NOTICE:  Updating next_{right,left}_face of ring edges...
NOTICE:  Deletion of edge 2 joins faces 1 and 2
ERROR:  TopoGeom 1 in layer 1 (t3.parcelas.topogeom) cannot be 
represented healing faces 2 and 1

b) when I try to remove an edge which is needed by a topogeometry but 
one of the side is the universal polygon (id 0) PostGIS does not throw 
an error:

s6=# select ST_RemEdgeModFace ('t3', 6);
NOTICE:  Updating next_{right,left}_face of ring edges...
NOTICE:  Deletion of edge 6 joins faces 2 and 0
  st_remedgemodface
-------------------
                  0

c) The topogeometry is an multiopolygon empty
s6=# select st_astext(topogeom::geometry) from t3.parcelas where gid = 2;
      st_astext
--------------------
  MULTIPOLYGON EMPTY





More information about the postgis-users mailing list