momepy.shared_walls¶
Calculate the length of shared walls of adjacent elements (typically buildings).
Note that data needs to be topologically correct. Overlapping polygons will lead to incorrect results.
Adapted from [Hamaina et al., 2012].
A GeoDataFrame or GeoSeries containing polygons to analyse.
Perform calculations based on strict contiguity. If set to False, consider overlapping or nearly overlapping polygons as touching.
Tolerance for non-strict calculations, if strict is True, tolerance has no effect on the results.
Series
Examples
>>> path = momepy.datasets.get_path("bubenec") >>> buildings = geopandas.read_file(path, layer="buildings") >>> momepy.shared_walls(buildings) 0 0.000000 1 33.805154 2 39.766297 3 40.604643 4 40.455735 ... 139 9.886397 140 0.000000 141 0.000000 142 19.332735 143 10.876113 Name: shared_walls, Length: 144, dtype: float64