extract_utility.py 文件源码

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

项目:geo-hpc 作者: itpir 项目源码 文件源码
def limit_geom_chars(geom, limit=8000000, step=0.0001):
    """Limit chars in geom geojson string by simplification

    Default limit for character count is 8000000
        (8MB - MongoDB max document size is 16MB)
    Default step for simplication is 0.0001
    """
    geom = shape(geom)
    curr_geom = geom
    ix = 0
    while len(str(curr_geom)) > limit:
        ix = ix + 1
        curr_geom = geom.simplify(step * ix)

    simplify_tolerance = step * ix
    return curr_geom.__geo_interface__, simplify_tolerance
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号