[postgis-users] ST_Union (8.4) and TopologyException
lr at pcorp.us
Sun Aug 9 22:42:37 PDT 2009
This is a little troubling.
Regardless of if you are using the faster cascade approach, all the geometry
aggs should be using the faster accumulation approach.
The ST_Union you are now using is the ST_Union(geometry) instead of the
How does replacing
Also did you get a chance to do just the timing on the ST_Union part?
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Simon
Sent: Sunday, August 09, 2009 7:31 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] ST_Union (8.4) and TopologyException
Paul and Regina,
> The "high speed" union can only kick in when run against collections
> consisting entirely of polygons.
So I have to use ST_Accum as in:
create table simon.si_result
select i.si_grouping_f_id, ST_Difference(s.geom,i.geom) as geom
from simon.si_grouping_f s
(select si_grouping_f_id, ST_Union(ST_Accum(a.geom)) as geom
from simon.si_grouping_f_store_f a
where geom is not null
group by si_grouping_f_id
) as i
on (s.id = i.si_grouping_f_id);
Result: Query returned successfully with no result in 3056063 ms.
That is just over 50 minutes which is about twice as fast as without. Not
Recasting it the way Regina wanted:
> So I would write your below as
> create table simon.si_result
> WITH i AS
> (select si_grouping_f_id, ST_Union(a.geom) as geom
> from simon.si_grouping_f_store_f a
> where geom is not null
> group by si_grouping_f_id
> select i.si_grouping_f_id, ST_Difference(s.geom,i.geom) as geom
> from simon.si_grouping_f s
> inner join i
> on (s.id = i.si_grouping_f_id);
Ran slowly until I put ST_Accum() in the ST_Union.
> (select si_grouping_f_id, ST_Union(ST_Accum(a.geom)) as geom
The result was it processed in 3538468ms or 59mins.
SpatialDB Advice and Design, Solutions Architecture and Programming, Oracle
Database 10g Administrator Certified Associate; Oracle Database 10g SQL
Certified Professional Oracle Spatial, SQL Server, PostGIS, MySQL, ArcSDE,
Manifold GIS, FME, Radius Topology and Studio Specialist.
39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia.
Email: simon at spatialdbadvisor.com
Voice: +61 362 396397
Mobile: +61 418 396391
Longitude: 147.20515 (147° 12' 18" E)
Latitude: -43.01530 (43° 00' 55" S)
postgis-users mailing list
postgis-users at postgis.refractions.net
More information about the postgis-users