Opened 18 years ago

Closed 14 years ago

#1112 closed defect (duplicate)

Integer fields overflow in shapefile driver

Reported by: Daniel Morissette Owned by: warmerdam
Priority: high Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc:

Description (last modified by warmerdam)

mirza wrote:

> Hello,
>
> When I try to convert shapefile to mid/mif using ogr2ogr, some double values
are converted to (overflowed) integers. For example, value 14420300000144 in
shapefile is converted to -1500011687 in .mid file. I submitted bug to MITAB
project but same bug occurred when converting to CSV so maybe it is more
general. Any idea?


Frank replied:


Mirza,

This is an issue with the Shapefile driver.  The problem is deciding how to
handle integer fields that are so wide they might not fit in a 32bit integer.
My decision some time ago was to pretend that these are doubles rather than
deal with adding some sort of 64bit integer type to shapelib.

This decision is at the base of the problems.

You can file a bug against the OGR shapefile driver or even shapelib
itself, but I haven't yet figured out what to do about it.

Note that OGR's integer field is a 4byte integer so there is no way to
represent large integers in OGR.

Ugg.

Change History (1)

comment:1 by warmerdam, 14 years ago

Description: modified (diff)
Resolution: duplicate
Status: newclosed

I'm making #3615 the official ticket to address wide integer fields in dbf.

Note: See TracTickets for help on using tickets.