def bbox(self):
"""
If the Location is a Circle, Rectangle, Polygon, or MultiPolygon,
returns the smallest rectangle that encompasses the Location's
geometry. Otherwise returns None.
"""
if self.shape is 'Circle':
return shapes.convert_circle_to_rectangle(self.geom, self.buffer_m)
elif self.shape is'Rectangle':
return self.geom
elif self.shape is 'Polygon' or self.shape is 'MultiPolygon':
return self.geom.envelope
else:
return None
评论列表
文章目录