pysepal.aoi.aoi_view.AoiView#
- class pysepal.aoi.aoi_view.AoiView(*args, **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==Falseand GAUL 2015 ifee==True.asset – the default asset. Can only work if
ee==Truemap_style (dict | None) – the predefined style of the aoi. It’s by default using a “success”
sepal_ui.colorwith 0.5 transparent fill color. It can be completely replace by a fully qualified style dictionary. Use thesepal_ui.colorobject to define any color to remain compatible with light and dark theme.gee_session (EESession | None) – the Earth Engine session to use (deprecated in favor of gee_interface)
gee_interface (GEEInterface | None) – a shared GEEInterface instance. If provided, takes precedence over gee_session
folder (str | Path)
model (AoiModel | None)
- Raises:
ValueError – if both gee_session and gee_interface are provided
Added in version 3.0.0: Added gee_interface parameter for sharing GEEInterface instances across components.
Added 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
alertA alert to display message to the end user
aoi_dcthe drawing control associated with DRAW method
btnA default btn
componentsThe followingwidgets used to define AOI
folderThe folder name used in GEE related component, mainly used for debugging
geeEither or not he aoi_view is connected to gee
map_The map to draw the AOI
map_styleThe predefined style of the aoi on the map
modelThe model to create the AOI from the selected parameters
updatedTraitlets triggered every time a AOI is selected
w_admin_0The widget used to select admin level 0
w_admin_1The widget used to select admin level 1
w_admin_2The widget used to select admin level 2
w_assetThe widget used to select asset name of a featureCollection (only if
gee == True)w_drawThe widget used to select the name of a drawn shape (only if
map_ != None)w_methodThe widget to select the method
w_pointsThe widget used to select points files
w_vectorThe widget used to select vector shapes
Methods
- AoiView.__init__(methods='ALL', map_=None, gee=True, folder='', model=None, map_style=None, gee_session=None, gee_interface=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==Falseand GAUL 2015 ifee==True.asset – the default asset. Can only work if
ee==Truemap_style (dict | None) – the predefined style of the aoi. It’s by default using a “success”
sepal_ui.colorwith 0.5 transparent fill color. It can be completely replace by a fully qualified style dictionary. Use thesepal_ui.colorobject to define any color to remain compatible with light and dark theme.gee_session (EESession | None) – the Earth Engine session to use (deprecated in favor of gee_interface)
gee_interface (GEEInterface | None) – a shared GEEInterface instance. If provided, takes precedence over gee_session
folder (str | Path)
model (AoiModel | None)
- Raises:
ValueError – if both gee_session and gee_interface are provided
- Return type:
None
Added in version 3.0.0: Added gee_interface parameter for sharing GEEInterface instances across components.
Added 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.