[postgis-users] number format weirdness from dbfopen.c?

gold dev at samizdatdigital.org
Sun Jul 3 09:49:30 PDT 2005


are there any open issues or common experience with some number values 
being read incorrectly from a .dbf file? i noticed this in using 
shp2pgsql, and i'm still trying to track it down.

basically, shp2pgsql was generating insert statements inserting values 
like '1234.' (notice the trailing '.'). i've put extra debugging in my 
local copy of dbfopen and shp2pgsql, and indeed this is the ascii data 
coming from the .dbf file itself (after the whitespace trimming). the 
fields in question are marked as type 'N', as returned by 
DBFGetNativeFieldType.

i'm gonna write a separate low level version (bypassing dbfopen) to just 
extract this field and at least get some degree of confirmation as to 
whether this is really how the data is, or whether there's something 
amiss in dbfopen (unlikely, but i should check).

i'm also going to get in touch with the data providers to see if this is 
something they're aware of. is it possible that in the .dbf world 
'1234.' is valid numeric syntax?


jon



More information about the postgis-users mailing list