plot_region_geometry_layer
site.SiteProblem.plot_region_geometry_layer(
interactive=False,
plot_demand=False,
plot_equity=False,
cmap='Blues',
tiles='CartoDB positron',
plot_region_of_interest_only=False,
edgecolor='black',
linewidth=0.5,
**kwargs,
)Visualize the regional geometry layer, optionally overlaid with demand data.
This method produces either a static matplotlib plot or an interactive Folium map (via Geopandas’ .explore()). If demand plotting is enabled, it performs an internal join between geometry and demand data to create a choropleth map.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| interactive | bool | If True, returns a folium.Map object using the ‘explore’ backend. If False, returns a matplotlib.axes.Axes object. | False |
| plot_demand | bool | If True, merges the geometry with the demand dataset and styles the regions based on the demand column values. | False |
| cmap | Colour map to be used for plotting demand. Ignored if plot_demand=False. | 'Blues' |
|
| tiles | Tiles to be used for background in map. Ignored if interactive = False. | 'CartoDB positron' |
|
| **kwargs | dict | Additional keyword arguments passed to either geopandas.GeoDataFrame.plot or geopandas.GeoDataFrame.explore. |
{} |
Returns
| Name | Type | Description |
|---|---|---|
| matplotlib.axes.Axes or folium.Map | The plotting object depending on the interactive parameter. |
Raises
| Name | Type | Description |
|---|---|---|
| ValueError | If self.region_geometry_layer has not been initialized. |
|
| ValueError | If plot_demand is True but self.demand_data is None. |
Notes
When plot_demand is True, the method performs a merge using: - self._region_geometry_layer_common_col (left) - self._demand_data_id_col (right)
Interactive maps default to the “CartoDB positron” tile set and the “Blues” colormap for demand visualization.