Skip to content

VRTFetcher

Tile fetcher for virtual rasters

Implements the TileFetcher protocol.

PARAMETER DESCRIPTION
path

Path to the virtual raster (.vrt file)

TYPE: Path

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

interpolation_mode

Interpolation mode (BILINEAR or NEAREST)

TYPE: InterpolationMode DEFAULT: InterpolationMode.BILINEAR

buffer_size

Buffer size in meters

TYPE: BufferSize DEFAULT: 0

from_config classmethod

Creates a VRT fetcher from the configuration.

PARAMETER DESCRIPTION
config

Configuration

TYPE: VRTFetcherConfig

RETURNS DESCRIPTION
VRTFetcher

VRT fetcher

__call__

Fetches a tile from the virtual raster.

PARAMETER DESCRIPTION
coordinates

Coordinates (x_min, y_min) of the tile in meters

TYPE: Coordinates

RETURNS DESCRIPTION
Tile

Tile


VRTFetcherConfig

Bases: pydantic.BaseModel

Configuration for the from_config class method of VRTFetcher

Create the configuration from a config file
  • Use 'bilinear' or 'nearest' instead of InterpolationMode.BILINEAR or InterpolationMode.NEAREST
  • Use null instead of None
Example

You can create the configuration from a config file.

config.yaml
package: 'aviary'
name: 'VRTFetcher'
config:
  path: 'path/to/my_vrt.vrt'
  channel_keys:
    - 'r'
    - 'g'
    - 'b'
  tile_size: 128
  ground_sampling_distance: .2
  interpolation_mode: 'bilinear'
  buffer_size: 0
ATTRIBUTE DESCRIPTION
path

Path to the virtual raster (.vrt file)

TYPE: Path

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

interpolation_mode

Interpolation mode (BILINEAR or NEAREST) - defaults to BILINEAR

TYPE: InterpolationMode

buffer_size

Buffer size in meters (specifies the area around the tile that is additionally fetched) - defaults to 0

TYPE: BufferSize