gws.base.layer.image

Base raster layer.

Source code: gws.base.layer.image

Module Contents

gws.base.layer.image.CACHE_NAME_LENGTH = 12
class gws.base.layer.image.Object

Bases: gws.base.layer.core.Object

Base raster layer.

Renders boxes and tiles through grabbers (see gws.base.grabber), one per CRS supported by the application. Subclasses provide the grabber with create_grabber and the default cache name with create_cache_name.

canRenderBox = True
canRenderTile = True
abstractmethod create_cache_name(cache: gws.MapCache) → str

Create a default cache name for the layer.

Subclasses must implement this.

Parameters:

cache – Cache settings.

Returns:

Cache name.

Raises:

NotImplementedError – In the base class.

create_grabber(opts: gws.base.grabber.Options) → gws.Grabber | None

Create a grabber for one CRS. Returns nothing in the base class.

Parameters:

opts – Grabber options: CRS, cache, extent and image format.

Returns:

A grabber, or None if the layer cannot serve this CRS.

grabber_for(lri: gws.LayerRenderInput) → gws.Grabber | None

Find the grabber for the target CRS of a render request.

Parameters:

lri – Render input; without targetCrs the map CRS is used.

Returns:

The grabber, or None if there is none for the CRS.

post_configure()
post_configure_grabbers()

Create a grabber for each CRS supported by the application.

The cache settings come from the cache configuration. The cache name defaults to create_cache_name and gets the CRS code appended. Caching is disabled (maxAge 0) when withCache is off, and for CRSs not listed in cache.crs if that list is given. CRSs that are incompatible with the layer extent are skipped with a configuration warning.

render_box(lri)
render_tile(lri)