momepy.
StreetAlignment
(left, right, orientations, network_id=None, left_network_id=None, right_network_id=None)[source]¶Calculate the difference between street orientation and orientation of object in degrees
Orientation of street segment is represented by the orientation of line
connecting first and last point of the segment. Network ID linking each object
to specific street segment is needed. Can be generated by momepy.get_network_id()
.
Either network_id or left_network_id and right_network_id are required.
GeoDataFrame containing objects to analyse
GeoDataFrame containing street network
the name of the dataframe column, np.array, or pd.Series where is stored object orientation value
(can be calculated using momepy.Orientation()
)
the name of the column storing network ID in both left and right
the name of the left dataframe column, np.array, or pd.Series where is stored object network ID
the name of the right dataframe column, np.array, or pd.Series of streets with unique network id (has to be defined beforehand)
(can be defined using momepy.elements.unique_id()
)
Examples
>>> buildings_df['street_alignment'] = momepy.StreetAlignment(buildings_df, streets_df, 'orientation', 'nID', 'nID').series
100%|██████████| 144/144 [00:00<00:00, 529.94it/s]
>>> buildings_df['street_alignment'][0]
0.29073888476702336
Series containing resulting values
original left GeoDataFrame
original right GeoDataFrame
the name of the column storing network ID in both left and right
Series containing used left ID
Series containing used right ID
__init__
(self, left, right, orientations, network_id=None, left_network_id=None, right_network_id=None)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
|
Initialize self. |