Hi,
I'm hoping someone can point me in the right direction. I've got a rather large point shapefile that I created using pyShp 1.1.4, with 6 attribute fields. 4 of the fields are defined as "double", and hold floating point values. The shapefile seems to write correctly, and can be opened in ArcGIS 10 sp5. However, whenever I perform apply a geospatial tool to that dataset, the resulting shapefile (or gdb) converts the floating point values to integers. Well, I don't know if an actual integer conversion is being performed, but the values themselves are truncated.
For example, two of the fields in the larger dataset are Lat and Lon, and hold values like -75.416. But after clipping/selecting/exporting the value becomes -75. The field is *still* defined as double, but obviously the data is lost.
This behavior is exhibited using the Clip tool, the "Copy Features" tool, and the drag-a-box-around-some-points selection tool (followed by create layer from selection).
I've tried this on two different machines, as well, and I don't get this behavior with other datasets.
Here's the code I'm using:
w = shapefile.Writer(shapefile.POINT)
w.field('Lon','N','12')
.
.
for x in y:
#this is how I'm writing out
w.record(float(lonval))
w.save('C:\\myfolder\\myfile")
Any thoughts???
Thanks,
Mike