[postgis-users] Problem with ST_SymDifference function

Kolios N. n.kolios at gmail.com
Mon Aug 3 01:57:44 PDT 2009


Hi all,

I am using an ST_SymDifference query in order to visualize changes
between two polygon tables.

The result, however does not look correct. It includes the entire
geometries of both tables rather than the portions that do not
intersect.

My query is the following:

CREATE TABLE bu_delta as
SELECT
ST_SymDifference(t.the_geom, b.the_geom) AS difference_geom
FROM
bu_benchmark AS b,
bu_test AS t
WHERE ST_Intersects(t.the_geom, b.the_geom);

(and then add gid)

Has anyone ever done something similar?
Thanks in advance,
Nikos


PS1: The geometries of my tables are such that one feature from one
layer intersects with multiple features from the other layer.
PS2: When I run this query for one isolated polygon from each table the
result is OK.
PS3: I also tried the ST_Difference function with no success.

A picture might help:
http://www.nabble.com/attachment/24716126/0/example_difference.TIF



More information about the postgis-users mailing list