fix error when identifying coordinates
This commit is contained in:
parent
33ae8e4d37
commit
10e331bf43
1 changed files with 5 additions and 5 deletions
|
@ -387,11 +387,11 @@ class GraphLevel():
|
||||||
def nearest_point(self, point, mode):
|
def nearest_point(self, point, mode):
|
||||||
cache_key = ('c3nav__routing__nearest_point__%s__%s__%.2f_%.2f__%s' %
|
cache_key = ('c3nav__routing__nearest_point__%s__%s__%.2f_%.2f__%s' %
|
||||||
(self.graph.mtime, self.level.name, point[0], point[1], mode))
|
(self.graph.mtime, self.level.name, point[0], point[1], mode))
|
||||||
point = cache.get(cache_key, None)
|
nearest_point = cache.get(cache_key, None)
|
||||||
if point is None:
|
if nearest_point is None:
|
||||||
point = self._nearest_point(point, mode)
|
nearest_point = self._nearest_point(point, mode)
|
||||||
cache.set(cache_key, point, 60)
|
cache.set(cache_key, nearest_point, 60)
|
||||||
return self.graph.points[point]
|
return self.graph.points[nearest_point]
|
||||||
|
|
||||||
def _nearest_point(self, point, mode):
|
def _nearest_point(self, point, mode):
|
||||||
points = self.connected_points(point, mode)
|
points = self.connected_points(point, mode)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue