Skip to content

WMSFetcher

Tile fetcher for web map services

Implements the TileFetcher protocol.

PARAMETER DESCRIPTION
url

URL of the web map service

TYPE: str

version

Version of the web map service (V1_1_1 or V1_3_0)

TYPE: WMSVersion

layer

Layer

TYPE: str

epsg_code

EPSG code

TYPE: EPSGCode

response_format

Format of the response (MIME type, e.g., 'image/png')

TYPE: str

channel_keys

Channel name, channel name and time step combination, channel names, or channel name and time step combinations (if None, the channel is ignored)

TYPE: ChannelName | str | ChannelKey | list[ChannelName | str | ChannelKey | None] | None

tile_size

Tile size in meters

TYPE: TileSize

ground_sampling_distance

Ground sampling distance in meters

TYPE: GroundSamplingDistance

style

Style

TYPE: str | None DEFAULT: None

buffer_size

Buffer size in meters

TYPE: BufferSize DEFAULT: 0

from_config classmethod

Creates a WMS fetcher from the configuration.

PARAMETER DESCRIPTION
config

Configuration

TYPE: WMSFetcherConfig

RETURNS DESCRIPTION
WMSFetcher

WMS fetcher

__call__

Fetches a tile from the web map service.

PARAMETER DESCRIPTION
coordinates

Coordinates (x_min, y_min) of the tile in meters

TYPE: Coordinates

RETURNS DESCRIPTION
Tile

Tile


WMSFetcherConfig

Bases: pydantic.BaseModel

Configuration for the from_config class method of WMSFetcher

Create the configuration from a config file
  • Use '1.1.1' or '1.3.0' instead of WMSVersion.V1_1_1 or WMSVersion.V1_3_0
  • Use null instead of None
Example

You can create the configuration from a config file.

config.yaml
package: 'aviary'
name: 'WMSFetcher'
config:
  url: 'https://www.my-wms.com'
  version: '1.3.0'
  layer: 'my_layer'
  epsg_code: 25832
  response_format: 'image/png'
  channel_keys:
    - 'r'
    - 'g'
    - 'b'
  tile_size: 128
  ground_sampling_distance: .2
  style: null
  buffer_size: 0
ATTRIBUTE DESCRIPTION
url

URL of the web map service

TYPE: str

version

Version of the web map service (V1_1_1 or V1_3_0)

TYPE: WMSVersion

layer

Layer

TYPE: str

epsg_code

EPSG code

TYPE: EPSGCode

response_format

Format of the response (MIME type, e.g., 'image/png')

TYPE: str

channel_keys

Channel name, channel name and time step combination, channel names, or channel name and time step combinations (if None, the channel is ignored)

TYPE: ChannelName | str | ChannelKey | list[ChannelName | str | ChannelKey | None] | None

tile_size

Tile size in meters

TYPE: TileSize

ground_sampling_distance

Ground sampling distance in meters

TYPE: GroundSamplingDistance

style

Style - defaults to None

TYPE: str | None

buffer_size

Buffer size in meters - defaults to 0

TYPE: BufferSize