models.py 文件源码

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

项目:cyphon 作者: dunbarcyber 项目源码 文件源码
def shape(self):
        """
        Returns a string indicating the feature type. If the feature type is not
        a Point, Polygon, or Multipolygon, returns 'Other'.
        """
        if isinstance(self.geom, Point):
            if self.has_buffer():
                return 'Circle'
            else:
                return 'Point'

        elif isinstance(self.geom, Polygon):
            if shapes.is_rectangle(self.geom.exterior_ring):
                return 'Rectangle'
            else:
                return 'Polygon'

        elif isinstance(self.geom, MultiPolygon):
            return 'MultiPolygon'

        else:
            return 'Other'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号