Skip to content

Commit 977c0bc

Browse files
committed
Updated Feature.bounds() to aggregate over all geo attributes.
1 parent 1706798 commit 977c0bc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

geoscript/feature/feature.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,13 @@ def setgeom(self, g):
9696
"""
9797

9898
def getbounds(self):
99-
if self.geom:
100-
return geom.Bounds(prj=self.schema.proj, env=self.geom.getEnvelopeInternal())
99+
bounds = geom.Bounds()
100+
for val in self._feature.getAttributes():
101+
if val is not None and isinstance(val, geom.Geometry):
102+
bounds.expand(val.envelopeInternal)
103+
104+
if not bounds.isNull():
105+
return bounds
101106

102107
bounds = property(getbounds)
103108
"""

0 commit comments

Comments
 (0)