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

Maciej Sieczka tutey at o2.pl
Tue Oct 24 04:40:18 EDT 2006


ogrinfo (and other apps based on OGR, eg. OpenEV, QGIS) returns wrong
floating point values querying my shapefiles. Eg.:

$ ogrinfo -al -q streams.shp

Layer name: streams
  CAT (Real) =         484
  LCAT (Real) =          73
  Z (Real) =      101.583309999999997
  Z_BREACH (Real) =      101.583309999999997
  Z_BREACH1 (Real) =      100.583309999999997
  LENGTH (Real) =        2.036246000000000
  LINESTRING (598549.144524969975464 5677309.376777020283043,598550.0

After opening the dbf in oocalc 2.03, I can see the values should
recpectively be:

CAT	  484
LCAT	  73
Z	  101.58331
Z_BREACH  101.58331
Z_BREACH1 100.58331
LENGTH	  2.036246

Why the spurious "09999999997" in case of Z, Z_BREACH, Z_BREACH1 in
OGR? Note that, interestingly, LENGTH is OK though.

Morevover, CAT and LCAT are not Real numbers. They are integer. Why
reported as real?

Is any of the issues fixed in newer GDAL? I've been using 1.3.2 CVS

The shapefile is attached if needed.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: streams.tar.bz2
Type: application/x-bzip
Size: 716 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20061024/b98f1eb4/streams.tar.bin

More information about the Gdal-dev mailing list