Пример #1
0
def qiangzhijia_line_shp(r,f_dir):
    if qiangzhijia_line(r):
        p1_list,p2_list,total_distance,distancestr,type_str = qiangzhijia_line(r)
        directory = f_dir
        if not os.path.isdir(directory):
            os.mkdir(directory)
        fname = directory+'\\qiangzhijia_line.shp'
        lines = []
        for i in range(len(p1_list)):
            lines.append([p1_list[i],p2_list[i],distancestr[i],type_str[i],'','',''])
        wl.line_to_shp(lines,fname)
Пример #2
0
def yonghujierudian_jiliangxiang_line_shp(r,f_dir):
    p1_list,p2_list = yonghujierudian_jiliangxiang_line(r)

    directory = f_dir
    if not os.path.isdir(directory):
        os.mkdir(directory)
    fname = directory+'\\yonghujierudian_jiliangxiang_line'

    lines = []
    for i in range(len(p1_list)):
        lines.append([p1_list[i],p2_list[i],'','','','',''])
    wl.line_to_shp(lines,fname+'.shp')
Пример #3
0
def qiangzhijia_line2_shp(r,f_dir):
    if qiangzhijia_line2(r):
        p1_list,p2_list,_,distancestr,types = qiangzhijia_line2(r)
        # print p1_list
        # print p2_list
        directory = f_dir
        if not os.path.isdir(directory):
            os.mkdir(directory)
        fname = directory+'\\qiangzhijia_line2.shp'
        lines = []
        for i in range(len(p1_list)):
            lines.append([p1_list[i],p2_list[i],distancestr[i],types[i],'','',''])
        wl.line_to_shp(lines,fname)
Пример #4
0
def dianxiangan_line_shp(r,f_dir):
    if dianxiangan_line(r):
        p1_list,p2_list,distance,total_distance,line_type_list = dianxiangan_line(r)

        directory = f_dir
        if not os.path.isdir(directory):
            os.mkdir(directory)
        fname = directory+'\\dianxiangan_line'

        lines = []
        for i in range(len(p2_list)):
            lines.append([p1_list[i],p2_list[i],distance[i],line_type_list[i],'','',''])
        wl.line_to_shp(lines,fname+'.shp')
Пример #5
0
def dianlanxian_line_shp(r,f_dir):
    if r.dianlan() == None:
        return None
    p1_list, p2_list = r.dianlan()
    directory = f_dir
    if not os.path.isdir(directory):
        os.mkdir(directory)
    fname = directory+'\\dianlan.shp'
    lines = []
    # new_dist_str_list = []
    for i in range(len(p1_list)):
        new_dist_str = str(p1_list[i][3])
        if len(new_dist_str) == 0:
            distancestr = (str(round(wl.GetDistance(p1_list[i][0],p1_list[i][1],p2_list[i][0],p2_list[i][1]),2)))
        else:
            distancestr = new_dist_str
        lines.append([p1_list[i], p2_list[i], distancestr, p1_list[i][2], '', '', ''])

    wl.line_to_shp(lines,fname)