zooui.tilesystem.tileproviders.tileprovider module¶
Threaded class for loading tiles into memory (abstract base class).
- class zooui.tilesystem.tileproviders.tileprovider.TileProvider(tilecache)[source]¶
Bases:
Thread- Constructor :
TileProvider(tilecache)
- Parameters :
tilecache : TileCache
TileProvider(tilecache) –> TileProvider
TileProvider objects are used for loading tiles into TileCache objects.
This is an abstract base class that provides threaded infrastructure for loading tiles into memory. Subclasses must implement the _load method to define how tiles are actually loaded.
Requests are processed in LIFO (Last In First Out) order.
- Method :
TileProvider.__init__(tilecache)
- Parameters :
tilecache : TileCache
TileProvider.__init__(tilecache) –> None
Create a new TileProvider for loading tiles into the given tilecache.
Initializes the thread infrastructure, task queue, and logger for this tile provider instance.
- request(tile_id)[source]¶
- Method :
TileProvider.request(tile_id)
- Parameters :
tile_id : Tuple[str, int, int, int]
TileProvider.request(tile_id) –> None
Request the tile identified by tile_id be loaded into the tilecache.
Requests are processed in a LIFO order.
If the tile is unavailable, then None will be inserted into the tilecache to indicate this.
- _load(tile_id)[source]¶
- Method :
TileProvider._load(tile_id)
- Parameters :
tile_id : Tuple[str, int, int, int]
TileProvider._load(tile_id) –> Image or None
Load the requested tile, and return it as an Image object.
Returns None if the tile does not exist.
- run()[source]¶
- Method :
TileProvider.run()
- Parameters :
None
TileProvider.run() –> None
Run a loop to load requested tiles.
- purge(media_id=None)[source]¶
- Method :
TileProvider.purge(media_id)
- Parameters :
media_id : Optional[str]
TileProvider.purge(media_id) –> None
Purge all tasks for the given media_id. All tasks will be purged if media_id is omitted.