models.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:cyphon 作者: dunbarcyber 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号