Ejemplo n.º 1
0
def BatchSelectLines(Candidatewaypath,savepath):
    """
    批量选出最终匹配的轨迹
    :param Candidatewaypath: 所有候选路线的txt路径
    :param savepath: kml保存路径
    :return:
    """
    txtlist = Common_Functions.findtxtpath(Candidatewaypath)
    for singletxt in txtlist:
        print(singletxt)
        (tempath, tempfilename) = os.path.split(singletxt)  # tempfilename为txt文件名(包含后缀)
        (trunkname, extension) = os.path.splitext(tempfilename)  # filename 为传入的txt文件名 extension为后缀
        kmlsavepath = os.path.join(savepath,trunkname)
        txtkmllinename = trunkname +".txt"
        if not os.path.isdir(kmlsavepath):
            os.mkdir(kmlsavepath)
        FinalLines(singletxt,kmlsavepath,os.path.join(kmlsavepath,txtkmllinename))
Ejemplo n.º 2
0
                dic[subway[0]] = pointCode[1]
        #print(f"{newdf.iloc[row, 1]},{newdf.iloc[row, 2]}CandidateWay>>>{str(dic)}")
        if dic:
            file.write("PointID-" + str(row + 1) + "CandidateWay>>>" +
                       str(dic) + "\n")
    file.close()


import time
start = time.time()
#FindPointCandidateWay_Grid("H:\GPS_Data\Road_Network\BYQBridge\TrunksArea\\b79a4749-6228-4e47-8c1e-4e5c5dce8a53.csv","H:\GPS_Data\Road_Network\BYQBridge\CandidateWay\Grid\BYC","b79a4749-6228-4e47-8c1e-4e5c5dce8a53")
#SelectFinalRoutes("H:\GPS_Data\Road_Network\BYQBridge\CandidateWay\Grid\BYC\\10706a7b-3d56-4551-9a09-debda7d2c032.txt","H:\GPS_Data\Road_Network\BYQBridge\FinalRoutes\Grid\BYC")
# for subpath in Common_Functions.findtxtpath("H:\GPS_Data\Road_Network\BYQBridge\CandidateWay\\NewStrategy"):
#     (tempath, tempfilename) = os.path.split(subpath)  # tempfilename为txt文件名(包含后缀)
#     (trunkname, extension) = os.path.splitext(tempfilename)  # filename 为文件名 extension为后缀
#     csvfile = trunkname + ".csv"
#     FindPointCandidateWay_Grid(
#         os.path.join("H:\GPS_Data\Road_Network\BYQBridge\TrunksArea",csvfile),
#         "H:\GPS_Data\Road_Network\BYQBridge\CandidateWay\Grid\BYC", trunkname)

#最终路线
for subpath in Common_Functions.findtxtpath(
        "H:\GPS_Data\Road_Network\BYQBridge\CandidateWay\Grid\BYC"):
    print(subpath)
    SelectFinalRoutes(
        subpath, "H:\GPS_Data\Road_Network\BYQBridge\FinalRoutes\Grid\BYC")
#FindPointCandidateWay_Grid("H:\GPS_Data\Road_Network\BYQBridge\TrunksArea\\334e4763-f125-425f-ae42-8028245764fe.csv","H:\GPS_Data\Road_Network\BYQBridge\CandidateWay\Grid\BYC","334e4763-f125-425f-ae42-8028245764fe")

#SelectFinalRoutes("H:\GPS_Data\Road_Network\BYQBridge\CandidateWay\Grid\BYC\\99b9e495-22f3-4dd2-81e1-a946b3805229.txt","H:\GPS_Data\Road_Network\BYQBridge\FinalRoutes\Grid\BYC")

print(time.time() - start)
Ejemplo n.º 3
0
def BatchSelectFinalRoute(Candidatewaypath, finalroutepath):
    candidatetxts = Common_Functions.findtxtpath(Candidatewaypath)
    for subway in candidatetxts:
        print(subway)
        SelectFinalRoute(subway, finalroutepath)