geoviews.data.geopandas module#
- class geoviews.data.geopandas.GeoPandasInterface(*, name)[source]#
Bases:
PandasAPI
,MultiInterface
Methods
applies
(obj)Indicates whether the interface is designed specifically to handle the supplied object's type.
isscalar
(dataset, dim[, per_geom])Tests if dimension is scalar in each subpath.
length
(dataset)Returns the length of the multi-tabular dataset making it appear like a single array of concatenated subpaths separated by NaN values.
loaded
()Indicates whether the required dependencies are loaded.
select
(dataset[, selection_mask])Applies selectiong on all the subpaths.
select_mask
(dataset, selection)Given a Dataset object and a dictionary with dimension keys and selection keys (i.e. tuple ranges, slices, sets, lists, or literals) return a boolean mask over the rows in the Dataset object that have been selected.
shape
(dataset)Returns the shape of all subpaths, making it appear like a single array of concatenated subpaths separated by NaN values.
split
(dataset, start, end, datatype, **kwargs)Splits a multi-interface Dataset into regular Datasets using regular tabular interfaces.
values
(dataset, dimension[, expanded, flat, ...])Returns a single concatenated array of all subpaths separated by NaN values.
add_dimension
aggregate
dimension_type
dtype
geo_column
geom_dims
groupby
has_holes
holes
iloc
init
nonzero
range
redim
reindex
sample
shape_mask
sort
validate
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 isscalar(dataset, dim, per_geom=False)[source]#
Tests if dimension is scalar in each subpath.
- classmethod length(dataset)[source]#
Returns the length of the multi-tabular dataset making it appear like a single array of concatenated subpaths separated by NaN values.
- classmethod select(dataset, selection_mask=None, **selection)[source]#
Applies selectiong on all the subpaths.
- classmethod select_mask(dataset, selection)[source]#
Given a Dataset object and a dictionary with dimension keys and selection keys (i.e. tuple ranges, slices, sets, lists, or literals) return a boolean mask over the rows in the Dataset object that have been selected.
- classmethod shape(dataset)[source]#
Returns the shape of all subpaths, making it appear like a single array of concatenated subpaths separated by NaN values.
- geoviews.data.geopandas.from_multi(eltype, data, kdims, vdims)[source]#
Converts list formats into geopandas.GeoDataFrame.
- Parameters:
- eltype
Element type to convert
- data
The original data
- kdims
The declared key dimensions
- vdims
The declared value dimensions
- Returns:
A
GeoDataFrame
containing
the
data
in
the
python:list
based
format.
- geoviews.data.geopandas.get_geom_type(geom)[source]#
Returns the HoloViews geometry type.
- Parameters:
- geom
A shapely geometry
- Returns:
python:str
A string representing type of the geometry.
- geoviews.data.geopandas.to_geopandas(data, xdim, ydim, columns=None, geom='point')[source]#
Converts a list of geometry dictionaries into a GeoPandas GeoDataFrame.
- Parameters:
- data
python:list
of
python:dict
List of dictionaries representing individual geometries
- xdim
python:str
Name of x-coordinates column
- ydim
python:str
Name of y-coordinates column
- columns
python:list
of
python:str
,optional
List of additional column names to include in the resulting GeoDataFrame, apart from the geometry. Defaults to an empty list.
- geom{‘point’, ‘Line’, ‘Polygon’}, default=’point’
Specifies the geometry type to construct. Supports: - ‘point’ : Point or MultiPoint - ‘Line’ : LineString or MultiLineString - ‘Polygon’ : Polygon or MultiPolygon
- data
- Returns:
geopandas.GeoDataFrame
A GeoDataFrame containing the parsed geometries in a ‘geometry’ column along with any specified attribute columns.