cartagen.typify_buildings_matching

cartagen.typify_buildings_matching#

typify_buildings_matching(buildings, initial_scale=25000, final_scale=50000, ratio=None, road_network=None, attributes=None, distance=20.0)#

Typify buildings using the matching-based algorithm for web mapping.

This algorithm was proposed by Li et al. [1] and replace tight groups of buildings with a single representative building.

The algorithm follows three main steps: First, it finds the number of buildings using improved radical law. Second, it calculates the position and representation through iterative merging. Finally, building sizes are harmonized.

Parameters:
  • buildings (GeoDataFrame of Polygon or MultiPolygon) – The buildings to typify

  • initial_scale (int, optional) – Source map scale denominator (default: 25000)

  • final_scale (int, optional) – Target map scale denominator (default: 50000)

  • ratio (float, optional) – Ratio between source and target number of buildings (e.g., 0.5 to reduce by half) If None, will be computed from initial_scale and final_scale

  • road_network (GeoDataFrame of LineString, optional) – Road network for spatial partitioning. If None, simple grid partitioning is used

  • attributes (List[str], optional) – List of attribute names to transfer from largest building in each cluster

  • distance (float, optional) – Minimum separate distance for building harmonization (in map units)

Returns:

GeoDataFrame of Polygon or MultiPolygon – Typified buildings with transferred attributes

See also

typify_buildings_burghardt_cecconi

Typify buildings using the Burghardt-Cecconi algorithm.

References

(Source code)

../_images/typify_buildings_matching.png