mappingfunctions.py 文件源码

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

项目:sfparks 作者: cvlong 项目源码 文件源码
def find_close_parks(origin, time, routing, parks):
    """Create a dictionary with park objects corresponding to a distance radius heuristic.

    Use Vincenty's solution to the inverse geodetic problem to find straight-line
    distance from the origin to each park location and determine whether the
    distance is within the bounding box heuristic.
    """

    close_parks = {}

    for park in parks:
        dist = vincenty((origin.latitude, origin.longitude),
                        (park.latitude, park.longitude)).miles
        if dist < find_appx_dist(time, routing):
            # close_parks[park.name] = park
            close_parks[(dist, park.name)] = park

    return close_parks
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号