Opened 8 years ago
Closed 8 years ago
#6180 closed defect (invalid)
Read shapefile. 2.0.1 read double field as interger64
Reported by: | jingjieni | Owned by: | warmerdam |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | default | Version: | 2.0.1 |
Severity: | major | Keywords: | |
Cc: |
Description
I wrote a c++ program to read the attached shapefile. When I upgrade gdal to 2.0.1, the API OGRFieldDefn::GetType() return 'OFTInteger64' on a 'double' field. gdal 1.11.3 OGRFieldDefn::GetType() return 'OFTReal' on that 'double' field of the same shapefile. The 'double' field name is 'myfloat' in the attached shapefile. The double value is 3.1415.
gdal 1.11.3 read 'myfloat'=3.1415 correctly. gdal 2.0.1 read 'myfloat'=3.
Attachments (3)
Change History (5)
by , 8 years ago
Attachment: | alltypes.shp added |
---|
by , 8 years ago
Attachment: | alltypes.shx added |
---|
by , 8 years ago
Attachment: | alltypes.dbf added |
---|
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
No feedback. Closing as invalid following above analysis
Note:
See TracTickets
for help on using tickets.
I think the .dbf is incorrect. The myfloat field is declared with 0 decimal place and 15 char width, hence the choice of Integer64:
myfloat: Integer64 (15.0)
So the behaviour of the DBF driver is consistant with the header of the DBF. It is the content that isn't consitant with the header.
If you use ogrinfo of GDAL 1.11, it will also display it as an integer:
myfloat (Real) = 3