gws.plugin.raster_layer.provider¶
Image set provider for raster layers.
Source code: gws.plugin.raster_layer.provider
Module Contents¶
- class gws.plugin.raster_layer.provider.Config(*args, **kwargs)¶
Bases:
gws.ConfigSet of georeferenced image files for a raster layer.
- crs: gws.CrsName | None¶
CRS for images that have none.
- paths: list[gws.FilePath] | None¶
Image files to show.
- class gws.plugin.raster_layer.provider.ImageEntry(*args, **kwargs)¶
Bases:
gws.DataA georeferenced image file.
- bounds: gws.Bounds¶
Image bounds in the image CRS.
- class gws.plugin.raster_layer.provider.Object¶
Bases:
gws.NodeSet of georeferenced image files, given as paths or a glob pattern.
- cache_hash()¶
Compute a hash of the provider settings.
- Returns:
Hash string, built from the paths and the CRS.
- configure()¶
Configuration hook.
Called when the node is initialized. Raising an exception here aborts the creation of the node.
- enumerate_images(default_crs: gws.Crs) list[ImageEntry]¶
Read the bounds of the image files.
Files that cannot be opened, and files in a CRS other than the CRS of the first image, are skipped with a configuration warning.
- Parameters:
default_crs – CRS for images that have none.
- Returns:
Image entries, all in the same CRS.
- make_tile_index(entries: list[ImageEntry], file_name: str) str¶
Create a MapServer tile index shapefile for the images.
The index has a polygon per image with the file path in the
locationcolumn, and a spatial index.- Parameters:
entries – Images to index.
file_name – Base name of the shapefile, in the object cache directory.
- Returns:
Path to the shapefile.