py-gdalogr-cookbook
py-gdalogr-cookbook copied to clipboard
Use GetEnvelope() in Calculate Zonal Statistics
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.
You are right. Though the recipe is kind of outdated anyway. Meanwhile Rasterstats showed up and is way better in calculating Zonal Statistics.
Thank you for this suggestion, it seems to be a really powerful solution.