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
simplify_sub.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录