Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
def check_file_by_creating_trajectory():
    mmsi = 215153000
    filename = r"D:\graduation\data\step_result\check\step4\trajectory_{}.csv".format(
        mmsi)
    target_file_name = r"D:\graduation\data\step_result\check\step4\trajectory_{}.txt".format(
        mmsi)
    port_name = r"D:\GeoData\Port\WPI.shp"
    degree_threshold = Const.LINE_NO_SPLIT_DEGREE

    port_service = PortService(port_name)
    Utils.convert_csv_to_format_txt(filename, target_file_name, port_service,
                                    degree_threshold)

    shp_file_name = r"D:\graduation\data\step_result\check\step4\trajectory_{}.shp".format(
        mmsi)
    Utils.create_shp(target_file_name, shp_file_name)
Ejemplo n.º 3
0
def check_result(output_ais_csv):
    format_ais_txt = output_ais_csv.replace(".csv", ".txt")
    format_output_ais_csv(output_ais_csv, format_ais_txt)

    Utils.create_shp(format_ais_txt, format_ais_txt.replace(".txt", ".shp"))
Ejemplo n.º 4
0
def step7_create_shp_file(file_name):
    Utils.create_shp(file_name.replace('.csv', '.txt'),
                     file_name.replace('.csv', '.shp'))