@@ -67,35 +67,35 @@ def on_iteration_complete(self, iteration: Union[int, str], impedance, gap):
6767 zone_data_df = self .model_system .zdata_forecast .get_zone_data ()
6868 try :
6969 import geopandas as gpd
70- zone_gdf = gpd .read_file (self .zone_gpkg_path , layer = 'polygons' )
71- # Join zone_gdf and zone_data_df using the index
72- zone_gdf = zone_gdf .join (zone_data_df , how = 'left' )
73- # Join parking_time into zone_gdf
74- zone_gdf = zone_gdf .join (self .parking_itme_df , how = 'left' )
75- # Write the updated GeoDataFrame to the result path
76- zone_gdf .to_file (self .result_path , layer = 'zone_data' , driver = 'GPKG' )
7770 except ImportError :
7871 raise ImportError ("geopandas is not installed. Please install it to use this feature to export GPKG data." )
72+ zone_gdf = gpd .read_file (self .zone_gpkg_path , layer = 'polygons' )
73+ # Join zone_gdf and zone_data_df using the index
74+ zone_gdf = zone_gdf .join (zone_data_df , how = 'left' )
75+ # Join parking_time into zone_gdf
76+ zone_gdf = zone_gdf .join (self .parking_itme_df , how = 'left' )
77+ # Write the updated GeoDataFrame to the result path
78+ zone_gdf .to_file (self .result_path , layer = 'zone_data' , driver = 'GPKG' )
7979
8080 def on_daily_results_aggregated (self , assignment_model , day_network ):
8181 if not self .is_last_iteration :
8282 return
8383 try :
8484 import geopandas as gpd
85- from .geodata_helpers import (
86- get_links ,
87- get_nodes ,
88- get_transit_lines ,
89- get_transit_segments
90- )
9185 except ImportError :
9286 raise ImportError ("geopandas is not installed. Please install it to use this feature to export GPKG data." )
87+ from utils .geodata_helpers import (
88+ get_links ,
89+ get_nodes ,
90+ get_transit_lines ,
91+ get_transit_segments
92+ )
9393
94- scenario = assignment_model .emme_scenario
94+ scenario = assignment_model .day_scenario
9595
9696 get_links (day_network , scenario ).to_file (self .result_path , layer = 'links' , driver = 'GPKG' )
9797 get_nodes (day_network , scenario ).to_file (self .result_path , layer = 'nodes' , driver = 'GPKG' )
9898 # Get the network and scenario from the assignment model
99- gpd .GeoDataFrame (get_transit_lines (day_network , scenario ), geom = None ).to_file (self .result_path , layer = 'transit_lines' , driver = 'GPKG' )
100- gpd .GeoDataFrame (get_transit_segments (day_network , scenario ), geom = None ).to_file (self .result_path , layer = 'transit_segments' , driver = 'GPKG' )
99+ gpd .GeoDataFrame (get_transit_lines (day_network , scenario ), geometry = None ).to_file (self .result_path , layer = 'transit_lines' , driver = 'GPKG' )
100+ gpd .GeoDataFrame (get_transit_segments (day_network , scenario ), geometry = None ).to_file (self .result_path , layer = 'transit_segments' , driver = 'GPKG' )
101101 # Get links and nodes from the network and scenario
0 commit comments