예제 #1
0
파일: stats.py 프로젝트: wdm0006/pygeohash
def southern(geohashes):
    """
    Takes in an iterable of geohashes and returns the southernmost position of the group as a geohash.

    :param geohashes:
    :return:
    """

    latlons = [decode(x) for x in geohashes]
    latlons = sorted(latlons, key=lambda x: x[0], reverse=False)
    return encode(latlons[0][0], latlons[0][1])
예제 #2
0
파일: stats.py 프로젝트: wdm0006/pygeohash
def mean(geohashes):
    """
    Takes in an iterable of geohashes and returns the mean position of the group as a geohash.

    :param geohashes:
    :return:
    """

    latlons = [decode(x) for x in geohashes]
    count = len(latlons)
    return encode(float(sum([x[0] for x in latlons])) / count, float(sum([x[1] for x in latlons])) / count)
def southern(geohashes):
    """
    Takes in an iterable of geohashes and returns the southernmost position of the group as a geohash.

    :param geohashes:
    :return:
    """

    latlons = [decode(x) for x in geohashes]
    latlons = sorted(latlons, key=lambda x: x[0], reverse=False)
    return encode(latlons[0][0], latlons[0][1])
def mean(geohashes):
    """
    Takes in an iterable of geohashes and returns the mean position of the group as a geohash.

    :param geohashes:
    :return:
    """

    latlons = [decode(x) for x in geohashes]
    count = len(latlons)
    return encode(float(sum([x[0] for x in latlons])) / count, float(sum([x[1] for x in latlons])) / count)
예제 #5
0
"""