<!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] More work on Cascade Union</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>>It's annoying that there's so much overhead in all the marshalling that<BR>
> goes on between Postgres, PostGIS, and GEOS.  Points are the worst case<BR>
> for this, since they have so much overhead relative to their size.  I'm<BR>
> not sure what the best approach is to mitigate this.  One option might<BR>
> be to do more point operations directly in PostGIS, since they tend to<BR>
> be fairly simple compared to more complex geoms.  But this starts<BR>
> getting into a lot of code to be developed...<BR>
<BR>
Perhaps its just my ineptness at understanding C-code and more specifically how all these pieces fit together, but regarding the marshalling seems in the unite_garray<BR>
there is a lot of wasted time<BR>
<BR>
1) pull a geometry out of PG_LWGEOM<BR>
2) convert pulled geometry to PostGIS2GEOS<BR>
3) Union with our GEOS result<BR>
4) copy our new GEOS result to g2<BR>
5) destroy our old result<BR>
6) rebuild new result  by taking g2 and unioning with next PostGIS2GEOS<BR>
<BR>
---<BR>
<BR>
Would seem much more efficient to just marshall the whole array to some sort of GEOS array or Geometrycollection<BR>
do our busy work with the GEOS array/collection all in GEOS land<BR>
then return back a GEOS result which we then convert to GEOS2POSTGIS.<BR>
Looking at the JTS code - it seems to be doing that - working against the full set of lines and points in a collection rather than this busy back and forth stuff.  I see GEOS code that seems to do that too (work with a collection)<BR>
<BR>
Thanks,<BR>
Regina<BR>
<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>