shapes.py 文件源码

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

项目:cyphon 作者: dunbarcyber 项目源码 文件源码
def convert_to_point(location, location_format):
    """
    Takes a dict, tuple, or list of coordinates and converts them to a
    Point.
    """
    if isinstance(location, Point):
        return location
    try:
        if (isinstance(location, dict) and
                'lat' in location and 'lon' in location):
            return Point(location['lon'], location['lat'])
        if location_format.lower().startswith('lat'):
            location = reverse_coordinate_order(location)
        return Point(location)
    except Exception as error:
        LOGGER.error('There was an error processing the location %s: %s',
                     location, error)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号