def create_shp_with_info(port_shp_file, deadweight_db, deadweight_table, source_csv_file, target_path, split_csv_file, format_txt_file, static_info_file_for_shp, shp_file, split_trajectory_degree): split_count = split_source_csv_file(source_csv_file, target_path, split_csv_file) port_service = PortService(port_shp_file) deadweights = DeadweightDB(deadweight_db) deadweights.init_ships_deadweight(deadweight_table) for i in range(split_count): os.chdir(os.path.join(target_path, str(i))) Utils.convert_csv_to_format_txt(split_csv_file, format_txt_file, port_service, split_trajectory_degree) Utils.get_trajectory_static_info_file(split_csv_file, deadweights, static_info_file_for_shp, static_info_file_header, split_trajectory_degree) Utils.create_shp(format_txt_file, shp_file) return
def get_for_analysis( deadweight_db, deadweight_table, source_csv_file, static_info_file_for_analysis, ): Utils.check_file_path(static_info_file_for_analysis) # get trajectory _info deadweights = DeadweightDB(deadweight_db) deadweights.init_ships_deadweight(deadweight_table) Utils.get_trajectory_static_info_file(source_csv_file, deadweights, static_info_file_for_analysis, static_info_file_header, Const.LINE_NO_SPLIT_DEGREE) return
def step6_get_static_info_file(file_name, static_info_file, degree_threshold): deadweights = DeadweightDB(Config.deadweight_db) deadweights.init_ships_deadweight(Config.deadweight_table) Utils.get_trajectory_static_info_file(file_name, deadweights, static_info_file, degree_threshold)