shapegraph.py 文件源码

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

项目:s2g 作者: caesar0301 项目源码 文件源码
def _register_node(self, p):
        if isinstance(p, Point):
            p = list(p.coords)[0]
        elif isinstance(p, tuple):
            pass
        else:
            raise TypeError('The point should be shapely::Point or a 2-tuple')

        if p not in self.node_ids:
            nid = self.nodes_counter
            self.node_ids[p] = nid
            self.node_xy[nid] = p
            self.nodes_counter += 1

        return self.node_ids[p]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号