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.ObjectBase raster layer.
Renders boxes and tiles through grabbers (see
gws.base.grabber), one per CRS supported by the application. Subclasses provide the grabber withcreate_grabberand the default cache name withcreate_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
Noneif 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
targetCrsthe map CRS is used.- Returns:
The grabber, or
Noneif 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
cacheconfiguration. The cache name defaults tocreate_cache_nameand gets the CRS code appended. Caching is disabled (maxAge0) whenwithCacheis off, and for CRSs not listed incache.crsif that list is given. CRSs that are incompatible with the layer extent are skipped with a configuration warning.
- render_box(lri)¶
- render_tile(lri)¶