Opened 17 years ago
Closed 17 years ago
#10368 closed (fixed)
Add expand_to_include method to gdal Envelope
| Reported by: | psmith | Owned by: | nobody |
|---|---|---|---|
| Component: | GIS | Version: | 1.0 |
| Severity: | Keywords: | envelope extent expand_to_include | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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[0]) >>> for pt in pt_list[1:]: ... e.expand_to_include(pt)
or
>>> e = Envelope(geom_list[0].extent) >>> for g in geom_list[1:]: ... e.expand_to_include(g.extent)
Attachments (1)
Change History (2)
by , 17 years ago
| Attachment: | gis_envelope_expand.diff added |
|---|
comment:1 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
(In [9985]) Maintenance refactor of the GDAL (OGR) ctypes interface. Changes include:
- All C API method explictly called from their prototype module, no longer imported via *.
- Applied DRY to C pointer management, classes that do so subclass from
GDALBase. OGRGeometry: Addedfrom_bboxclass method (patch from Christopher Schmidt) andkmlproperty.SpatialReference: Now initialize withSetFromUserInput(initialization is now more simple and flexible); removed duplicate methods.Envelope: Addedexpand_to_includemethod and now allow same coordinates for lower left and upper right points. Thanks to Paul Smith for tickets and patches.OGRGeomType: Now treat OGC 'Geometry' type as 'Unknown'.
Note:
See TracTickets
for help on using tickets.
Patch to add expand_to_include to Envelope (with unit tests)