API Reference¶
utdf2gmns main functions¶
- utdf2gmns.generate_movement_utdf(input_dir: str = '', city_name: str = '', output_dir: str = '', path_utdf_intersection: str = '', isSave2csv: bool = True) list¶
generate movement_utdf.csv file from merging UTDF file to GMNS movement.csv file
- Parameters:
input_dir (str, optional) – the path of input directory, by default “”, which means current working directory
city_name (str, optional) – the name of the city where the UTDF file is located, by default “”
UTDF_file (str, optional) – the name of UTDF file, by default None
node_file (str, optional) – the name of node.csv file, by default None
movement_file (str, optional) – the name of movement.csv file, by default None
output_dir (str, optional) – the path of output directory, by default “”, which means the same as input directory
isSave2csv (bool, optional) – whether to save the movement_utdf.csv file, by default True
- Returns:
a list of movement_utdf.csv file
- Return type:
list
utdf2gmns helper functions¶
- utdf2gmns.read_UTDF_file(path_utdf: str) dict¶
read the utdf.csv file and return a dictionary of dataframes
- Parameters:
path_utdf (str) – path to the utdf.csv file
- Returns:
a dictionary of dataframes with keys are Network, Nodes, Links, Lanes, Timeplans, Phases
- Return type:
dict
- utdf2gmns.match_intersection_node(df_intersection_geo: pandas.DataFrame, df_node: pandas.DataFrame, max_distance_threshold=0.1) pandas.DataFrame¶
match_intersection_node: match intersection with node
- Parameters:
df_intersection_geo (pd.DataFrame) – dataframe of intersection with coordinates
df_node (pd.DataFrame) – dataframe of node
max_distance_threshold (float, optional) – maximum distance from the given point, defaults to 0.1
- Returns:
dataframe of intersection_node
- Return type:
pd.DataFrame
- utdf2gmns.match_movement_and_intersection_node(df_movement: pandas.DataFrame, df_intersection_node: pandas.DataFrame) pandas.DataFrame¶
match_movement_and_intersection_node: match movement with intersection_node
- Parameters:
df_movement (pd.DataFrame) – dataframe of movement
df_intersection_node (pd.DataFrame) – dataframe of intersection_node
- Returns:
matched dataframe of movement and intersection_node
- Return type:
pd.DataFrame
- utdf2gmns.match_movement_utdf_lane(df_movement_intersection: pandas.DataFrame, utdf_dict_data: dict) pandas.DataFrame¶
match_movement_utdf_lane: match movement with utdf lane
- Parameters:
df_movement_intersection (pd.DataFrame) – dataframe of movement_intersection
utdf_dict_data (dict) – dictionary of utdf data with key of “Lanes”
- Returns:
matched dataframe of movement and utdf lane
- Return type:
pd.DataFrame
- utdf2gmns.match_movement_utdf_phase_timeplans(df_movement_utdf_lane: pandas.DataFrame, utdf_dict_data: dict) pandas.DataFrame¶
match_movement_utdf_phase_timeplans: match movement with utdf phase timeplans
- Parameters:
df_movement_utdf_lane (pd.DataFrame) – dataframe of movement_utdf_lane
utdf_dict_data (dict) – dictionary of utdf data with key of “phase_timeplans”
- Returns:
matched dataframe of movement and utdf phase timeplans
- Return type:
pd.DataFrame