geoviews.data.geom_dict module#
- class geoviews.data.geom_dict.GeomDictInterface(*, name)[source]#
Bases:
DictInterfaceMethods
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:
- dataset
Dataset The dataset to query
- dimension
python:strorDimension Dimension to return the dtype for
- dataset
- Returns:
numpy.dtypeThe dtype of the selected dimension
- classmethod has_holes(dataset)[source]#
Whether the Dataset contains geometries with holes.
- Parameters:
- dataset
Dataset The dataset to check
- dataset
- 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:
- dataset
Dataset The dataset to extract holes from
- dataset
- 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:
- dataset
Dataset The dataset to apply the indexing operation on
- index
python:tupleorpython:int Index specification (row_index, col_index) or row_index
- dataset
- Returns:
dataIndexed data
Notes
Only implement for tabular interfaces.
- classmethod length(dataset)[source]#
Returns the number of rows in the Dataset.
- Parameters:
- dataset
Dataset The dataset to get the length from
- dataset
- Returns:
python:intLength of the data
- classmethod range(dataset, dim)[source]#
Computes the minimum and maximum value along a dimension.
- Parameters:
- dataset
Dataset The dataset to query
- dimension
python:strorDimension Dimension to compute the range on
- dataset
- 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:
- dataset
Dataset The dataset to get the shape from
- dataset
- 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:
- dataset
Dataset The dataset to query
- dimension
python:strorDimension Dimension to return the values for
- expandedbool,
defaultpython:True When false returns unique values along the dimension
- flatbool,
defaultpython:True Whether to flatten the array
- computebool,
defaultpython:True Whether to load lazy data into memory as a NumPy array
- keep_indexbool,
defaultpython:False Whether to return the data with an index (if present)
- dataset
- 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.