I have a .las file and .shp file with polygons. The shapefile looks like follows:
For each polygon, I calculated statistics based on elevation data vertices from the .las. Now I want to add fields into .shp with statistics. The problem occurs when I just try to add extra fields with the following function:
def writeDims(self, params):
r = shapefile.Reader(self.shapefile)
w = shapefile.Writer("new.shp")
w.fields = list(r.fields)
for key in params[1].keys():
w.field(key, "F")
for shaperec in r.iterShapeRecords():
w.record(*shaperec.record)
w.shape(shaperec.shape)
w.close()
the result shapefile has only part of the full shapefile however with fields:
how to prevent such file-cropping?