fix error when identifying coordinates

This commit is contained in:
Laura Klünder 2016-12-21 02:41:40 +01:00
parent 33ae8e4d37
commit 10e331bf43

View file

@ -387,11 +387,11 @@ class GraphLevel():
def nearest_point(self, point, mode):
cache_key = ('c3nav__routing__nearest_point__%s__%s__%.2f_%.2f__%s' %
(self.graph.mtime, self.level.name, point[0], point[1], mode))
point = cache.get(cache_key, None)
if point is None:
point = self._nearest_point(point, mode)
cache.set(cache_key, point, 60)
return self.graph.points[point]
nearest_point = cache.get(cache_key, None)
if nearest_point is None:
nearest_point = self._nearest_point(point, mode)
cache.set(cache_key, nearest_point, 60)
return self.graph.points[nearest_point]
def _nearest_point(self, point, mode):
points = self.connected_points(point, mode)