MCPcopy
hub / github.com/thampiman/reverse-geocoder / query

Method query

reverse_geocoder/__init__.py:118–128  ·  view source on GitHub ↗

Function to query the K-D tree to find the nearest city Args: coordinates (list): List of tuple coordinates, i.e. [(latitude, longitude)]

(self, coordinates)

Source from the content-addressed store, hash-verified

116 self.tree = KDTree_MP.cKDTree_MP(coordinates)
117
118 def query(self, coordinates):
119 """
120 Function to query the K-D tree to find the nearest city
121 Args:
122 coordinates (list): List of tuple coordinates, i.e. [(latitude, longitude)]
123 """
124 if self.mode == 1:
125 _, indices = self.tree.query(coordinates, k=1)
126 else:
127 _, indices = self.tree.pquery(coordinates, k=1)
128 return [self.locations[index] for index in indices]
129
130 def load(self, stream):
131 """

Callers 3

getFunction · 0.95
searchFunction · 0.95
_pqueryFunction · 0.80

Calls 1

pqueryMethod · 0.80

Tested by

no test coverage detected