[postgis-devel] pgsql2shp integer length

Paul Ramsey pramsey at refractions.net
Tue Jul 11 11:12:00 PDT 2006


We noticed that when exporting an "integer" field from postgis to shape, 
the dumper was giving the dbf field a type of "number(11,0)". When the 
same file is imported into GRASS, it interprets it as a float 
(presumably because it is theoretically possible to overrun a 32-bit 
integer with 11 digits of numerals). GRASS will happily read the same 
file with a type of "number(10,0)" as an integer rather than a float.

We are converting "integer" -> "number(11,0)" which will fit the widest 
possibility ("-2147483648").  It looks like GRASS (or, more 
particularly, GRASS's v.in.ogr) is assuming that integers are only up to 
10 digits.

Shapefiles, I despise thee.




More information about the postgis-devel mailing list