Exemplo n.º 1
0
    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'],
            'latitude': edge['start']['latitude']
        })
        flag2 = col_second.find_one({
            'longitude': edge['end']['longitude'],
            'latitude': edge['end']['latitude']
        })
        if flag1 and flag2:
            if flag1['flag'] == flag2['flag']:
                pass
            else:
                paint.draw_edge(start=flag1['new'], end=flag2['new'])
        elif flag1 and not flag2:
            paint.draw_edge(start=flag1['new'], end=edge['end'])
Exemplo n.º 2
0
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:
                        min_dis = dis
                        min_point = second_node['new']
                paint.draw_edge(start=docu['new'], end=min_point)
paint.tail()
fkml.close()
Exemplo n.º 3
0
#-*- 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: