[postgis-users] Integer (PostGIS) fields become real in QGIS!

Paul Ramsey pramsey at cleverelephant.ca
Wed Nov 26 08:47:09 PST 2008


Tell the QGIS developers to expand their notion of an int to 11
digits. The whole problem is the mismatch between formal typing in
C/C++ (integer, float, double) and the "typing" used in DBF headers
(number(n,m)). QGIS interprets anything over 10 digits as float so
that it doesn't accidentally bust an integer register trying to load
10B into an int. The reason PostGIS uses 11 digits is because valid
*negative* integers, like -1B require 11 digits.

Sorry,

P

On Wed, Nov 26, 2008 at 7:01 AM, Vito Meuli
<v.meuli at tecnologieavanzate.it> wrote:
> Hi!
> I'm using shapefile exported from PostGIS using pgsql2shp.
> But QGIS takes the integer fields as they were real!
>
> I've tryed different version of PostGIS, and something changed: integer=int4
> become a 16 digit precision in a shapefile exported using PostGIS 1.0.6, and
> a 11 digit precision using PostGIS 1.3.3...
> What a pity, it seems that an integer remains an integer if it is 10 digit
> precision!
>
> It's not better if I use smallint instead of int4: pgsql2shp acts the same
> way.
>
> If I export shapefiles from PostGIS using QGIS directly, all goes well and the
> int4 remain integer.
>
> Is there some other way to extract shapefile using a shell (Linux) script and
> letting them have integer fields of 10 digit precision?
>
> Any help would be appreciated.
> Bye
> Vito
> --
> Ing. Vito Meuli
>
> Tecnologie Avanzate S.r.l.
> via B. Croce, 49
> 70015 Noci (BA)
> tel. +39 080 4979652
> fax  +39 080 4979263
>
> email: v.meuli at tecnologieavanzate.it
> http://www.tecnologieavanzate.it
> _______________________________________________
> 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