Package mapproxy :: Package core :: Module cache :: Class Cache
[hide private]
[frames] | no frames]

Class Cache

source code

object --+
         |
        Cache

Easy access to images from cached tiles.
Instance Methods [hide private]
 
__init__(self, cache_mgr, grid, transparent=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
ImageSource or None
tile(self, tile_coord)
Return a single tile.
source code
 
_tiles(self, tile_coords) source code
ImageSource
_tiled_image(self, req_bbox, req_srs, out_size)
Return a TiledImage with all tiles that are within the requested bbox, for the given out_size.
source code
ImageSource
image(self, req_bbox, req_srs, out_size)
Return an image with the given bbox and size.
source code
 
__repr__(self)
repr(x)
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cache_mgr, grid, transparent=False)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Parameters:
  • cache_mgr - the cache manager
  • grid - the grid of the tile cache
Overrides: object.__init__

tile(self, tile_coord)

source code 
Return a single tile.
Returns: ImageSource or None
loaded tile or None

_tiled_image(self, req_bbox, req_srs, out_size)

source code 
Return a TiledImage with all tiles that are within the requested bbox, for the given out_size.
Parameters:
  • req_bbox - the requested bbox
  • req_srs - the srs of the req_bbox
  • out_size - the target output size
Returns: ImageSource

Note: The parameters are just hints for the tile cache to load the right tiles. Usually the bbox and the size of the result is larger. The result will always be in the native srs of the cache. See Cache.image.

image(self, req_bbox, req_srs, out_size)

source code 
Return an image with the given bbox and size. The result will be cropped/transformed if needed.
Parameters:
  • req_bbox - the requested bbox
  • req_srs - the srs of the req_bbox
  • out_size - the output size
Returns: ImageSource

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)