geo_median.py 文件源码

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

项目:chi-2016-localness 作者: joh12041 项目源码 文件源码
def numersum(test_median, data_point):
    """Provides the denominator of the weiszfeld algorithm depending on whether you are adjusting the candidate x or y."""
    try:
        return 1 / vincenty(test_median, data_point).kilometers
    except ZeroDivisionError:
        return 0  # filter points that equal the median out (otherwise no convergence)
    except ValueError:
        # Vincenty doesn't always converge so fall back on great circle distance which is less accurate but always converges
        return 1 / great_circle(test_median, data_point).kilometers
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号