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

gold dev at samizdatdigital.org
Sun Jul 3 10:06:49 PDT 2005


indeed it does, i think i must have missed that. thanks.

given that, is it a bug that shp2pgsql doesn't strip the trailing '.', 
given that it knows it's trying to insert it into an integer column? i 
don't want to "fix" something before i'm sure it's broken.

jon

Stephen Woodbridge wrote:
> gold wrote:
> 
>> 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,
> 
> The shapelib API document says DBF type code 'N' (Numeric, with or 
> without decimal).
> 
> -Steve W.
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 



More information about the postgis-users mailing list