Skip to content

Joiner

srai.joiners.Joiner

Bases: abc.ABC

Abstract class for joiners.

transform(regions, features)

abstractmethod

Join features to regions.

PARAMETER DESCRIPTION
regions

regions with which features are joined

TYPE: gpd.GeoDataFrame

features

features to be joined

TYPE: gpd.GeoDataFrame

RETURNS DESCRIPTION
gpd.GeoDataFrame

GeoDataFrame with an intersection of regions and features, which contains

gpd.GeoDataFrame

a MultiIndex and optionally a geometry with the intersection

Source code in srai/joiners/_base.py
@abc.abstractmethod
def transform(
    self,
    regions: gpd.GeoDataFrame,
    features: gpd.GeoDataFrame,
) -> gpd.GeoDataFrame:  # pragma: no cover
    """
    Join features to regions.

    Args:
        regions (gpd.GeoDataFrame): regions with which features are joined
        features (gpd.GeoDataFrame): features to be joined
    Returns:
        GeoDataFrame with an intersection of regions and features, which contains
        a MultiIndex and optionally a geometry with the intersection
    """
    raise NotImplementedError