gws.base.map.action

Map related commands.

Source code: gws.base.map.action

Module Contents

class gws.base.map.action.Config

Bases: gws.base.action.Config

Serves map images, tiles, legends and features to the client.

class gws.base.map.action.DescribeLayerRequest(*args, **kwargs)

Bases: gws.Request

Request for a layer description.

layerUid: str

Layer UID.

class gws.base.map.action.DescribeLayerResponse(*args, **kwargs)

Bases: gws.Response

Layer description response.

content: str

Rendered layer.description template, or an empty string.

class gws.base.map.action.GetBoxRequest(*args, **kwargs)

Bases: gws.Request

Request for a layer image of a bounding box.

bbox: gws.Extent

Bounding box in the request CRS.

compositeLayerUids: list[str] | None

UIDs of the child layers to render in one composite image, passed to the layer in extraParams.

crs: gws.CrsName | None

CRS of the bounding box; defaults to the map CRS of the layer.

dpi: int | None

Image resolution; not used, the box is always rendered at the OGC screen resolution.

height: int

Image height in pixels.

layerUid: str

Layer UID.

width: int

Image width in pixels.

class gws.base.map.action.GetFeaturesRequest(*args, **kwargs)

Bases: gws.Request

Request for the features of a layer.

bbox: gws.Extent | None

Bounding box to search in; defaults to the layer bounds.

crs: gws.CrsName | None

CRS of the bounding box; defaults to the map CRS of the layer.

layerUid: str

Layer UID.

limit: int = 0

Maximum number of features; not used, the limit is fixed at 10000.

modelUid: str | None

Model UID; not used.

resolution: float | None

Map resolution; not used.

views: list[str] | None

Feature views to render; not used, only the label view is rendered.

class gws.base.map.action.GetFeaturesResponse(*args, **kwargs)

Bases: gws.Response

Features response.

features: list[gws.FeatureProps]

Found features.

class gws.base.map.action.GetLegendRequest(*args, **kwargs)

Bases: gws.Request

Request for a layer legend.

layerUid: str

Layer UID.

class gws.base.map.action.GetTileRequest(*args, **kwargs)

Bases: gws.Request

Request for a layer tile.

compositeLayerUids: list[str] | None

UIDs of the child layers to render in one composite image, passed to the layer in extraParams.

layerUid: str

Layer UID.

x: int

Tile column.

y: int

Tile row.

z: int

Zoom level.

class gws.base.map.action.ImageResponse(*args, **kwargs)

Bases: gws.Response

Image response.

content: bytes

Encoded image.

mimeType: str

MIME type of the image.

gws.base.map.action.LEGEND_IMAGE_FORMAT
class gws.base.map.action.Object

Bases: gws.base.action.Object

Map action.

Serves layer images, tiles, legends, descriptions and features to the client.

api_get_box(req: gws.WebRequester, p: GetBoxRequest) → ImageResponse

Render a layer image of a bounding box.

api_get_features(req: gws.WebRequester, p: GetFeaturesRequest) → GetFeaturesResponse

Return the features of a layer in a bounding box.

api_get_legend(req: gws.WebRequester, p: GetLegendRequest) → ImageResponse

Render the legend of a layer.

api_get_tile(req: gws.WebRequester, p: GetTileRequest) → ImageResponse

Render a layer tile.

describe_layer(req: gws.WebRequester, p: DescribeLayerRequest) → DescribeLayerResponse

Return the description of a layer.

http_get_box(req: gws.WebRequester, p: GetBoxRequest) → gws.ContentResponse

Render a layer image of a bounding box.

http_get_features(req: gws.WebRequester, p: GetFeaturesRequest) → gws.ContentResponse

Return the features of a layer in a bounding box.

http_get_legend(req: gws.WebRequester, p: GetLegendRequest) → gws.ContentResponse

Render the legend of a layer.

http_get_tile(req: gws.WebRequester, p: GetTileRequest) → gws.ContentResponse

Render a layer tile.

class gws.base.map.action.Props

Bases: gws.base.action.Props