コード例 #1
0
ファイル: conversion.py プロジェクト: iluckyyang/PyTelTools
 def to_i2s_i3s(self, new_shapes, to_file):
     attributes = []
     for line in new_shapes:
         attributes.append(line.attributes()[0])
     with bk.Write(to_file) as f:
         f.write_header(self.header)
         f.write_lines(new_shapes, attributes)
コード例 #2
0
ファイル: conversion.py プロジェクト: iluckyyang/PyTelTools
 def from_i3s_to_i2s(self, new_shapes, to_file):
     attributes = []
     shapes = []
     for line in new_shapes:
         attributes.append(line.attributes()[0])
         coords = np.array(list(line.coords()))
         shapes.append(Polyline(coords[:, :2]))
     with bk.Write(to_file) as f:
         f.write_header(self.default_header)
         f.write_lines(shapes, attributes)
コード例 #3
0
ファイル: conversion.py プロジェクト: iluckyyang/PyTelTools
    def to_i3s(self, new_shapes, to_file, attribute_method):
        attributes = []
        for i, poly in enumerate(new_shapes):
            if attribute_method == '0':
                attributes.append(0)
            elif attribute_method == 'Iteration':
                attributes.append(i + 1)
            else:
                attribute_index = int(attribute_method.split(' - ')[0])
                attributes.append(poly.attributes()[attribute_index])

        with bk.Write(to_file) as f:
            f.write_header(self.i3s_header)
            f.write_lines(new_shapes, attributes)
コード例 #4
0
ファイル: conversion.py プロジェクト: iluckyyang/PyTelTools
 def to_xyz(self, new_shapes, to_file):
     with bk.Write(to_file) as f:
         f.write_points(new_shapes)
コード例 #5
0
ファイル: conversion.py プロジェクト: iluckyyang/PyTelTools
 def to_xyz(self, new_shapes, to_file):
     with bk.Write(to_file) as f:
         if WRITE_XYZ_HEADER:
             f.write_header(self.header)
         f.write_points(new_shapes)