Armin, 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.
On Thu, Mar 17, 2011 at 5:51 PM, Armin Burger <[email protected]> wrote: > Chaitanya > > 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 > UnionCascaded(self) -> Geometry > > 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. > > 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. > > Armin > > > -------- Original-Nachricht -------- > > Datum: Thu, 17 Mar 2011 10:16:06 +0530 > > Von: Chaitanya kumar CH <[email protected]> > > An: Armin Burger <[email protected]> > > CC: [email protected], [email protected] > > Betreff: Re: [gdal-dev] Calculate footprints of shapefiles > > > Armin, > > > > Cascaded Union works pretty much like Union except that it is optimized > to > > work on more than two geometries. > > Both OGR and PostGIS uses the GEOS library to perform this. > > > > Read this blog entry by Paul Ramsey: > > > http://blog.cleverelephant.ca/2009/01/must-faster-unions-in-postgis-14.html > > > > On Wed, Mar 16, 2011 at 3:41 PM, Armin Burger <[email protected]> > > wrote: > > > > > Chaitanya > > > > > > thanks for the hints. So a sort of Union operation seems to be > > necessary. I > > > need to check how fast that is with OGR on larger shapefiles (I want to > > > store in PostGIS just the footprint, not the full geometry collection). > > The > > > ConvexHull could be a good alternative to a simplified boundary. > > > > > > I understand how the normal Union() works, it merges 2 geometries into > a > > > new one. But I don't get it what UnionCascade() is doing. It applies a > > Union > > > on a single geometry and returns the new geometry, what is it actually > > > unioning/merging then? > > > > > > Regards, > > > Armin > > -- > GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit > gratis Handy-Flat! http://portal.gmx.net/de/go/dsl > -- Best regards, Chaitanya kumar CH. /tʃaɪθənjə/ /kʊmɑr/ +91-9494447584 17.2416N 80.1426E
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
