示例#1
0
 def read_line(self):
     sf = shapefile.Reader(self.from_file)
     for record in sf.shapeRecords():
         if record.shape.shapeType == self.shape_type:
             attributes = record.record
             poly = Polyline(record.shape.points, attributes)
             self.shapes.append(poly)
示例#2
0
 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
 def read_linez(self):
     sf = shapefile.Reader(self.from_file)
     for record in sf.shapeRecords():
         if record.shape.shapeType == self.shape_type:
             attributes = record.record
             if hasattr(record.shape, 'm'):
                 m_array = record.shape.m
             else:
                 m_array = None
             poly = Polyline(record.shape.points,
                             attributes,
                             z_array=record.shape.z,
                             m_array=m_array)
             self.shapes.append(poly)