[Gdal-dev] OGR returns wrong floating values for shapefiles (and integer as real, in error)

Frank Warmerdam warmerdam at pobox.com
Tue Oct 24 10:11:07 EDT 2006


Maciej Sieczka wrote:
> 
> Hmm, this looks wrong (?) - my CAT and LCAT *do* have a zero precision.
> So I'd expect them to be treated as integer. And the other 4 columns
> have 15 decimal places precision, not 2. Open the dbf in a spreadsheet
> to see that:
> 
> CAT,N,11,0
> LCAT,N,11,0
> Z,N,24,15
> Z_BREACH,N,24,15
> Z_BREACH1,N,24,15
> LENGTH,N,24,15

Maciej,

Because Shapelib does not have a 64bit integer type, it automatically
treats integer fields that are potentially to large to fit in a 32bit
integer as floating point.  This isn't a great approach and causes a
number of problems, but it isn't completely without reason.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list