예제 #1
0
def getGeoData(data):
    if "geo" in data and data["geo"] != None:
        return ("geo", data["geo"]["coordinates"])
    elif "place" in data:
        point = getCenterOfMass(data["place"]["bounding_box"]["coordinates"][0])
        return ("bb", [point[1], point[0]])
def ParseGeoData(data):
    if 'geo' in data and data['geo']!=None: return ('geo', data['geo']['coordinates'])
    elif 'place' in data: 
        point = getCenterOfMass(data['place']['bounding_box']['coordinates'][0])
        return ('bb', [point[1], point[0]])
 def reducer(self, user, occurrences): 
     points = list(occurrences)
     yield user, {'u': user, 'c': len(points), 'cm': list(getCenterOfMass(points)), 'rog': getRadiusOfGyration(points)}
예제 #4
0
def getMeanDistanceBetweenLids(_, llids): 
    meanLid = getCenterOfMass(llids,accuracy=ACCURACY)
    return getMeanDistanceFromSource(meanLid, llids)
예제 #5
0
def getRadius(locations):
    meanLid = getCenterOfMass(locations,accuracy=LATTICE_ACCURACY)
    distances = [getHaversineDistance(meanLid, p) for p in locations]
    _, upperBoundForDistance = getOutliersRangeUsingIRQ(distances)
    return np.mean(filter(lambda d: d<=upperBoundForDistance, distances))