shapegraph.py 文件源码

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

项目:s2g 作者: caesar0301 项目源码 文件源码
def validate_intersection(self, line_index, point):
        """
        Validate the intersection between given line and point.
        A spatial tolerance is considered to confirm the validation.
        :param line_index: index of specific line
        :param point: validated point
        :return: coordinates of intersected point on line, otherwise None
        """
        line = self.geoms[line_index]
        coords = list(line.coords)
        buffered_point = Point(point).buffer(self.point_buffer)
        touched = None
        if line.intersects(buffered_point):
            cut = point_projects_to_line(point, line)
            touched = coords[cut]
            self._update_cut(line_index, cut)
        return touched
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号