momepy.StreetAlignment#
- 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 another object in degrees. The orientation of a street segment is represented by the orientation of line connecting the first and the last point of the segment. A network ID linking each object to specific street segment is needed, and can be generated by
momepy.get_network_id()
. Eithernetwork_id
or bothleft_network_id
andright_network_id
are required.\[\left|{\textit{building orientation} - \textit{street orientation}}\right|\]- Parameters:
- leftGeoDataFrame
A GeoDataFrame containing objects to analyse.
- rightGeoDataFrame
A GeoDataFrame containing a street network.
- orientationsstr, list, np.array, pd.Series
The name of the dataframe column,
np.array
, orpd.Series
where object orientation values are stored. The object can be calculated usingmomepy.Orientation
.- network_idstr (default None)
The name of the column storing network ID in both left and right.
- left_network_idstr, list, np.array, pd.Series (default None)
The name of the left dataframe column,
np.array
, orpd.Series
where object network IDs are stored.- right_network_idstr, list, np.array, pd.Series (default None)
The name of the right dataframe column,
np.array
, orpd.Series
of streets with unique network IDs. These IDs have to be defined beforehand and can be defined usingmomepy.unique_id()
.
- Attributes:
- seriesSeries
A Series containing resulting values.
- leftGeoDataFrame
The original
left
GeoDataFrame.- rightGeoDataFrame
The original
right
GeoDataFrame.- network_idstr
The name of the column storing network ID in both
left
andright
.- left_network_idSeries
A Series containing used
left
ID.- right_network_idSeries
A Series containing used
right
ID.
Examples
>>> buildings_df['street_alignment'] = momepy.StreetAlignment(buildings_df, ... streets_df, ... 'orientation', ... 'nID', ... 'nID').series >>> buildings_df['street_alignment'][0] 0.29073888476702336