Add expand_to_include method to gdal Envelope
|Reported by:||psmith||Owned by:||nobody|
|Severity:||Keywords:||envelope extent expand_to_include|
|Has patch:||yes||Needs documentation:|
|Needs tests:||Patch needs improvement:|
Mapnik has an Envelope class like that in django.contrib.gis.gdal.envelope that has an expand_to_include method we should steal. This is handy for building up an envelope by iterating over a collection of geometries -- at the end you have the extent / envelope of the collection.
>>> e = Envelope(pt_list) >>> for pt in pt_list[1:]: ... e.expand_to_include(pt)
>>> e = Envelope(geom_list.extent) >>> for g in geom_list[1:]: ... e.expand_to_include(g.extent)