Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def metatilecoord(self, n=8):
return TileCoord(self.z, n * (self.x // n), n * (self.y // n), n)
def ziter(self, z):
"""Generates every TileCoord in self at level z"""
if z in self.bounds:
xbounds, ybounds = self.bounds[z]
for x in xbounds:
for y in ybounds:
yield TileCoord(z, x, y)
def __iter__(self):
"""Yield each TileCoord"""
for i in range(0, self.n):
for j in range(0, self.n):
yield TileCoord(self.z, self.x + i, self.y + j)
def metatilecoords(self, n=8):
for z in sorted(self.bounds.keys()):
xbounds, ybounds = self.bounds[z]
metatilecoord = TileCoord(z, xbounds.start, ybounds.start).metatilecoord(n)
x = metatilecoord.x
while x < xbounds.stop:
y = metatilecoord.y
while y < ybounds.stop:
yield TileCoord(z, x, y, n)
y += n
x += n
def metatilecoords(self, n=8):
for z in sorted(self.bounds.keys()):
xbounds, ybounds = self.bounds[z]
metatilecoord = TileCoord(z, xbounds.start, ybounds.start).metatilecoord(n)
x = metatilecoord.x
while x < xbounds.stop:
y = metatilecoord.y
while y < ybounds.stop:
yield TileCoord(z, x, y, n)
y += n
x += n