sepal_ui.aoi.aoi_view.AoiView#

class sepal_ui.aoi.aoi_view.AoiView(**kwargs)[source]#

Versatile card object to deal with the aoi selection.

multiple selection method are available (see the MethodSelector object) and the widget can be fully customizable. Can also be bound to ee (ee==True) or not (ee==False).

Parameters:
  • methods (str | List[str]) – the methods to use in the widget, default to ‘ALL’. Available: {‘ADMIN0’, ‘ADMIN1’, ‘ADMIN2’, ‘SHAPE’, ‘DRAW’, ‘POINTS’, ‘ASSET’, ‘ALL’}

  • map_ (SepalMap | None) – link the aoi_view to a custom SepalMap to display the output, default to None

  • gee (bool) – whether to bind to ee or not

  • vector – the path to the default vector object

  • admin – the administrative code of the default selection. Need to be GADM if ee==False and GAUL 2015 if ee==True.

  • asset – the default asset. Can only work if ee==True

  • map_style (dict | None) – the predefined style of the aoi. It’s by default using a “success” sepal_ui.color with 0.5 transparent fill color. It can be completely replace by a fully qualified style dictionary. Use the sepal_ui.color object to define any color to remain compatible with light and dark theme.

  • folder (str | Path)

  • model (AoiModel | None)

New in version 2.11.3: Model is now an optional parameter to AoiView, it can be created from outside and passed to the initialization function.

Attributes

alert

A alert to display message to the end user

aoi_dc

the drawing control associated with DRAW method

btn

A default btn

components

The followingwidgets used to define AOI

folder

The folder name used in GEE related component, mainly used for debugging

gee

Either or not he aoi_view is connected to gee

map_

The map to draw the AOI

map_style

The predefined style of the aoi on the map

model

The model to create the AOI from the selected parameters

updated

Traitlets triggered every time a AOI is selected

w_admin_0

The widget used to select admin level 0

w_admin_1

The widget used to select admin level 1

w_admin_2

The widget used to select admin level 2

w_asset

The widget used to select asset name of a featureCollection (only if gee == True)

w_draw

The widget used to select the name of a drawn shape (only if map_ != None)

w_method

The widget to select the method

w_points

The widget used to select points files

w_vector

The widget used to select vector shapes

Methods

__init__

Versatile card object to deal with the aoi selection.

reset

Clear the aoi_model from input and remove the layer from the map (if existing).

AoiView.__init__(methods='ALL', map_=None, gee=True, folder='', model=None, map_style=None, **kwargs)[source]#

Versatile card object to deal with the aoi selection.

multiple selection method are available (see the MethodSelector object) and the widget can be fully customizable. Can also be bound to ee (ee==True) or not (ee==False).

Parameters:
  • methods (str | List[str]) – the methods to use in the widget, default to ‘ALL’. Available: {‘ADMIN0’, ‘ADMIN1’, ‘ADMIN2’, ‘SHAPE’, ‘DRAW’, ‘POINTS’, ‘ASSET’, ‘ALL’}

  • map_ (SepalMap | None) – link the aoi_view to a custom SepalMap to display the output, default to None

  • gee (bool) – whether to bind to ee or not

  • vector – the path to the default vector object

  • admin – the administrative code of the default selection. Need to be GADM if ee==False and GAUL 2015 if ee==True.

  • asset – the default asset. Can only work if ee==True

  • map_style (dict | None) – the predefined style of the aoi. It’s by default using a “success” sepal_ui.color with 0.5 transparent fill color. It can be completely replace by a fully qualified style dictionary. Use the sepal_ui.color object to define any color to remain compatible with light and dark theme.

  • folder (str | Path)

  • model (AoiModel | None)

Return type:

None

New in version 2.11.3: Model is now an optional parameter to AoiView, it can be created from outside and passed to the initialization function.

AoiView.reset()[source]#

Clear the aoi_model from input and remove the layer from the map (if existing).

Return type:

Self