geodesic.boson.dataset.Dataset.view#
- Dataset.view(name, bbox=None, intersects=None, datetime=None, collections=None, ids=None, filter=None, include_fields=None, exclude_fields=None, asset_bands=[], no_data=None, resampling_method=None, feature_limit=None, middleware={}, cache={}, tile_options={}, domain=None, category=None, type=None, project=None, **kwargs)[source]#
Creates a curated view of a
Dataset.This method creates a new
Datasetthat is a “view” of an existing dataset. This allows the user to provide a set of persistent filters to aDatasetas a separateObject. A view may also be saved in a differentProjectthan the original. The applied filters affect both a query as well as the get_pixels. The final request processed will be the intersection of the view parameters with the query.- Parameters:
name (str) – name of the view
Datasetbbox (List | Tuple | None) – The spatial extent for the query as a bounding box. Example: [-180, -90, 180, 90]
intersects (object | None) – a geometry to use in the query
datetime (List | Tuple | None) – The temporal extent for the query formatted as a list: [start, end].
collections (List[str] | None) – a list of collections to search
ids (List[str] | None) – a list of feature/item IDs to filter to
filter (CQLFilter | dict | None) – a CQL2 filter. This is supported by most datasets but will not work for others.
include_fields (List[str] | None) – a list of fields to include in the view. If specified, this view will only return fields contained in this list (and in addition include id and geometry). If left as None (default), all fields will be included in the view.
exclude_fields (List[str] | None) – a list of fields to exclude from the view. If specified, this view will not return fields contained in this list (but will still include id and geometry). If left as None (default), no fields will be excluded from the view.
asset_bands (list) – a list of asset/bands combinations to filter this
Datasettono_data (list | tuple | None) – a list of values to treat as “no data” by default in requests
resampling_method (str | None) – the resampling method to use for pixel requests
feature_limit (int | None) – if specified, overrides the max_page_size of the this
Datasetmiddleware (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 | None) – domain of the resulting
Objectcategory (str | None) – category of the resulting
Objecttype (str | None) – the type of the resulting
Objectproject (str | None) – a new project to save this view to. If None, inherits from the parent
Dataset**kwargs – additional properties to set on the new
Dataset
- Returns:
a new
Datasetthat is a view of the original dataset- Return type:
Examples
>>> # create a view of sentinel-2-l2a for just the state of Colorado >>> ds = geodesic.get_dataset("sentinel-2-l2a") >>> bbox_co = [-109.050293,36.993778,-102.030029,41.004775] >>> ds_view = ds.view(name = "sentinel-2-l2a-co", bbox = bbox_co) >>> ds_view.save()