def length(cls, dataset): from holoviews.core.data import PandasInterface length = sum([geom_length(g) for g in dataset.data.geometry]) geom_type = dataset.data.geom_type.iloc[0] if geom_type != 'Point': length += (PandasInterface.length(dataset)-1) return length
def sort(cls, dataset, by=[], reverse=False): geo_dims = cls.geom_dims(dataset) if any(d in geo_dims for d in by): raise DataError( "SpatialPandasInterface does not allow sorting " "by geometry dimension.", cls) return PandasInterface.sort(dataset, by, reverse)
def groupby(cls, dataset, dimensions, container_type, group_type, **kwargs): geo_dims = cls.geom_dims(dataset) if any(d in geo_dims for d in dimensions): raise DataError("GeoPandasInterface does not allow grouping " "by geometry dimension.", cls) return PandasInterface.groupby(dataset, dimensions, container_type, group_type, **kwargs)
def redim(cls, dataset, dimensions): return PandasInterface.redim(dataset, dimensions)
def select(cls, dataset, selection_mask=None, **selection): from holoviews.core.data import PandasInterface return PandasInterface.select(dataset, selection_mask, **selection)
def redim(cls, dataset, dimensions): from holoviews.core.data import PandasInterface return PandasInterface.redim(dataset, dimensions)
def shape(cls, dataset): from holoviews.core.data import PandasInterface return PandasInterface.shape(dataset)
def groupby(cls, columns, dimensions, container_type, group_type, **kwargs): from holoviews.core.data import PandasInterface return PandasInterface.groupby(columns, dimensions, container_type, group_type, **kwargs)