[postgis-users] ST_SymDifference

Stephen V. Mather svm at clevelandmetroparks.com
Mon Oct 17 14:02:53 PDT 2011


Hi All,

                True confession, I'm running PostGIS 1.3.5, so throw the
tomatoes gently if A) I'm doing a bad query, or B) I'm dredging up old news
on (in)efficiency, and I really should upgrade to 1.5.x, thank you very
much. .  Admittedly, it is time for that, but hopefully that's a separate
issue.

                I'm trying to calculate the symmetrical difference on a pair
of geometries, and my query runs slowly:

 

     SELECT ST_SymDifference(

                ST_Collect(neww.the_geom),

                ST_Collect(oldd.the_geom) 

           ) AS the_geom

           FROM boundary neww, boundary_old oldd;

 

Now, if I were to be entirely honest, I'd confess that this was my cludge of
an original query:

 

     SELECT ST_SymDifference(

                ST_Union(ST_Buffer(neww.the_geom, 0)),

                ST_Union(ST_Buffer(oldd.the_geom, 0)) 

           ) AS the_geom

           FROM boundary neww, boundary_old oldd;

 

but who would admit to running a query like that, should they know better.
Not I.

 

So, why is my query sooooo slooooow?  Is it A), B), or some yet to be known
to me C).  BTW, (now I'm just to being provocative,) when I run a
symmetrical difference in ArcGIS, it runs very quickly. :).

 

Best,

Thanks,

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

svm at clevelandmetroparks.com
 <http://www.clemetparks.com/> clevelandmetroparks.com

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111017/683e0127/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 3772 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111017/683e0127/attachment.png>


More information about the postgis-users mailing list