Armin,<br><br>This can be done in either OGR or PostGIS.<br><br>For OGR, refer to the OGRGeometry class reference, especially the ConvexHull(), Union() and UnionCascaded() functions.<br>For PostGIS, ST_Boundary() and ST_Union().<br>
<br><div class="gmail_quote">On Wed, Mar 16, 2011 at 6:23 AM, 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;">
Marius,<br>
<br>
thanks for the suggestion. I don't know if shapely supports re-projection of geometries or has a simplify algorithm, which I will both need. There could be some other functions of GDAL/OGR that I might need in the future as well. So in principal I'd prefer to stick to GDAL.<br>
<font color="#888888">
<br>
armin</font><div><div></div><div class="h5"><br>
<br>
On 16/03/2011 01:35, Marius Jigmond wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Armin,<br>
<br>
Not sure if this would be straightforward in GDAL but you might want to<br>
consider a combination of GDAL + Shapely<br>
(<a href="http://gispython.org/shapely/docs/1.2/manual.html#cascading-unions" target="_blank">http://gispython.org/shapely/docs/1.2/manual.html#cascading-unions</a>).<br>
What you're trying to do is spatial analysis not directly implemented in<br>
GDAL. Shapely requires that you're working with Cartesian coordinates.<br>
The upside is that it has WKT/WKB support for direct loading into<br>
PostGIS.<br>
<br>
-marius<br>
<br>
On Wed, 2011-03-16 at 01:08 +0100, Armin Burger wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi all<br>
<br>
I would like to catalogue shapefiles scattered over lots of directories<br>
of the file system and store retrievable information of the shapefiles<br>
in a PostGIS layer. Extracting parameters like extent, projection,<br>
fields, etc works very fine with GDAL's Python bindings.<br>
<br>
But I would also like to store a sort of "footprint" of the whole<br>
shapefile as a geometry object since the extent is a bit coarse<br>
geographic representation of the shapefile.<br>
<br>
So far I have no better idea than eg. for polygon shapefiles looping<br>
through all features, applying a Union function on them. And at the end<br>
trying to use the Simplify method on the resulting polygon that will be<br>
used as the footprint.<br>
<br>
This is for sure not very efficient for larger shapefiles with lots of<br>
records. And for line and point shapefiles I still don't have a clue how<br>
their records could be represented by an enclosing polygon (maybe the<br>
Boundary functions does something like this...).<br>
<br>
Any ideas how this footprint generation could be achieved in a feasible<br>
way using GDAL/OGR Python?<br>
<br>
Cheers, Armin<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<br>
</blockquote>
<br>
<br>
</blockquote>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</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>