Skip to content

CompositeFetcher

Tile fetcher that composes multiple tile fetchers

Notes
  • The tile fetchers are called concurrently depending on the maximum number of threads
  • If the maximum number of threads is 1, the tile fetchers are composed vertically, i.e., in sequence
  • If the maximum number of threads is greater than 1, the tile fetchers are composed horizontally, i.e., in parallel

Implements the TileFetcher protocol.

PARAMETER DESCRIPTION
tile_fetchers

Tile fetchers

TYPE: list[TileFetcher]

max_num_threads

Maximum number of threads

TYPE: int | None DEFAULT: None

from_config classmethod

Creates a composite fetcher from the configuration.

PARAMETER DESCRIPTION
config

Configuration

TYPE: CompositeFetcherConfig

RETURNS DESCRIPTION
CompositeFetcher

Composite fetcher

__call__

Fetches a tile from the sources.

PARAMETER DESCRIPTION
coordinates

Coordinates (x_min, y_min) of the tile in meters

TYPE: Coordinates

RETURNS DESCRIPTION
Tile

Tile


CompositeFetcherConfig

Bases: pydantic.BaseModel

Configuration for the from_config class method of CompositeFetcher

Create the configuration from a config file
  • Use null instead of None
Example

You can create the configuration from a config file.

config.yaml
package: 'aviary'
name: 'CompositeFetcher'
config:
  tile_fetcher_configs:
    - ...
    ...
  max_num_threads: null
ATTRIBUTE DESCRIPTION
tile_fetcher_configs

Configurations of the tile fetchers

TYPE: list[TileFetcherConfig]

max_num_threads

Maximum number of threads - defaults to None

TYPE: int | None