[postgis-devel] More work on Cascade Union

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Thu Aug 21 02:22:40 PDT 2008


Obe, Regina wrote:
> 
> It just occurred to me.  Someone correct me if I am wrong, but even if 
> we were to port Cascaded Union to GEOS there is no way that PostGIS can 
> take advantage of it without having it push the whole array to GEOS 
> since the Cascaded Union needs to be able to see the full geometry array 
> set coming to it before hand in order to intelligently bunch the set 
> rather than being fed peacemeal as it currently is now.  So until we do 
> that fundamental step - seems Cascaded Union in GEOS would be pretty 
> useless to PostGIS.
> 
> Thanks,
> Regina


Hi Regina,

I can see the way you're thinking, but I don't think it's quite right. 
If you are trying to union 1 million polygons, whether you do that as 
1,000 batches of 1,000 polygons (cascaded initial run) or as 1,000,000 
polygons straight away (currently), then you are still required to 
convert all 1,000,000 geometries to GEOS. Since the accumulation 
functions store the complete array in memory before passing to GEOS 
anyway (see unite_garray), I don't see that there would be much 
difference in this.

The interesting aspect of the problem, as you rightly point out, is to 
reduce the number of conversions to the minimum number required. Perhaps 
it may make more sense to do more work in LWGEOM format first before 
passing to GEOS? But it's difficult to know without a working 
implementation. I'm sure it would be possible to come up with something 
completely within PostGIS as it stands, but I think it would make more 
sense to add the functionality to GEOS and work on minimising the 
conversions/adding caching to improve overall GEOS performance.


ATB,

Mark.

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063



More information about the postgis-devel mailing list