momepy.StreetAlignment#
- class 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()
. Eithernetwork_id
or bothleft_network_id
andright_network_id
are required.\[\left|{\textit{building orientation} - \textit{street orientation}}\right|\]- Parameters
- leftGeoDataFrame
GeoDataFrame containing objects to analyse
- rightGeoDataFrame
GeoDataFrame containing street network
- orientationsstr, list, np.array, pd.Series
the name of the dataframe column,
np.array
, orpd.Series
where is stored object orientation value (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 is stored object network ID- 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 id (has to be defined beforehand) (can be defined usingmomepy.unique_id()
)
Examples
>>> buildings_df['street_alignment'] = momepy.StreetAlignment(buildings_df, ... streets_df, ... 'orientation', ... 'nID', ... 'nID').series >>> buildings_df['street_alignment'][0] 0.29073888476702336
- Attributes
- seriesSeries
Series containing resulting values
- leftGeoDataFrame
original left GeoDataFrame
- rightGeoDataFrame
original right GeoDataFrame
- network_idstr
the name of the column storing network ID in both left and right
- left_network_idSeries
Series containing used left ID
- right_network_idSeries
Series containing used right ID
- __init__(left, right, orientations, network_id=None, left_network_id=None, right_network_id=None)[source]#
Methods
__init__
(left, right, orientations[, ...])