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

Jose Carlos Martinez jomarlla at cgf.upv.es
Wed Apr 11 01:57:57 PDT 2012


Hi Sandro, thanx for the detailed answer.

The query returns 0 rows:

s6=# 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;
  topogeo_id | layer_id | element_id | element_type
------------+----------+------------+--------------
(0 rows)

s6=# select * from t3.relation ;
  topogeo_id | layer_id | element_id | element_type
------------+----------+------------+--------------
           1 |        1 |          1 |            3
           3 |        1 |          3 |            3

Even though the topogeometry exists:

s6=# select gid,(topogeom).* from t3.parcelas;
  gid | topology_id | layer_id | id | type
-----+-------------+----------+----+------
    1 |          30 |        1 |  1 |    3
    2 |          30 |        1 |  2 |    3
    3 |          30 |        1 |  3 |    3



On 11/04/2012 10:41, Sandro Santilli wrote:
> 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
>> --------------------
>>   MULTIPOLYGON EMPTY
> 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;
>
> --strk;
>
>    ,------o-.
>    |   __/  |    Delivering high quality PostGIS 2.0 !
>    |  / 2.0 |    http://strk.keybit.net - http://vizzuality.com
>    `-o------'
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list