[postgis-devel] GeomUnion speedups

strk at refractions.net strk at refractions.net
Sat Jun 25 03:19:09 PDT 2005


Just a test report for 50 MultiPolyhgon inputs:

------------------------------------------------------------------------
50 MultiPolygons test:
------------------------------------------------------------------------

        Classic geomunion, Martin JTS patches (geos-head)
                real    3m54.009s
                user    3m45.522s
                sys     0m1.489s

        Buffer(0) geomunion (geos-head)
                real    1m30.912s
                user    1m27.606s
                sys     0m0.555s

------------------------------------------------------------------------

The "Classic geomunion" is already much faster due to patches
ported from JTS.

The "Buffer(0) geomunion" is implemented by a modification of
unite_garray() postgis function.

--strk;

On Sat, Jun 25, 2005 at 12:15:36PM +0200, strk at refractions.net wrote:
> A summary of my recent works in GeomUnion speedup.
> 
> Martin Davis suggested me that a buffer(0) of a collection
> of input geometries has the same result then an incremental
> union of them.
> 
> I tested this and we *really* get a big performance
> improvement this way, as graphs for geometry components
> are built only once!
> 
> You can test this easily using buffer(collect(the_geom), 0)
> in place of geomunion(the_geom).
> 
> If there are no drawbacks in this I'd have geomunion directly
> do this for us. The drawback I immediately see is that
> while geomunion does not accept GEOMETRYCOLLECTION in input
> this method does allow them. Should we see this a bug ? (we
> can perform the check from within GeomUnion to avoid this).
> 
> Martin, are there other drawbacks ?
> 
> About memory we might implement a chunk-based incremental
> approach whereas blocks of geometries (defined by memory
> size maybe ?) would be buffer(0)'d to early dissolve 
> vertexes and reduce memory occupation. Thoughts on this ?
> 
> --strk;
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list