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)
评论列表
文章目录