pysepal.sepalwidgets.inputs.VectorField#

class pysepal.sepalwidgets.inputs.VectorField(*args, **kwargs)[source]#

A custom input widget to load vector data.

The user will provide a vector file compatible with fiona or a GEE feature collection. The user can then select a specific shape by setting column and value fields.

Parameters:
  • label (str) – the label of the file input field, default to ‘vector file’.

  • gee (bool) – whether to use GEE assets or local vectors.

  • folder – When gee=True, extra args will be used for AssetSelect

  • 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

  • kwargs – any parameter from a v.Col. if set, ‘children’ will be overwritten.

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.

Attributes

column_base_items

the column compulsory selector (ALL)

df

the original dataframe without the geometry (for column naming)

feature_collection

the selected featureCollection

gdf

The selected dataframe

original_gdf

The originally selected dataframe

v_model

xx, 'value': xx}

w_column

The Select widget to select the column

w_file

The file selector widget

w_value

The Select widget to select the value in the selected column

Methods

__init__

A custom input widget to load vector data.

reset

Return the field to its initial state.

VectorField.__init__(label='Vector file', gee=False, gee_session=None, gee_interface=None, **kwargs)[source]#

A custom input widget to load vector data.

The user will provide a vector file compatible with fiona or a GEE feature collection. The user can then select a specific shape by setting column and value fields.

Parameters:
  • label (str) – the label of the file input field, default to ‘vector file’.

  • gee (bool) – whether to use GEE assets or local vectors.

  • folder – When gee=True, extra args will be used for AssetSelect

  • 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

  • kwargs – any parameter from a v.Col. if set, ‘children’ will be overwritten.

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.

VectorField.reset()[source]#

Return the field to its initial state.

Return type:

Self