Skip to main content
`Ctrl`+`K`

# aequilibrae.paths.SubAreaAnalysis

class aequilibrae.paths.SubAreaAnalysis(graph: Graph, subarea: GeoDataFrame, demand: DataFrame | AequilibraeMatrix, project=None)
  __init__(graph: Graph, subarea: GeoDataFrame, demand: DataFrame | AequilibraeMatrix, project=None)

    Construct a sub-area matrix from a provided sub-area GeoDataFrame using route choice.

    This class aims to provide a semi-automated method for constructing the sub-area matrix. The user should provide the Graph object, demand matrix, and a GeoDataFrame whose geometry union represents the desired sub-area. Perform a route choice assignment, then call the `post_process` method to obtain a sub-area matrix.

    Check how to run sub-area analysis here.

    Arguments:

      graph (`Graph`): AequilibraE graph object to use

      subarea (`gpd.GeoDataFrame`): A GeoPandas GeoDataFrame whose geometry union represents the sub-area.

      demand (`Union[pandas.DataFrame, AequilibraeMatrix]`): The demand matrix to provide to the route choice assignment.

  Methods

  `__init__`(graph, subarea, demand[, project]) | Construct a sub-area matrix from a provided sub-area GeoDataFrame using route choice.
  `post_process`([demand_cols]) | Apply the necessary post processing to the route choice assignment select link results.

  post_process(demand_cols=None)

    Apply the necessary post processing to the route choice assignment select link results.

    Arguments:

      demand_cols (Optional: `[list[str]]`): If provided, only construct the sub-area matrix for these demand matrices.

    Returns:

      sub_area_demand (`pd.DataFrame`): A DataFrame representing the sub-area demand matrix.