From 5d293a866d77a3e5b4d6227e22f3340a5f87b26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Mon, 20 Nov 2017 17:45:10 +0100 Subject: [PATCH] fix min/max x/y in GeometryIndexed.__getitem__ --- src/c3nav/mapdata/utils/cache/indexed.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/c3nav/mapdata/utils/cache/indexed.py b/src/c3nav/mapdata/utils/cache/indexed.py index 17fde34a..b528b331 100644 --- a/src/c3nav/mapdata/utils/cache/indexed.py +++ b/src/c3nav/mapdata/utils/cache/indexed.py @@ -151,10 +151,10 @@ class GeometryIndexed: maxy = int(math.ceil(yy.stop / self.resolution)) height, width = self.data.shape - minx = min(self.x, minx) - self.x - miny = min(self.y, miny) - self.x - maxx = max(self.x + width, maxx) - self.y - maxy = max(self.y + height, maxy) - self.y + minx = max(self.x, min(self.x + width, minx)) - self.x + miny = max(self.y, min(self.y + height, miny)) - self.y + maxx = max(self.x, min(self.x + width, maxx)) - self.x + maxy = max(self.y, min(self.y + height, maxy)) - self.y return self.data[miny:maxy, minx:maxx].flatten()