DataFetcher
Bases: Protocol
Protocol for data fetchers
Data fetchers are callables that fetch data from a source given a minimum x and y coordinate. These coordinates correspond to the bottom left corner of a tile. The data fetcher is used by the dataset to fetch data for each tile.
Currently implemented data fetchers
- CompositeFetcher: Composes multiple data fetchers
- VRTFetcher: Fetches data from a virtual raster
- WMSFetcher: Fetches data from a web map service
Notes
- Implementations must support concurrency (the data fetcher is called concurrently by the data loader)
__call__
Fetches data from the source.
PARAMETER | DESCRIPTION |
---|---|
x_min |
minimum x coordinate
TYPE:
|
y_min |
minimum y coordinate
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
npt.NDArray
|
data |
CompositeFetcher
Bases: FromConfigMixin
Data fetcher that composes multiple data fetchers
Implements the DataFetcher
protocol.
PARAMETER | DESCRIPTION |
---|---|
data_fetchers |
data fetchers
TYPE:
|
num_workers |
number of workers
TYPE:
|
from_config
classmethod
Creates a composite fetcher from the configuration.
PARAMETER | DESCRIPTION |
---|---|
config |
configuration
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
CompositeFetcher
|
composite fetcher |
__call__
Fetches data from the sources.
PARAMETER | DESCRIPTION |
---|---|
x_min |
minimum x coordinate
TYPE:
|
y_min |
minimum y coordinate
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
npt.NDArray
|
data |
CompositeFetcherConfig
Bases: pydantic.BaseModel
Configuration for the from_config
class method of CompositeFetcher
ATTRIBUTE | DESCRIPTION |
---|---|
data_fetchers_configs |
configurations of the data fetchers
TYPE:
|
num_workers |
number of workers
TYPE:
|
DataFetcherConfig
Bases: pydantic.BaseModel
Configuration for data fetchers
ATTRIBUTE | DESCRIPTION |
---|---|
name |
name of the data fetcher
TYPE:
|
config |
configuration of the data fetcher
TYPE:
|
VRTFetcher
Bases: FromConfigMixin
Data fetcher for virtual rasters
Implements the DataFetcher
protocol.
PARAMETER | DESCRIPTION |
---|---|
path |
path to the virtual raster (.vrt file)
TYPE:
|
tile_size |
tile size in meters
TYPE:
|
ground_sampling_distance |
ground sampling distance in meters
TYPE:
|
interpolation_mode |
interpolation mode (
TYPE:
|
buffer_size |
buffer size in meters (specifies the area around the tile that is additionally fetched)
TYPE:
|
drop_channels |
channel indices to drop (supports negative indexing)
TYPE:
|
from_config
classmethod
Creates a vrt fetcher from the configuration.
PARAMETER | DESCRIPTION |
---|---|
config |
configuration
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
VRTFetcher
|
vrt fetcher |
__call__
Fetches data from the virtual raster.
PARAMETER | DESCRIPTION |
---|---|
x_min |
minimum x coordinate
TYPE:
|
y_min |
minimum y coordinate
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
npt.NDArray
|
data |
VRTFetcherConfig
Bases: pydantic.BaseModel
Configuration for the from_config
class method of VRTFetcher
ATTRIBUTE | DESCRIPTION |
---|---|
path |
path to the virtual raster (.vrt file)
TYPE:
|
tile_size |
tile size in meters
TYPE:
|
ground_sampling_distance |
ground sampling distance in meters
TYPE:
|
interpolation_mode |
interpolation mode ('bilinear' or 'nearest')
TYPE:
|
buffer_size |
buffer size in meters (specifies the area around the tile that is additionally fetched)
TYPE:
|
drop_channels |
channel indices to drop (supports negative indexing)
TYPE:
|
WMSFetcher
Bases: FromConfigMixin
Data fetcher for web map services
Implements the DataFetcher
protocol.
PARAMETER | DESCRIPTION |
---|---|
url |
url of the web map service
TYPE:
|
version |
version of the web map service (
TYPE:
|
layer |
name of the layer
TYPE:
|
epsg_code |
EPSG code
TYPE:
|
response_format |
format of the response (MIME type, e.g., 'image/png')
TYPE:
|
tile_size |
tile size in meters
TYPE:
|
ground_sampling_distance |
ground sampling distance in meters
TYPE:
|
style |
name of the style
TYPE:
|
buffer_size |
buffer size in meters (specifies the area around the tile that is additionally fetched)
TYPE:
|
drop_channels |
channel indices to drop (supports negative indexing)
TYPE:
|
from_config
classmethod
Creates a wms fetcher from the configuration.
PARAMETER | DESCRIPTION |
---|---|
config |
configuration
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
WMSFetcher
|
wms fetcher |
__call__
Fetches data from the web map service.
PARAMETER | DESCRIPTION |
---|---|
x_min |
minimum x coordinate
TYPE:
|
y_min |
minimum y coordinate
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
npt.NDArray
|
data |
WMSFetcherConfig
Bases: pydantic.BaseModel
Configuration for the from_config
class method of WMSFetcher
ATTRIBUTE | DESCRIPTION |
---|---|
url |
url of the web map service
TYPE:
|
version |
version of the web map service ('1.1.1' or '1.3.0')
TYPE:
|
layer |
name of the layer
TYPE:
|
epsg_code |
EPSG code
TYPE:
|
response_format |
format of the response (MIME type, e.g., 'image/png')
TYPE:
|
tile_size |
tile size in meters
TYPE:
|
ground_sampling_distance |
ground sampling distance in meters
TYPE:
|
style |
name of the style
TYPE:
|
buffer_size |
buffer size in meters (specifies the area around the tile that is additionally fetched)
TYPE:
|
drop_channels |
channel indices to drop (supports negative indexing)
TYPE:
|