simplify_sub.py 文件源码

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

项目:kaggle-dstl-satellite-imagery-feature-detection 作者: u1234x1234 项目源码 文件源码
def func(dat):
    image_id, class_id, sh = dat
    sh = wkt.loads(sh)
#    print(len(sh.wkt))
#    print(len(sh.wkt))
#    if not sh.is_valid:
#    if not isinstance(sh, MultiPolygon):
#        sh = MultiPolygon([sh])
#    sh = clip_poly(sh)
#    if not isinstance(sh, MultiPolygon):
#        sh = MultiPolygon([sh])
#    sh = clip_poly(sh)

    sh = sh.buffer(0.0000000000001)
    sh = sh.simplify(0.00000001, preserve_topology=True)
#    sh = MultiPolygon([x.buffer(0) for x in sh])

#    sh = ops.cascaded_union(sh)
    if not sh.is_valid:
        print(image_id, class_id)
#        qwe
    pol = sh.wkt
#    pol = wkt.dumps(sh, rounding_precision=8)
    return image_id, class_id, pol
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号