Skip to content

Instantly share code, notes, and snippets.

View czpython's full-sized avatar

Paulo Alvarado czpython

View GitHub Profile
@czpython
czpython / center_geo.py
Last active February 7, 2018 01:57 — forked from amites/center_geo.py
calculate center coordinate from a list of latitude, longitude pairs
# -*- coding: utf-8 -*-
import math
def center_geolocation(geolocations):
"""
Provide a relatively accurate center lat, lon returned as a list pair, given
a list of list pairs.
ex: in: geolocations = ((lat1,lon1), (lat2,lon2),)
out: (center_lat, center_lon)