# How to use the tilecloud.__init__.TileCoord function in tilecloud

## To help you get started, we’ve selected a few tilecloud examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

camptocamp / tilecloud / tilecloud / __init__.py View on Github
``````def metatilecoord(self, n=8):
return TileCoord(self.z, n * (self.x // n), n * (self.y // n), n)``````
camptocamp / tilecloud / tilecloud / __init__.py View on Github
``````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)``````
camptocamp / tilecloud / tilecloud / __init__.py View on Github
``````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)``````
camptocamp / tilecloud / tilecloud / __init__.py View on Github
``````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 &lt; xbounds.stop:
y = metatilecoord.y
while y &lt; ybounds.stop:
yield TileCoord(z, x, y, n)
y += n
x += n``````
camptocamp / tilecloud / tilecloud / __init__.py View on Github
``````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 &lt; xbounds.stop:
y = metatilecoord.y
while y &lt; ybounds.stop:
yield TileCoord(z, x, y, n)
y += n
x += n``````

## tilecloud

Tools for managing tiles

BSD-2-Clause