[postgis-users] DBF Number Formats

Paul Ramsey pramsey at refractions.net
Mon Jul 19 17:05:42 PDT 2004


All,

   In investigating some problems we were having with outputs from the 
new PostGIS shape dumper, we have come across an oddity in DBF which is 
breaking the JUMP shapefile reader (and therefore possibly the geotools 
reader as well).

   The DBF format defines a fixed field width for every data type, and 
writes the data values into those fields as text strings.  So, a 
number(6,0) might have a value of "    23" in the data portion of the 
file.  That is what JUMP expects.  However, it is also possible to 
encode the value as "23    ". This is what our new Shape dumper does. It 
breaks JUMP, but ArcView sucks it up no problem. The Shape dumper is 
actually using the OGR shapelib extension, so this quirk is probably 
widespread.

   In general, to be robust, it appears that DBF readers have to be 
capabable of reading field values of "either   " "   form".

Paul




More information about the postgis-users mailing list