-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_roadtype2_2.py
101 lines (88 loc) · 5.45 KB
/
main_roadtype2_2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import os
from test import *
import sys
from RoadNetwortLable_by_each_road_roadtype import *
from concat_all_label_image_roadtype import *
from GT_post_processing_roadtype import *
from shp2txt_transform_roadtype import *
from mapcompare_roadtype import *
from mapcompare_roadtype_OSM import *
sys.path.append('topology_construction')
from topology_construction.transform_graph_main_roadtype import *
import glob
import PIL
from PIL import Image
import pandas as pd
import numpy as np
PIL.Image.MAX_IMAGE_PIXELS = None
import datetime
def main():
print("Hello World")
#test()
with open("time_log_roadtype2_2.txt","w") as log_f:
for year in [2021]:
for county in ['jiangzixian','honghexian','liboxian']:
now_time = datetime.datetime.now()
# log_f.write(county + ' ' +str(year) + ' ' +str(now_time))
# log_f.write('\n')
# print(county, ' ', year)
# RoadNetwortLable_by_each_road_roadtype(year,county)
# now_time = datetime.datetime.now()
# log_f.write(county + ' ' +str(year) +' '+'RoadNetwortLable_by_each_road'+ ' '+str(now_time))
# log_f.write('\n')
# concat_all_label_image_roadtype(year,county)
# now_time = datetime.datetime.now()
# log_f.write(county+ ' ' +str(year) +' '+'concat_all_label_image'+ ' '+str(now_time))
# log_f.write('\n')
# GT_post_processing_roadtype(year,county)
# now_time = datetime.datetime.now()
# log_f.write(county+ ' ' +str(year) + ' '+'GT_post_processing'+ ' '+str(now_time))
# log_f.write('\n')
# transform_graph_main_roadtype(year,county)
# now_time = datetime.datetime.now()
# log_f.write(county+ ' ' +str(year) + ' '+'transform_graph_main'+ ' '+str(now_time))
# log_f.write('\n')
shp2txt_transform_roadtype(year,county)
now_time = datetime.datetime.now()
log_f.write(county+' ' +str(year) +' '+'shp2txt_transform'+ ' '+str(now_time))
log_f.write('\n')
mapcompare_roadtype('../temp_output_d500/GraphSamplingToolkit-main',county, 'xyx', 'LCR', year,'d500')
now_time = datetime.datetime.now()
log_f.write(county+' ' +str(year) +' '+'d500_mapcompare'+ ' '+str(now_time))
log_f.write('\n')
mapcompare_roadtype_OSM('../temp_output_OSM/GraphSamplingToolkit-main',county, 'xyx', 'LCR', year+1,'OSM')
now_time = datetime.datetime.now()
log_f.write(county+' ' +str(year) +' '+'OSM_mapcompare'+ ' '+str(now_time))
log_f.write('\n')
mapcompare_roadtype('../temp_output_b1/GraphSamplingToolkit-main',county, 'xyx', 'LCR', year,'b1')
now_time = datetime.datetime.now()
log_f.write(county+' ' +str(year) +' '+'b1_mapcompare'+ ' '+str(now_time))
log_f.write('\n')
mapcompare_roadtype('../temp_output_b2/GraphSamplingToolkit-main',county, 'xyx', 'LCR', year,'b2')
now_time = datetime.datetime.now()
log_f.write(county+' ' +str(year) +' '+'b2_mapcompare'+ ' '+str(now_time))
log_f.write('\n')
print('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
print('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
print(str(county),str(year),'done')
print('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
print('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
# for roadclass in [49,41000,42000,43000,44000,45000,47000,51000,52000,53000,54000]:
# if not os.path.exists('../temp_output_roadtype/'+county+'_road_label_by_image_'+str(roadclass)+'_'+str(year)):
# continue
# del_list = os.listdir('../temp_output_roadtype/'+county+'_road_label_by_image_'+str(roadclass)+'_'+str(year)+'/')
# for f in del_list:
# file_path = os.path.join('../temp_output_roadtype/'+county+'_road_label_by_image_'+str(roadclass)+'_'+str(year)+'/', f)
# if os.path.isfile(file_path):
# os.remove(file_path)
# if not os.path.exists('../temp_output_roadtype/'+county+'_width3_'+str(roadclass)+'_'+str(year)):
# continue
# del_list = os.listdir('../temp_output_roadtype/'+county+'_width3_'+str(roadclass)+'_'+str(year)+'/')
# for f in del_list:
# file_path = os.path.join('../temp_output_roadtype/'+county+'_width3_'+str(roadclass)+'_'+str(year)+'/', f)
# if os.path.isfile(file_path):
# os.remove(file_path)
# os.removedirs('../temp_output_roadtype/'+county+'_road_label_by_image_'+str(roadclass)+'_'+str(year))
# os.removedirs('../temp_output_roadtype/'+county+'_width3_'+str(roadclass)+'_'+str(year))
if __name__=="__main__":
main()