geoviews.data.geom_dict module#

class geoviews.data.geom_dict.GeomDictInterface(*, name)[source]#

Bases: DictInterface

Methods

applies(obj)

Indicates whether the interface is designed specifically to handle the supplied object's type.

dtype(dataset, dimension)

Returns the dtype for the selected dimension.

has_holes(dataset)

Whether the Dataset contains geometries with holes.

holes(dataset)

Returns a list of lists of arrays containing the holes for each geometry in the Dataset.

iloc(dataset, index)

Implements integer indexing on the rows and columns of the data.

length(dataset)

Returns the number of rows in the Dataset.

range(dataset, dim)

Computes the minimum and maximum value along a dimension.

shape(dataset)

Returns the shape of the data.

validate(dataset, validate_vdims)

Validation runs after the Dataset has been constructed and should validate that the Dataset is correctly formed and contains all declared dimensions.

values(dataset, dim[, expanded, flat, ...])

Returns the values along a dimension of the dataset.

aggregate

concat

dimension_type

geo_column

geom_dims

geom_type

init

sample

select

shape_mask

Parameter Definitions


classmethod applies(obj)[source]#

Indicates whether the interface is designed specifically to handle the supplied object’s type. By default simply checks if the object is one of the types declared on the class, however if the type is expensive to import at load time the method may be overridden.

classmethod dtype(dataset, dimension)[source]#

Returns the dtype for the selected dimension.

Parameters:
datasetDataset

The dataset to query

dimensionpython:str or Dimension

Dimension to return the dtype for

Returns:
numpy.dtype

The dtype of the selected dimension

classmethod has_holes(dataset)[source]#

Whether the Dataset contains geometries with holes.

Parameters:
datasetDataset

The dataset to check

Returns:
bool

Whether the Dataset contains geometries with holes

Notes

Only meaningful to implement on Interfaces that support geometry data.

classmethod holes(dataset)[source]#

Returns a list of lists of arrays containing the holes for each geometry in the Dataset.

Parameters:
datasetDataset

The dataset to extract holes from

Returns:
python:list[python:list[np.ndarray]]

List of list of arrays representing geometry holes

Notes

Only meaningful to implement on Interfaces that support geometry data.

classmethod iloc(dataset, index)[source]#

Implements integer indexing on the rows and columns of the data.

Parameters:
datasetDataset

The dataset to apply the indexing operation on

indexpython:tuple or python:int

Index specification (row_index, col_index) or row_index

Returns:
data

Indexed data

Notes

Only implement for tabular interfaces.

classmethod length(dataset)[source]#

Returns the number of rows in the Dataset.

Parameters:
datasetDataset

The dataset to get the length from

Returns:
python:int

Length of the data

classmethod range(dataset, dim)[source]#

Computes the minimum and maximum value along a dimension.

Parameters:
datasetDataset

The dataset to query

dimensionpython:str or Dimension

Dimension to compute the range on

Returns:
python:tuple[Any, Any]

Tuple of (min, max) values

Notes

In the past categorical and string columns were handled by sorting the values and taking the first and last value. This behavior is deprecated and will be removed in 2.0. In future the range for these columns will be returned as (None, None).

classmethod shape(dataset)[source]#

Returns the shape of the data.

Parameters:
datasetDataset

The dataset to get the shape from

Returns:
python:tuple[python:int, python:int]

The shape of the data (rows, cols)

classmethod validate(dataset, validate_vdims)[source]#

Validation runs after the Dataset has been constructed and should validate that the Dataset is correctly formed and contains all declared dimensions.

classmethod values(dataset, dim, expanded=True, flat=True, compute=True, keep_index=False)[source]#

Returns the values along a dimension of the dataset.

Parameters:
datasetDataset

The dataset to query

dimensionpython:str or Dimension

Dimension to return the values for

expandedbool, default python:True

When false returns unique values along the dimension

flatbool, default python:True

Whether to flatten the array

computebool, default python:True

Whether to load lazy data into memory as a NumPy array

keep_indexbool, default python:False

Whether to return the data with an index (if present)

Returns:
numpy:array_like

Dimension values in the requested format

Notes

The expanded keyword has different behavior for gridded interfaces where it determines whether 1D coordinates are expanded into a multi-dimensional array.