You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observing an error with 1.2.11 that does not occur with 1.2.10
Look forward to any guidance, this change allows the shapefile to save
FAILS
value = format(value, "d")[:size].rjust(size) # caps the size if exceeds the field size
SUCCEEDS
value = format(value, "")[:size].rjust(size) # caps the size if exceeds the field size
fieldType,value,size prior to error:
N,1.0,50
File "lib\ts.py", line 8515, in to_shapefile
w.save(opath)
File "C:\g\lib\shapefile.py", line 1117, in save
self.saveDbf(target)
File "C:\g\lib\shapefile.py", line 1089, in saveDbf
self.__dbfRecords()
File "C:\g\lib\shapefile.py", line 935, in __dbfRecords
value = format(value, "d")[:size].rjust(size) # caps the size if exceeds the field size
ValueError: Unknown format code 'd' for object of type 'float'
The text was updated successfully, but these errors were encountered:
This seems to be a duplicate of #99, which is now fixed. It happened because 1.2.11 was made stricter so that it would raise an exception if trying to write float value to an int field (decimal=0). This is now fixed by trying to force convert to int first, and will be available soon in v1.2.12.
Uh oh!
There was an error while loading. Please reload this page.
Observing an error with 1.2.11 that does not occur with 1.2.10
Look forward to any guidance, this change allows the shapefile to save
The text was updated successfully, but these errors were encountered: