gws.plugin.ows_client.wms.provider

WMS service provider.

Source code: gws.plugin.ows_client.wms.provider

Module Contents

class gws.plugin.ows_client.wms.provider.Config

Bases: gws.base.ows.client.provider.Config

Connection to a WMS service.

bottomFirst: bool = False

The service lists layers in its capabilities from bottom to top.

maxRequestPixels: int = 4096

Max. size of a single map request in pixels. (added in 8.5)

class gws.plugin.ows_client.wms.provider.Object

Bases: gws.base.ows.client.provider.Object

WMS service provider.

Reads the capabilities of a WMS service and runs GetMap and GetFeatureInfo requests for the layers, finders and models that use the service.

DEFAULT_GET_FEATURE_LIMIT = 100

Value of FEATURE_COUNT in GetFeatureInfo requests, if the search has no limit.

maxRequestPixels: int

Max. width and height of a single GetMap request in pixels; the grabber fetches larger images in chunks.

protocol
cache_hash()
configure()
create_leaf_layer_config(source_layers)

Create the configuration of a wmsflat layer for the given source layers.

Used by the wms tree layer to create its leaf layers.

Parameters:

source_layers – Source layers to render in the layer.

Returns:

A layer configuration that uses this provider.

get_features(search, source_layers)
get_map(bounds: gws.Bounds, width: int, height: int, source_layers: list[gws.SourceLayer], mime_type: str) → bytes

Fetch a map image with GetMap.

The source layers are given top-first and sent bottom-first, as WMS expects. The image is requested with a transparent background.

Parameters:
  • bounds – Bounds of the image; their CRS is the request CRS.

  • width – Image width in pixels.

  • height – Image height in pixels.

  • source_layers – Source layers to render, topmost first.

  • mime_type – Image format to request.

Returns:

The image content.

Raises:

gws.ExternalServiceError – If the service has no GetMap operation or the response is not an image.