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

Sandro Santilli strk at keybit.net
Wed Apr 11 01:41:55 PDT 2012

On Tue, Apr 10, 2012 at 09:50:05PM +0200, Jose Carlos Martinez Llario wrote:
> 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?

ST_RemEdgeModFace (which you're calling) is required to _modify_
one face to take up the space previously occupied by the faces this
edge was separating.

By convention, when one of the faces is the universal face, the
_other_ face is kept, while if both faces are not universal, the
face on the _right_ is kept and the face on the _left_ is remved.

Now, if you have a TopoGeometry defined by only the face that is
removed you get an exception, while if you have a TopoGeometry
defined by the face that is modified, or by both faces, you get
no exception.

At least this is the current intended behavior.
Not sure if it makes sense.

> 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

Given the above intended behavior this does indedd sound like a bug.

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

I guess the topogeometry is now defined by face 0 ?

Try something like:

 SELECT r.* FROM t3.relation r, t3.parcelas p
 WHERE r.topogeo_id = id(p.topogeom)
   AND r.layer_id = layer_id(p.topogeom)
   AND p.gid = 2;


  |   __/  |    Delivering high quality PostGIS 2.0 !
  |  / 2.0 |    http://strk.keybit.net - http://vizzuality.com

More information about the postgis-users mailing list