cityImage.find_land_use_values_matching#

cityImage.find_land_use_values_matching(buildings_gdf, land_uses_column='land_uses', pattern='^shop', ignore_case=True, return_counts=True)[source]#

Find land-use labels in buildings_gdf[land_uses_column] matching a regex pattern.

Assumes cells contain either:
  • list[str] of labels, or

  • a scalar label (string), or

  • missing/empty.

Parameters:
  • buildings_gdf – GeoDataFrame / DataFrame with the land use column.

  • land_uses_column (str) – Column containing list-like or scalar land-use labels.

  • pattern (str) – Regex pattern to match labels (e.g. “^shop” matches “shop_*”).

  • ignore_case (bool) – If True uses case-insensitive matching.

  • return_counts (bool) – If True returns value_counts() of matched labels. If False returns sorted unique matched labels.

Returns:

Counts (Series) or sorted unique labels.

Return type:

Series | list[str]