momepy.cell_alignment#
- momepy.cell_alignment(left_orientation, right_orientation)[source]#
Calculate the difference between cell orientation and the orientation of object.
\[\left|{\textit{building orientation} - \textit{cell orientation}}\right|\]- Parameters:
- left_orientationnp.array, pd.Series
The
np.array, or pd.Series` with orientation of cells. This can be calculated usingorientation().- right_orientationnp.array, pd.Series
The
np.arrayorpd.Serieswith orientation of objects. This can be calculated usingorientation().
- Returns:
- Series
Notes
left_orientationandright_orientationmust be aligned or have an index.Examples
>>> from libpysal import graph >>> path = momepy.datasets.get_path("bubenec") >>> buildings = geopandas.read_file(path, layer="buildings") >>> tessellation = momepy.morphological_tessellation(buildings)
Measure orientations:
>>> blg_orient = momepy.orientation(buildings) >>> tess_orient = momepy.orientation(tessellation)
Compute alignment:
>>> momepy.cell_alignment(blg_orient, tess_orient) 0 0.854788 1 20.829200 2 5.552120 3 4.052674 4 0.159289 ... 139 0.189750 140 17.920139 141 0.394787 142 0.014295 143 0.252122 Name: orientation, Length: 144, dtype: float64