city2 = { 'left': 133.534168, 'bottom': 34.450546, 'top': 34.756779, 'right': 134.203184 } polygon = [{ 'longitude': 133.534168, 'latitude': 34.450546 }, { 'longitude': 133.534168, 'latitude': 34.756779 }, { 'longitude': 134.203184, 'latitude': 34.756779 }, { 'longitude': 134.203184, 'latitude': 34.450546 }] col_Tokyo_tree = db['tree'] col_Tokyo_tree_node = db['tree_node'] col_map = db['map_logi2loca'] # instance.extract_tokyo(col_Tokyo_node=col_Tokyo_node,col_Tokyo_edge=col_Tokyo_edge,city=city,col_orignal_edge=col_orignal_edge) # instance.tokyo2tree(col_Tokyo_node=col_Tokyo_node,col_Tokyo_tree=col_Tokyo_tree,col_Tokyo_tree_node=col_Tokyo_tree_node,col_map=col_map,file='冈山.txt') instance.coor2japan(city=city2, col_map=col_map, txt_name='gangshan_dire.txt') col_parent = db['parent'] instance.delete_point_of_polygon(polygon=polygon, col_map=col_map) instance.geneKML(col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file_name='冈山.kml')
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 }, { 'longitude': 141.1496867813584, 'latitude': 38.4049333753 }] col_Tokyo_tree = db['tree'] col_Tokyo_tree_node = db['tree_node'] col_map = db['map_logi2loca'] # instance.extract_tokyo(col_Tokyo_node=col_Tokyo_node,col_Tokyo_edge=col_Tokyo_edge,city=city,col_orignal_edge=col_orignal_edge) # instance.tokyo2tree(col_Tokyo_node=col_Tokyo_node,col_Tokyo_tree=col_Tokyo_tree,col_Tokyo_tree_node=col_Tokyo_tree_node,col_map=col_map,file='xiantai.txt') instance.coor2japan(city=city2, col_map=col_map, txt_name='dire_xiantai.txt') col_parent = db['parent'] instance.delete_point_of_polygon(polygon=polygon, col_map=col_map) instance.geneKML(col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file_name='xiantai.kml')
'top': 36.05993049070996, 'right': 139.7952979334208 } polygon = [{ 'longitude': 139.323717988167, 'latitude': 36.05993049070996 }, { 'longitude': 139.7952979334208, 'latitude': 35.96217128924244 }, { 'longitude': 139.541217788369, 'latitude': 35.30327189872084 }, { 'longitude': 139.1199746227325, 'latitude': 35.25735973013384 }] col_Tokyo_tree = db['tree'] col_Tokyo_tree_node = db['tree_node'] col_map = db['map_logi2loca'] #instance.extract_tokyo(col_Tokyo_node=col_Tokyo_node,col_Tokyo_edge=col_Tokyo_edge,city=city,col_orignal_edge=col_orignal_edge) #instance.tokyo2tree(col_Tokyo_node=col_Tokyo_node,col_Tokyo_tree=col_Tokyo_tree,col_Tokyo_tree_node=col_Tokyo_tree_node,col_map=col_map,file='tree_data_left_down.txt') instance.coor2japan(city=city2, col_map=col_map, txt_name='PajekData_left_down.txt') col_parent = db['parent'] instance.delete_point_of_polygon(polygon=polygon, col_map=col_map) instance.geneKML(col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file_name='Tokyo_left_down.kml')
'longitude': 140.235070, 'latitude': 37.594313 }, { 'longitude': 140.235070, 'latitude': 37.933283 }, { 'longitude': 140.643564, 'latitude': 37.933283 }, { 'longitude': 140.6435641, 'latitude': 37.59431 }] col_Tokyo_tree = db['tree'] col_Tokyo_tree_node = db['tree_node'] col_map = db['map_logi2loca'] instance.extract_tokyo(col_Tokyo_node=col_Tokyo_node, col_Tokyo_edge=col_Tokyo_edge, city=city, col_orignal_edge=col_orignal_edge) instance.tokyo2tree(col_Tokyo_node=col_Tokyo_node, col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file='fudao.txt') instance.coor2japan(city=city2, col_map=col_map, txt_name='fudao_dire.txt') col_parent = db['parent'] instance.delete_point_of_polygon(polygon=polygon, col_map=col_map) instance.geneKML(col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file_name='fudao.kml')
city2 = { 'left': 138.313450, 'bottom': 34.941465, 'top': 35.034162, 'right': 138.522456 } polygon = [{ 'longitude': 138.313450, 'latitude': 34.941465 }, { 'longitude': 138.313450, 'latitude': 35.034162 }, { 'longitude': 138.522456, 'latitude': 35.034162 }, { 'longitude': 138.522456, 'latitude': 34.941465 }] col_Tokyo_tree = db['tree'] col_Tokyo_tree_node = db['tree_node'] col_map = db['map_logi2loca'] # instance.extract_tokyo(col_Tokyo_node=col_Tokyo_node,col_Tokyo_edge=col_Tokyo_edge,city=city,col_orignal_edge=col_orignal_edge) # instance.tokyo2tree(col_Tokyo_node=col_Tokyo_node,col_Tokyo_tree=col_Tokyo_tree,col_Tokyo_tree_node=col_Tokyo_tree_node,col_map=col_map,file='jinggang.txt') instance.coor2japan(city=city2, col_map=col_map, txt_name='jinggang_dire.txt') col_parent = db['parent'] instance.delete_point_of_polygon(polygon=polygon, col_map=col_map) instance.geneKML(col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file_name='jinggang.kml')
#-*- coding:utf-8 -*- import pymongo from Tokyo_logistic_topo.Tokyo_logic import TokyoTopo instance = TokyoTopo() client = pymongo.MongoClient() db = client['gongqi'] col_orignal_edge = client['itdkall_info']['edge_all']#日本所有边 col_Tokyo_edge = db['edge_2ip']#东京边 col_Tokyo_node = db['node_2ip']#东京点 city={'left':130.2297,'bottom':30.74 ,'top':33.29,'right':131.58} city2={'left':131.2297,'bottom':31.74 ,'top':32.29,'right':131.58} polygon = [{'longitude':131.4615597,'latitude':31.790734}, {'longitude':131.2217105,'latitude': 31.8342453}, {'longitude':131.286419,'latitude': 32.2768983}, {'longitude':131.563294,'latitude': 32.251231}] col_Tokyo_tree = db['tree'] col_Tokyo_tree_node = db['tree_node'] col_map = db['map_logi2loca'] # instance.extract_tokyo(col_Tokyo_node=col_Tokyo_node,col_Tokyo_edge=col_Tokyo_edge,city=city,col_orignal_edge=col_orignal_edge) # instance.tokyo2tree(col_Tokyo_node=col_Tokyo_node,col_Tokyo_tree=col_Tokyo_tree,col_Tokyo_tree_node=col_Tokyo_tree_node,col_map=col_map,file='gongqi.txt') instance.coor2japan(city=city2,col_map=col_map,txt_name='gongqi_dire.txt') col_parent = db['parent'] instance.delete_point_of_polygon(polygon=polygon,col_map=col_map) instance.geneKML(col_Tokyo_tree=col_Tokyo_tree,col_Tokyo_tree_node=col_Tokyo_tree_node,col_map=col_map,file_name='gongqi.kml')
city2 = { 'left': 132.678197, 'bottom': 35.270643, 'top': 35.522540, 'right': 133.247941 } polygon = [{ 'longitude': 132.678197, 'latitude': 35.220643 }, { 'longitude': 132.678197, 'latitude': 35.472540 }, { 'longitude': 133.247941, 'latitude': 35.472540 }, { 'longitude': 133.247941, 'latitude': 35.220643 }] col_Tokyo_tree = db['tree'] col_Tokyo_tree_node = db['tree_node'] col_map = db['map_logi2loca'] # instance.extract_tokyo(col_Tokyo_node=col_Tokyo_node,col_Tokyo_edge=col_Tokyo_edge,city=city,col_orignal_edge=col_orignal_edge) # instance.tokyo2tree(col_Tokyo_node=col_Tokyo_node,col_Tokyo_tree=col_Tokyo_tree,col_Tokyo_tree_node=col_Tokyo_tree_node,col_map=col_map,file='chuyun.txt') instance.coor2japan(city=city2, col_map=col_map, txt_name='chuyun_dire.txt') col_parent = db['parent'] instance.delete_point_of_polygon(polygon=polygon, col_map=col_map) instance.geneKML(col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file_name='出云.kml')
'bottom': 36.31095965970943, 'top': 36.82717099293689, 'right': 140.3060601170713 } polygon = [{ 'longitude': 139.7646974057792, 'latitude': 36.82717099293689 }, { 'longitude': 140.3060601170713, 'latitude': 36.71236722257246 }, { 'longitude': 140.2128606224743, 'latitude': 36.31095965970943 }, { 'longitude': 139.679720256011, 'latitude': 36.37182624266654 }] col_Tokyo_tree = db['tree'] col_Tokyo_tree_node = db['tree_node'] col_map = db['map_logi2loca'] #instance.extract_tokyo(col_Tokyo_node=col_Tokyo_node,col_Tokyo_edge=col_Tokyo_edge,city=city,col_orignal_edge=col_orignal_edge) #instance.tokyo2tree(col_Tokyo_node=col_Tokyo_node,col_Tokyo_tree=col_Tokyo_tree,col_Tokyo_tree_node=col_Tokyo_tree_node,col_map=col_map,file='tree_data_top_straight.txt') instance.coor2japan(city=city2, col_map=col_map, txt_name='Pajektopstraight.txt') col_parent = db['parent'] instance.delete_point_of_polygon(polygon=polygon, col_map=col_map) instance.geneKML(col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file_name='Tokyo_topstraight.kml')
'longitude': 140.2169898949832, 'latitude': 36.28099751420809 }, { 'longitude': 140.5788756253149, 'latitude': 36.25983049995579 }, { 'longitude': 140.6565614290742, 'latitude': 36.55309693386927 }] col_Tokyo_tree = db['tree'] col_Tokyo_tree_node = db['tree_node'] col_map = db['map_logi2loca'] instance.extract_tokyo(col_Tokyo_node=col_Tokyo_node, col_Tokyo_edge=col_Tokyo_edge, city=city, col_orignal_edge=col_orignal_edge) instance.tokyo2tree(col_Tokyo_node=col_Tokyo_node, col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file='tree_data_top.txt') instance.coor2japan(city=city2, col_map=col_map, txt_name='PajekData_top.txt') col_parent = db['parent'] #instance.leaf2star(col_Tokyo_tree_node=col_Tokyo_tree_node,col_Tokyo_tree=col_Tokyo_tree,col_map=col_map,col_parent=col_parent) instance.delete_point_of_polygon(polygon=polygon, col_map=col_map) #instance.new_tree(col_Tokyo_tree=col_Tokyo_tree,col_Tokyo_tree_node=col_Tokyo_tree_node,col_map=col_map) instance.geneKML(col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file_name='Tokyo_top.kml') #instance.geneKML_no_leaf(col_Tokyo_tree=col_Tokyo_tree,col_map=col_map,col_Tokyo_tree_node=col_Tokyo_tree_node,file_name=r'Tokyo_no_leaf_left.kml')
city2 = { 'left': 140.994276, 'bottom': 39.427615, 'top': 39.985789, 'right': 141.511871 } polygon = [{ 'longitude': 140.994276, 'latitude': 39.427615 }, { 'longitude': 140.994276, 'latitude': 39.985789 }, { 'longitude': 141.511871, 'latitude': 39.985789 }, { 'longitude': 141.511871, 'latitude': 39.427615 }] col_Tokyo_tree = db['tree'] col_Tokyo_tree_node = db['tree_node'] col_map = db['map_logi2loca'] # instance.extract_tokyo(col_Tokyo_node=col_Tokyo_node,col_Tokyo_edge=col_Tokyo_edge,city=city,col_orignal_edge=col_orignal_edge) # instance.tokyo2tree(col_Tokyo_node=col_Tokyo_node,col_Tokyo_tree=col_Tokyo_tree,col_Tokyo_tree_node=col_Tokyo_tree_node,col_map=col_map,file='yanshou.txt') instance.coor2japan(city=city2, col_map=col_map, txt_name='yanshou_dire.txt') col_parent = db['parent'] instance.delete_point_of_polygon(polygon=polygon, col_map=col_map) instance.geneKML(col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file_name='岩手.kml')
}, { 'longitude': 136.3356422274075, 'latitude': 36.36336780402993 }, { 'longitude': 137.436950362798, 'latitude': 36.60520135863723 }, { 'longitude': 137.3767301275331, 'latitude': 36.78050958658395 }, { 'longitude': 137.1122860874214, 'latitude': 36.77379878379396 }, { 'longitude': 136.9916, 'latitude': 36.8656 }, { 'longitude': 136.9916, 'latitude': 37.0599878379396 }] col_Tokyo_tree = db['tree'] col_Tokyo_tree_node = db['tree_node'] col_map = db['map_logi2loca'] # instance.extract_tokyo(col_Tokyo_node=col_Tokyo_node,col_Tokyo_edge=col_Tokyo_edge,city=city,col_orignal_edge=col_orignal_edge) # instance.tokyo2tree(col_Tokyo_node=col_Tokyo_node,col_Tokyo_tree=col_Tokyo_tree,col_Tokyo_tree_node=col_Tokyo_tree_node,col_map=col_map,file='jinze.txt') instance.coor2japan(city=city2, col_map=col_map, txt_name='dire_jinze.txt') col_parent = db['parent'] instance.delete_point_of_polygon(polygon=polygon, col_map=col_map) instance.geneKML(col_Tokyo_tree=col_Tokyo_tree, col_Tokyo_tree_node=col_Tokyo_tree_node, col_map=col_map, file_name='jinze.kml')