#-*- coding:utf-8 -*- import pymongo from Tokyo_logistic_topo.Tokyo_logic import TokyoTopo from Tokyo_logistic_topo.kml_tool import ITDKkml client = pymongo.MongoClient() col_second_node = client['itdk_level_new']['shankou_txt'] file_name = './file/link_shankou.kml' fkml = open(file_name, 'w') paint = ITDKkml(fkml) ggg = TokyoTopo() paint.setting_line(line_color='ffff3ef3', line_width=1.2, line_hight_start=0, line_hight_end=80000, altitudeMode='relativeToGround') paint.head() db_name = ['shankou'] for name in db_name: db = client[name] col_tree_node = db['tree_node'] col_map = db['map_logi2loca'] for node in col_tree_node.find(): if len(node['connect']) > 5: docu = col_map.find_one({'node_id': node['node_id']}) if docu['in']: min_dis = 10000 min_point = {} for second_node in col_second_node.find(): dis = ggg.get_distance(start=docu['new'], end=second_node['new']) if dis < min_dis:
#-*- coding:utf-8 -*- import pymongo from Tokyo_logistic_topo.Tokyo_logic import TokyoTopo instance = TokyoTopo() client = pymongo.MongoClient() db = client['fudao'] col_orignal_edge = client['itdkall_info']['edge_all'] #日本所有边 col_Tokyo_edge = db['edge_2ip'] #东京边 col_Tokyo_node = db['node_2ip'] #东京点 city = { 'left': 140.235070, 'bottom': 37.594311, 'top': 37.933283, 'right': 140.643564 } city2 = { 'left': 140.235070, 'bottom': 37.594311, 'top': 37.933283, 'right': 140.643564 } polygon = [{ 'longitude': 140.235070, 'latitude': 37.594313 }, { 'longitude': 140.235070, 'latitude': 37.933283 }, { 'longitude': 140.643564, 'latitude': 37.933283 }, {
#-*- coding:utf-8 -*- import pymongo from Tokyo_logistic_topo.Tokyo_logic import TokyoTopo instance = TokyoTopo() client = pymongo.MongoClient() db = client['xiantai'] col_orignal_edge = client['itdkall_info']['edge_all'] #日本所有边 col_Tokyo_edge = db['edge_2ip'] #东京边 col_Tokyo_node = db['node_2ip'] #东京点 city = { 'left': 140.1870668950105, 'bottom': 37.77120835568391, 'top': 38.72766513275968, 'right': 141.4196867813584 } city2 = { 'left': 140.61778950105, 'bottom': 38.005455683991, 'top': 38.4049333768, 'right': 141.149686781358 } polygon = [{ 'longitude': 140.920758784351, 'latitude': 38.00545568391 }, { 'longitude': 140.61778950105, 'latitude': 38.00545568391 }, { 'longitude': 140.61778950105, 'latitude': 38.4049333753 }, {
#-*- coding:utf-8 -*- import pymongo from Tokyo_logistic_topo.Tokyo_logic import TokyoTopo, ITDKkml client = pymongo.MongoClient() iii = TokyoTopo() col_edge1 = client['itdkall_info']['edge_location_degree'] col_edge2 = client['itdkall_info']['edge_static_short_250'] node11 = client['itdkall_info']['日本第二层的点'] # node11.drop() # for edge in col_edge1.find(): # flag = node11.find_one(edge['start']) # if not flag: # node11.insert_one(edge['start']) # flag = node11.find_one(edge['end']) # if not flag: # node11.insert_one(edge['end']) # for edge in col_edge2.find(): # flag = node11.find_one(edge['start']) # if not flag: # node11.insert_one(edge['start']) # flag = node11.find_one(edge['end']) # if not flag: # node11.insert_one(edge['end']) # print(node11.count()) filename_KML = './日本筛选后未处理所有点.kml' f = open(filename_KML, 'w') paint = ITDKkml(f) #paint.setting_line(line_hight_start=40000,line_hight_end=40000,line_width=5) paint.setting_point(icon_path='juanjo_Router.png', point_hight=80000,
#-*- coding:utf-8 -*- ''' 从日本拓扑中提取出东京的连接关系 ''' import pymongo from Tokyo_logistic_topo.Tokyo_logic import TokyoTopo instance = TokyoTopo() #client = pymongo.MongoClient('mongodb://*****:*****@121.49.99.14:30011') client = pymongo.MongoClient() db = client['Tokyo_leftdown_logistic'] col_orignal_edge = client['itdkall_info']['edge_all'] #日本所有边 col_Tokyo_edge = db['edge_2ip'] #东京边 col_Tokyo_node = db['node_2ip'] #东京点 city = { 'left': 137.6830770474682, 'bottom': 35.27848918550292, 'top': 36.76996236057688, 'right': 139.625875496657 } city2 = { 'left': 139.1199746227325, 'bottom': 35.25735973013384, 'top': 36.05993049070996, 'right': 139.7952979334208 } polygon = [{ 'longitude': 139.323717988167, 'latitude': 36.05993049070996 }, { 'longitude': 139.7952979334208, 'latitude': 35.96217128924244
#-*- coding:utf-8 -*- import pymongo from Tokyo_logistic_topo.Tokyo_logic import TokyoTopo instance = TokyoTopo() client = pymongo.MongoClient() db = client['chongsheng上'] col_orignal_edge = client['itdkall_info']['edge_all'] #日本所有边 col_Tokyo_edge = db['edge_2ip'] #东京边 col_Tokyo_node = db['node_2ip'] #东京点 city = { 'left': 127.845587, 'bottom': 26.523827, 'top': 26.893759, 'right': 128.308335 } city2 = { 'left': 127.643642, 'bottom': 26.071788, 'top': 26.426301, 'right': 127.850209 } polygon = [{ 'longitude': 127.8657612669696, 'latitude': 26.13483698438625 }, { 'longitude': 127.6811176008339, 'latitude': 26.06038880876092 }, { 'longitude': 127.6294172666856, 'latitude': 26.08176593884921 }, {
col_second.drop() flag_label = 1 for city_col in col_city_txt: col = db[city_col] for point in col.find(): docu = { 'longitude': point['longitude'], 'latitude': point['latitude'], 'new': point['new'], 'flag': flag_label } col_second.insert_one(docu) print("insert", city_col, point['_id'], flag_label) flag_label = flag_label + 1 #画图,边 iii = TokyoTopo() filename_KML = './file/日本整个第二层.kml' f = open(filename_KML, 'w') paint = ITDKkml(f) paint.setting_line(line_color='33ffff00', line_hight_start=40000, altitudeMode='absolute', line_hight_end=40000, line_width=1) #paint.setting_point(icon_path='juanjo_Router.png',point_hight=80000,point_scale=0.5) paint.head() for edge in col_edge_degree.find(): if iii.get_distance(start=edge['start'], end=edge['end']) < 400: flag1 = col_second.find_one({ 'longitude': edge['start']['longitude'],
#-*- coding:utf-8 -*- ''' 从日本拓扑中提取出东京的连接关系 ''' import pymongo from Tokyo_logistic_topo.Tokyo_logic import TokyoTopo instance = TokyoTopo() #client = pymongo.MongoClient('mongodb://*****:*****@121.49.99.14:30011') client = pymongo.MongoClient() db = client['Tokyo_top_straight_haha_logistic'] col_orignal_edge = client['itdkall_info']['edge_all'] #日本所有边 col_Tokyo_edge = db['edge_2ip'] #东京边 col_Tokyo_node = db['node_2ip'] #东京点 city = { 'left': 139.7141060655066, 'bottom': 36.35769222069168, 'top': 37.08784030782886, 'right': 140.2116932667467 } city2 = { 'left': 139.67972025601, 'bottom': 36.31095965970943, 'top': 36.82717099293689, 'right': 140.3060601170713 } polygon = [{ 'longitude': 139.7646974057792, 'latitude': 36.82717099293689 }, { 'longitude': 140.3060601170713,
#-*- coding:utf-8 -*- ''' 从日本拓扑中提取出东京的连接关系 ''' import pymongo from Tokyo_logistic_topo.Tokyo_logic import TokyoTopo instance = TokyoTopo() #client = pymongo.MongoClient('mongodb://*****:*****@121.49.99.14:30011') client = pymongo.MongoClient() col_orignal_edge = client['itdkall_info']['edge'] #日本所有边 col_Tokyo_edge = client['Tokyo_logistic']['edge_2ip'] #东京边 col_Tokyo_node = client['Tokyo_logistic']['node_2ip'] #东京点 city = { 'left': 139.2407294868936, 'bottom': 35.11414856596891, 'top': 36.5420248360459, 'right': 140.8770722805165 } polygon = [{ 'longitude': 140.5693025574302, 'latitude': 36.25539216903631 }, { 'longitude': 139.7197922881968, 'latitude': 36.39677915444565 }, { 'longitude': 139.542716084842, 'latitude': 36.30601547791137 }, { 'longitude': 139.0185846190601, 'latitude': 36.5420248360459 }, {
#-*- coding:utf-8 -*- import pymongo from Tokyo_logistic_topo.Tokyo_logic import TokyoTopo, ITDKkml client = pymongo.MongoClient() col_edge = client['itdkall_info']['edge_all'] col_edge_static = client['itdkall_info']['edge_static_short_200'] #找出日本所有边,以地理位置为端点 col_edge_static.drop() i = 0 erro = 0 cacu_dis = TokyoTopo() for edge in col_edge.find({}, {'_id': 0}, no_cursor_timeout=True): try: dis = cacu_dis.get_distance(start=edge['start'], end=edge['end']) if dis < 250 and dis > 1: docu = { 'start': { 'longitude': edge['start']['longitude'], 'latitude': edge['start']['latitude'] }, 'end': { 'longitude': edge['end']['longitude'], 'latitude': edge['end']['latitude'] } } flag = col_edge_static.find_one(docu) if not flag: col_edge_static.insert_one(docu) except: erro += 1 finally: