Exemple #1
0
def getClosestNode(latLng):
	closest = -1
	closest_dist = 99999.

	for lid in locations.asIds():
		dist = greatCircleDistance(latLng,locations.coordsForLocation(lid))
		if dist < closest_dist:
			closest = lid
			closest_dist = dist
	return closest
Exemple #2
0
 def gcdForLocations(self,lid1,lid2):#distance between two locations
     return greatCircleDistance(self.coordsForLocation(lid1),self.coordsForLocation(lid2))
Exemple #3
0
 def gcdForLocations(self, lid1, lid2):  #distance between two locations
     return greatCircleDistance(self.coordsForLocation(lid1),
                                self.coordsForLocation(lid2))