<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [postgis-devel] Lame attempt at cascade union in sql</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=2>I think its C++.  But I still have a couple of tricks up my sleeve.  Anyrate eventually you are right it should be<BR>
in GEOS.  Just don't have the c++ skills to port JTS to GEOS yet.  So this is just a stopgap measure.  As a side note- a completely pure<BR>
PostgreSQL solution would mean people don't need to upgrade to the latest GEOS to get the benefits.<BR>
<BR>
-----Original Message-----<BR>
From: postgis-devel-bounces@postgis.refractions.net on behalf of Kevin Neufeld<BR>
Sent: Fri 8/8/2008 1:22 AM<BR>
To: PostGIS Development Discussion<BR>
Subject: Re: [postgis-devel] Lame attempt at cascade union in sql<BR>
<BR>
Hmmm.  Still, I give you an applause for the speed an simplicity of your<BR>
attempt.  Even my crazy looking GROUPBY/ORDERBY query that runs in 1min<BR>
is still 3 times slower than Martin Davis's Java code in JTS.  Ideally,<BR>
it would be best for someone to put the thing through GEOS so PostGIS<BR>
can benefit from it as well.  Anyone feel like brushing up on their C?  :)<BR>
<BR>
-- Kevin<BR>
<BR>
Obe, Regina wrote:<BR>
><BR>
> Curiosity got the better of me this time so I ran thru the full set<BR>
> once and got this.  So still better, but I guess there is still room<BR>
> for improvement and my cascading seems to not be growing linearly as<BR>
> Kevin's is.<BR>
><BR>
> --277,656 ms = 4.6276 minutes<BR>
> SELECT ST_CascadeUnion(the_geom)<BR>
> FROM (SELECT * FROM sample_poly) As foo;<BR>
><BR>
> --69,953 ms = 1.16 minutes<BR>
> SELECT ST_Union(the_geom) AS the_geom<BR>
> FROM (<BR>
>    SELECT min(id) AS id, ST_Union(the_geom) AS the_geom<BR>
>    FROM (<BR>
>      SELECT min(id) AS id, ST_Union(the_geom) AS the_geom<BR>
>      FROM (<BR>
>        SELECT min(id) AS id, ST_Union(the_geom) AS the_geom<BR>
>        FROM (<BR>
>          SELECT min(id) AS id, ST_Union(the_geom) AS the_geom<BR>
>          FROM (SELECT * FROM sample_poly) As foo<BR>
>          GROUP BY round(id/10)<BR>
>          ORDER BY id) AS tmp1<BR>
>        GROUP BY round(id/100)<BR>
>        ORDER BY id) AS tmp2<BR>
>      GROUP BY round(id/1000)<BR>
>      ORDER BY id) AS tmp3<BR>
>    GROUP BY round(id/10000)<BR>
>    ORDER BY id) AS tmp4<BR>
> GROUP BY round(id/100000);<BR>
><BR>
_______________________________________________<BR>
postgis-devel mailing list<BR>
postgis-devel@postgis.refractions.net<BR>
<A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>
<HTML><BODY><P><hr size=1></P>
<P><STRONG>
The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer.
</STRONG></P></BODY></HTML>

<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>