import math


def convertWGS84ToGoogleBing( geopt ):
  """
    This is taken from here: https://alastaira.wordpress.com/2011/01/23/the-google-maps-bing-maps-spherical-mercator-projection/

    We use it to convert between co-ordinate systems, so we can use the x, y system ( planar projection ), to compute centroids.
  """
  lat, lon = geopt.latitude, geopt.longitude
  x = lon * 20037508.34 / 180 
  y = math.log(math.tan((90 + lat) * math.pi / 360)) / (math.pi / 180)
  y = y * 20037508.34 / 180
  return [ x, y ]