Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(193)  |  Call(178)  |  Derive(0)  |  Import(15)
Internal data object for all tiles. Stores the tile-``coord`` and the tile data.

:ivar source: the data of this tile
:type source: ImageSource

src/m/a/MapProxy-1.6.0/mapproxy/cache/meta.py   MapProxy(Download)
if __name__ == '__main__':
    from cStringIO import StringIO
    from mapproxy.cache.tile import Tile
    from mapproxy.test.image import create_tmp_image
 
    tiles = []
    img = create_tmp_image((256, 256))
    for x in range(8):
        for y in range(8):
            tiles.append(Tile((x, y, 4), ImageSource(StringIO(img))))

src/m/a/MapProxy-1.6.0/mapproxy/cache/renderd.py   MapProxy(Download)
 
from mapproxy.client.log import log_request
from mapproxy.cache.tile import TileCreator, Tile
from mapproxy.source import SourceError
 
    def _create_meta_tile(self, meta_tile):
        main_tile = Tile(meta_tile.main_tile_coord)
        with self.tile_locker(main_tile):
            if not all(self.is_cached(t) for t in meta_tile.tiles if t is not None):
                self._create_renderd_tile(main_tile.coord)
 
        tiles = [Tile(coord) for coord in meta_tile.tiles]

src/m/a/mapproxy-HEAD/mapproxy/cache/renderd.py   mapproxy(Download)
 
from mapproxy.client.log import log_request
from mapproxy.cache.tile import TileCreator, Tile
from mapproxy.source import SourceError
 
    def _create_meta_tile(self, meta_tile):
        main_tile = Tile(meta_tile.main_tile_coord)
        with self.tile_locker(main_tile):
            if not all(self.is_cached(t) for t in meta_tile.tiles if t is not None):
                self._create_renderd_tile(main_tile.coord)
 
        tiles = [Tile(coord) for coord in meta_tile.tiles]

src/m/a/MapProxy-1.6.0/mapproxy/cache/riak.py   MapProxy(Download)
 
from mapproxy.image import ImageSource
from mapproxy.cache.tile import Tile
from mapproxy.cache.base import (
    TileCacheBase, FileBasedLocking,
            if before_timestamp:
                obj = self.bucket.get(key, r=1)
                dummy_tile = Tile((0, 0, 0))
                self._fill_metadata_from_obj(obj, dummy_tile)
                if dummy_tile.timestamp < before_timestamp:

src/m/a/mapproxy-HEAD/mapproxy/cache/riak.py   mapproxy(Download)
 
from mapproxy.image import ImageSource
from mapproxy.cache.tile import Tile
from mapproxy.cache.base import (
    TileCacheBase, FileBasedLocking,
            if before_timestamp:
                obj = self.bucket.get(key, r=1)
                dummy_tile = Tile((0, 0, 0))
                self._fill_metadata_from_obj(obj, dummy_tile)
                if dummy_tile.timestamp < before_timestamp:

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_cache_tile.py   mapproxy(Download)
from PIL import Image
 
from mapproxy.cache.tile import Tile
from mapproxy.cache.file import FileCache
from mapproxy.cache.mbtiles import MBTilesCache, MBTilesLevelCache
    def create_tile(self, coord=(0, 0, 4)):
        return Tile(coord,
            ImageSource(tile_image,
                image_opts=ImageOptions(format='image/png')))
 
    def create_another_tile(self, coord=(0, 0, 4)):
        return Tile(coord,
    def test_is_cached_miss(self):
        assert not self.cache.is_cached(Tile((0, 0, 4)))
 
    def test_is_cached_hit(self):
        tile = self.create_tile()
        self.create_cached_tile(tile)
        assert self.cache.is_cached(Tile((0, 0, 4)))

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_cache_tile.py   MapProxy(Download)
from PIL import Image
 
from mapproxy.cache.tile import Tile
from mapproxy.cache.file import FileCache
from mapproxy.cache.mbtiles import MBTilesCache
    def create_tile(self, coord=(0, 0, 4)):
        return Tile(coord,
            ImageSource(tile_image,
                image_opts=ImageOptions(format='image/png')))
 
    def create_another_tile(self, coord=(0, 0, 4)):
        return Tile(coord,
    def test_is_cached_miss(self):
        assert not self.cache.is_cached(Tile((0, 0, 4)))
 
    def test_is_cached_hit(self):
        tile = self.create_tile()
        self.create_cached_tile(tile)
        assert self.cache.is_cached(Tile((0, 0, 4)))

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_cache.py   MapProxy(Download)
from mapproxy.source.tile import TiledSource
from mapproxy.cache.file import FileCache
from mapproxy.cache.tile import Tile, TileManager
 
from mapproxy.grid import TileGrid, resolution_range
    def test_is_stale_missing(self):
        assert not self.tile_mgr.is_stale(Tile((0, 0, 1)))
 
    def test_is_stale_not_expired(self):
        create_cached_tile(Tile((0, 0, 1)), self.file_cache)
        assert not self.tile_mgr.is_stale(Tile((0, 0, 1)))
 
    def test_is_stale_expired(self):
        create_cached_tile(Tile((0, 0, 1)), self.file_cache, timestamp=time.time()-3600)

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_cache.py   mapproxy(Download)
from mapproxy.source.tile import TiledSource
from mapproxy.cache.file import FileCache
from mapproxy.cache.tile import Tile, TileManager
 
from mapproxy.grid import TileGrid, resolution_range
    def test_is_stale_missing(self):
        assert not self.tile_mgr.is_stale(Tile((0, 0, 1)))
 
    def test_is_stale_not_expired(self):
        create_cached_tile(Tile((0, 0, 1)), self.file_cache)
        assert not self.tile_mgr.is_stale(Tile((0, 0, 1)))
 
    def test_is_stale_expired(self):
        create_cached_tile(Tile((0, 0, 1)), self.file_cache, timestamp=time.time()-3600)

src/m/a/MapProxy-1.6.0/mapproxy/test/system/test_seed.py   MapProxy(Download)
import tempfile
from mapproxy.config.loader import load_configuration
from mapproxy.cache.tile import Tile
from mapproxy.image import ImageSource
from mapproxy.image.opts import ImageOptions
    def create_tile(self, coord=(0, 0, 0)):
        return Tile(coord,
            ImageSource(tile_image_buf,
                image_opts=ImageOptions(format='image/png')))
 
        cache.store_tile(self.create_tile((0, 0, 2)))
        cache.store_tile(self.create_tile((0, 0, 3)))
        assert cache.is_cached(Tile((0, 0, 2)))
        assert cache.is_cached(Tile((0, 0, 3)))
 
        eq_(sorted(os.listdir(os.path.join(self.dir, 'cache', 'sqlite_cache', 'GLOBAL_GEODETIC'))),
            ['2.mbtile', '3.mbtile'])
        assert cache.is_cached(Tile((0, 0, 2)))
        assert not cache.is_cached(Tile((0, 0, 3)))
 

  1 | 2  Next