pcjericks / py-gdalogr-cookbook

A cookbook full of recipes for using the Python GDAL/OGR bindings.
http://pcjericks.github.io/py-gdalogr-cookbook/index.html
MIT License
270 stars 95 forks source link

Use GetEnvelope() in Calculate Zonal Statistics #150

Open Ariki opened 10 years ago

Ariki commented 10 years ago

Although the code in zonal_stats() is a good example of reading geometries, I believe using GetEnvelope() is a simpler way to get feature extent.

ustroetz commented 10 years ago

You are right. Though the recipe is kind of outdated anyway. Meanwhile Rasterstats showed up and is way better in calculating Zonal Statistics.

Ariki commented 10 years ago

Thank you for this suggestion, it seems to be a really powerful solution.