[Qgis-developer] Why polygons created with "Avoid intersections" over lap their neighbors in Postgis?

Giovanni Manghi giovanni.manghi at faunalia.pt
Tue Aug 6 09:47:32 PDT 2013


Hi,

I can confirm this serious issue, see

http://hub.qgis.org/issues/8174


> Dear Paolo,
>
> I just notice this behavior a few days ago. Right now I can reproduce this
> problem:
> Using Qgis to draw polygons on a clean Postgis layer with "Avoid
> Intersections" turned on and check every time I create a new polygon, this
> is the number of polygons until an over-lap is detected: 4, 7, 6, 15, 7
>
> My postgis layer creation sql:
> CREATE TABLE polygon_layer
> (
>   id serial primary key,
>   geom geometry(MultiPolygon,3857),
> );
> CREATE INDEX polygon_layer_idx
>   ON polygon_layer
>   USING gist
>   (geom);
>
> Over lap detecting sql:
> select a.id, b.id
> from
>     polygon_layer as a
>     inner join
>     polygon_layer as b
>     on st_overlaps(a.geom, b.geom)
> where a.id < b.id;
>
> My system versions:
>     Client: Qgis 1.8 on Debian 7 64 bit
>     Server: Postgis 2.0 on PosgreSQL 9.2, Ubuntu 12.04 64 bit
>
> Thanks.
>
>
> 2013/6/26 Paolo Cavallini <cavallini at faunalia.it>
>
>> Il 26/06/2013 05:04, Cao Minh Tu ha scritto:
>>
>> > My question is: Is there an easier way to make Qgis "Avoid
>> intersections" plays well
>> > with Postgis "st_overlaps" so I can avoid the other dreaded way?
>>
>> Dear Cao,
>> I did not notice this problem for PostGIS layers. Could you please be more
>> specific
>> (which version of qgis? when exactly do you encounter this issue?). If
>> confirmed,
>> better solve it upstream, in qgis code, than fix it with ad hoc solutions
>> (pg triggers).


More information about the Qgis-developer mailing list