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.

github camptocamp / tilecloud / tilecloud / __init__.py View on Github external
def metatilecoord(self, n=8):
        return TileCoord(self.z, n * (self.x // n), n * (self.y // n), n)
github camptocamp / tilecloud / tilecloud / __init__.py View on Github external
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)
github camptocamp / tilecloud / tilecloud / __init__.py View on Github external
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)
github camptocamp / tilecloud / tilecloud / __init__.py View on Github external
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
github camptocamp / tilecloud / tilecloud / __init__.py View on Github external
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