Armin,<br><br>I don't know if it works on geometry collection but it certainly works on a MultiPolygon. In return, you will get either a Polygon or a MultiPolygon depending on the union being connected or not.<br><br><div class="gmail_quote">
On Thu, Mar 17, 2011 at 5:51 PM, Armin Burger <span dir="ltr"><<a href="mailto:armin.burger@gmx.net">armin.burger@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Chaitanya<br>
<br>
I can understand how the UnionCascade works in PostDIS since it's an aggregate function. I just don't understand how I should use it in OGR. The documentation has a single line<br>
UnionCascaded(self) -> Geometry<br>
<br>
So it returns a geometry from another geometry, but I would need a returned geometry from a *list* of input geometries, not from a single one. So I don't have a clue if this is possible in OGR.<br>
<br>
Another option could be the "Collect" function, but this seems to be only implemented in the C libraries, not in the Python bindings. Looks like geometry collections are not available in OGR for Python at all.<br>
<br>
Armin<br>
<br>
<br>
-------- Original-Nachricht --------<br>
> Datum: Thu, 17 Mar 2011 10:16:06 +0530<br>
<div class="im">> Von: Chaitanya kumar CH <<a href="http://chaitanya.ch" target="_blank">chaitanya.ch</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>><br>
</div>> An: Armin Burger <<a href="mailto:armin.burger@gmx.net">armin.burger@gmx.net</a>><br>
> CC: <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>, <a href="mailto:mariusjigmond@hotmail.com">mariusjigmond@hotmail.com</a><br>
<div class="im">> Betreff: Re: [gdal-dev] Calculate footprints of shapefiles<br>
<br>
> Armin,<br>
><br>
</div><div class="im">> Cascaded Union works pretty much like Union except that it is optimized to<br>
> work on more than two geometries.<br>
> Both OGR and PostGIS uses the GEOS library to perform this.<br>
><br>
> Read this blog entry by Paul Ramsey:<br>
> <a href="http://blog.cleverelephant.ca/2009/01/must-faster-unions-in-postgis-14.html" target="_blank">http://blog.cleverelephant.ca/2009/01/must-faster-unions-in-postgis-14.html</a><br>
><br>
> On Wed, Mar 16, 2011 at 3:41 PM, Armin Burger <<a href="mailto:armin.burger@gmx.net">armin.burger@gmx.net</a>><br>
> wrote:<br>
><br>
> > Chaitanya<br>
> ><br>
> > thanks for the hints. So a sort of Union operation seems to be<br>
> necessary. I<br>
> > need to check how fast that is with OGR on larger shapefiles (I want to<br>
> > store in PostGIS just the footprint, not the full geometry collection).<br>
> The<br>
> > ConvexHull could be a good alternative to a simplified boundary.<br>
> ><br>
> > I understand how the normal Union() works, it merges 2 geometries into a<br>
> > new one. But I don't get it what UnionCascade() is doing. It applies a<br>
> Union<br>
> > on a single geometry and returns the new geometry, what is it actually<br>
> > unioning/merging then?<br>
> ><br>
> > Regards,<br>
> > Armin<br>
<br>
--<br>
</div><div><div></div><div class="h5">GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit<br>
gratis Handy-Flat! <a href="http://portal.gmx.net/de/go/dsl" target="_blank">http://portal.gmx.net/de/go/dsl</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>/tʃaɪθənjə/ /kʊmɑr/ <br>+91-9494447584<br>17.2416N 80.1426E<br>