Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 37.0925854357,14.3860984446,0.0000079572,0.0000939491,0.0000028935
- 37.0978554286,14.5199850398,0.0000041594,0.0000821038,0.0000047924
- 37.1029267200,14.6538928343,0.0000024414,0.0000677266,0.0000050637
- 37.1077992514,14.7878210195,0.0000094944,0.0000632959,0.0000020797
- import shapefile, csv
- output_shp = shapefile.Writer(shapefile.POINT)
- output_shp.autoBalance = 1
- counter = 1
- with open('path/to/file.csv', 'rb') as csvfile:
- reader = csv.reader(csvfile, delimiter=',')
- for row in reader:
- lon= row[0]
- lat= row[1]
- output_shp.point(float(lon),float(lat))
- output_shp.record(lon, lat)
- counter = counter + 1
- # save the Shapefile
- output_shp.save('path/to/output/file.shp')
- File "/usr/lib/python2.7/dist-packages/shapefile.py",line 986, in record
- if self.fields [0] [0] .startswith ("Deletion"): fieldCount - = 1
- IndexError: list index out of range
Add Comment
Please, Sign In to add comment