I am trying to find a fast way to merge two shapefiles and i ran over pyshp which apparently could do the job. However looks like this is not working for me because i receive the following error
file "c:\net\shapefile.py" ine 443 in __dbfHeader fieldDesc = list(unpack("<11sc4xBB14x", dbf.read(32))) error: unpack requires a string argument of length 32.
I have no idea what could be wrong and i've been trying to find a solution but no luck
My code looks like this:
import glob import shapefile import sys sys.path.append('C:\NET') files = glob.glob("C:\TestSHAPE\merge\*.shp") w = shapefile.Writer() for f in files: r = shapefile.Reader(f) w._shapes.extend(r.shapes()) w.records.extend(r.records()) w.fields = list(r.fields) w.save("merged")