tarsh / pyshp

Automatically exported from code.google.com/p/pyshp
MIT License
0 stars 0 forks source link

Support for floating point attributes on input? #66

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a shapefile with attributes that include a decimal point. QGis reports 
them as 'type: double', type name: real'. The type returned by PyShp for the 
attribute is 'N'. I believe that it should be something other than 'N' to 
indicate that it is a floating point attribute, not an integer attribute, 
perhaps 'F'.

My program is extracting a portion of a shapefile. I would like to specify the 
output fields by just using the field values read as input. Unfortunately this 
does not work when the input attribute is a floating point value. When I 
attempt to access resultant shapefile, sf.records() fails with an exception:

    invalid literal for int() with base 10: '413762.235363'

What steps will reproduce the problem?
1. Read a shapefile with floating point attribute.
2.
3.

What is the expected output? What do you see instead?

I expect an attribute type other than 'N', probably 'F'. I see 'N'.

What version of the product are you using? On what operating system?

PyShp (shapefile) 1.2.0
Linux Mint Olivia 15

Please provide any additional information below.

Thanks,
Bill Wetzel

Original issue reported on code.google.com by wrwet...@gmail.com on 10 Apr 2014 at 10:53