new_union_dataset#

geodesic.boson.dataset.new_union_dataset(name, datasets, feature_limit=None, project=None, ignore_duplicate_fields=False, band_map=None, middleware={}, cache={}, tile_options={}, domain='*', category='*', type='*', **kwargs)[source]#

Creates a new union of Datasets that provides data from all input Datasets.

Creates a new Dataset by combining multiple Datasets with the union operation. This means that a query to this provider will return the combination of results from all input Datasets. This can be filtered down by the way of the collections parameter on query and the asset_bands parameter in the case of a get_pixels request. All image datasets must have either all the same assets/bands or all different.

Parameters:
  • name (str) – the name of the new Dataset

  • datasets (List[Dataset]) – a list of Datasets to union

  • feature_limit (int | None) – the max size of a results page from a query/search

  • project (Project | str | None) – the name of the project this will be assigned to

  • ignore_duplicate_fields (bool) – if True, duplicate fields across providers will be ignored

  • band_map (Dict[str, List[Dict]] | None) – a dictionary of new band names to the ‘image’ asset that will be mapped to existing asset/band combinations. See example for more details

  • middleware (MiddlewareConfig | list) – configure any boson middleware to be applied to the new dataset.

  • cache (CacheConfig) – configure caching for this dataset

  • tile_options (TileOptions) – configure tile options for this dataset

  • domain (str) – domain of the resulting Object

  • category (str) – category of the resulting Object

  • type (str) – the type of the resulting Object

  • **kwargs (dict) – additional properties to set on the new Dataset

Returns:

a new Dataset that is the union of the input Datasets

Return type:

Dataset

Examples

>>> # create a union of two datasets, but map the "image/b01" and "B1/0"
>>> asset/bands to "red"
>>> ds1 = ...
>>> ds2 = ...
>>> ds_union = new_union_dataset(
...     name="red-union",
...     datasets=[ds2],
...     band_map={
...         "red": [
...             {"asset": "image", "band": 'b01'},
...             {"asset": "B1", "band": 0}
... ]})