[postgis-users] Problem with pgsql2shp .dbfs

Matthew Perry perrygeo at gmail.com
Thu Aug 25 10:20:30 PDT 2005


Hi,

On 8/25/05, Frank Koormann <frank.koormann at intevation.de> wrote:
> Some technical stuff:
> - This field is far to large for a dbf-File: The specs reserve 1 Byte for
>   the field size description, as a consequence a field can be 265 characters
>   maximum.
> - pgsql2shp writes a 2 Byte size into the field header (here: 32842 characters)
>   and also data of that size into the file.
> - Some programs (e.g. OO.org) read only the first byte (here: 74 chars) and
>   cut off the rest of the data. This causes the significantly reduced
>   size of the second ("good") dbf.
> - Some other programs might stumble either over the corrupted header
>   (correctly interpreted field description: A character field, with 74
>   characters and 128 decimals; which does not make any sense) or the
>   sheer size of the field.
> 
> In short: I think this is a bug in the underlying shapelib (dbfopen); as
> a fast solution you might surpress the output of the SVG_GEOM colum with
> a crafted query.
> 

  Thanks for helping me understand this. For now we'll just cut out
the SVG_GEOM column using a view.

  By the way, what application are you using to investigate the dbf?
And are the dbf limitations you mentioned documented anywhere in an
official spec? Or is it just one of the things you've just got to know
;-)

Thanks for the help.

-- 
Matt Perry
perrygeo at gmail.com
http://www.perrygeo.net



More information about the postgis-users mailing list