fix min/max x/y in GeometryIndexed.__getitem__
This commit is contained in:
parent
ede7e4dc86
commit
5d293a866d
1 changed files with 4 additions and 4 deletions
8
src/c3nav/mapdata/utils/cache/indexed.py
vendored
8
src/c3nav/mapdata/utils/cache/indexed.py
vendored
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue