'Sourced from:
https://github.com/tejado/pgoapi/blob/master/examples/spiral_poi_search.py
:param starting_lat:
:param starting_lng:
:param step_size:
:param step_limit:
:return:'

@staticmethod
def _generate_spiral(starting_lat, starting_lng, step_size, step_limit):

    coords = [{u'lat': starting_lat, u'lng': starting_lng}]
    (steps, x, y, d, m) = (1, 0, 0, 1, 1)
    rlat = (starting_lat * math.pi)
    latdeg = ((111132.93 - (559.82 * math.cos((2 * rlat)))) + (1.175 * math.cos((4 * rlat))))
    lngdeg = ((111412.84 * math.cos(rlat)) - (93.5 * math.cos((3 * rlat))))
    step_size_lat = (step_size / latdeg)
    step_size_lng = (step_size / lngdeg)
    while (steps < step_limit):
        while ((((2 * x) * d) < m) and (steps < step_limit)):
            x = (x + d)
            steps += 1
            lat = ((x * step_size_lat) + starting_lat)
            lng = ((y * step_size_lng) + starting_lng)
            coords.append({u'lat': lat, u'lng': lng})
        while ((((2 * y) * d) < m) and (steps < step_limit)):
            y = (y + d)
            steps += 1
            lat = ((x * step_size_lat) + starting_lat)
            lng = ((y * step_size_lng) + starting_lng)
            coords.append({u'lat': lat, u'lng': lng})
        d *= (-1)
        m += 1
    return coords
