Skip to content

Joiner

srai.joiners.Joiner

Bases: ABC

Abstract class for joiners.

transform(regions, features)

abstractmethod

Join features to regions.

PARAMETER DESCRIPTION
regions

regions with which features are joined

TYPE: GeoDataFrame

features

features to be joined

TYPE: GeoDataFrame

Returns: GeoDataFrame with an intersection of regions and features, which contains 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