Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I used MMQGIS plugin to change a table of numbers in text format (UN world economic data) which had large values of items like GDP 132000000000 (132 billion) were all converted to -2147483648 which I suppose is the numerical value for missing value or similar. 132 million converts OK but not 132 billion.

enter image description here

The image above illustrates the problem. I started with the table on the right; table on the left is the reslt. I am using QGIS 1.8. How can I fix this?

share|improve this question
    
For a "comment" how do you add a graphic? Imagine "A" is a column of large numbers and "B" would be the same column except all the large numbers are -2147483648. I did the experiment: I imported a .shp file that was made in another GIS in QGIS. See "A" in the graphic. Then I saved that same file as another .shp file. Then I read it back into QGIS. See "B". Notice that the large numbers which were pretty happy in the .shp file from somewhere else are now all changed. MMQGIS or the text-float function in Field Calculator does the same thing. –  HealthMaps Aug 12 '12 at 21:22

1 Answer 1

That means that the length limit for fields in the DBF format was passed (the dbf format is the one used by shapefiles). To overcome this limit you will need to use a more powerful DB/format like Spatialite or PostgreSQL/PostGIS.

share|improve this answer
    
For a "comment" how do you add a graphic?I did the following experiment: I imported a .shp file that was made in another GIS in QGIS. See "A" in the graphic. Then I saved that same file as another .shp file. Then I read it back into QGIS. See "B". Notice that the large numbers which seem pretty happy in the .shp file from somewhere else are now all changed. It looks like any number above 2 billion gets changed. MMGISW or the text-float function in Field Calculator does the same thing. –  HealthMaps Aug 12 '12 at 21:16
    
devzone.advantagedatabase.com/dz/webhelp/advantage9.0/server1/… "4-byte long integer values from -2,147,483,648 to 2,147,483,647.". Anyway if there is an issue (but I doubt) it would be necessary to see if it's QGIS one or maybe an OGR one (OGR is the library that QGIS uses to handle vectors like shapefiles). –  Giovanni Manghi Aug 13 '12 at 0:04
    
I really do not know what "OGR" is but it makes sense that some common routine that is handling numerical stuff for tables needs to be 8 bytes rather than 4. It is repeatable that if I read in a .shp file from another package greater than 2.147 billion and export it to a .shp file for QGIS that the large numbers are zapped. Seems that this is a bug unless QGIS users can change the length of variables in their data. –  HealthMaps Aug 13 '12 at 6:52
    
This answer cannot be correct, because dBase numeric field widths can be far greater than 12 digits. The conversion to a value near -2^31 indicates the software insists that all values in this particular field be signed integers. (This is strange because dBase files do not store signed integers: they store the ASCII decimal representations of numbers.) That suggests converting these numbers to floats or doubles to circumvent the software problem. –  whuber Aug 13 '12 at 14:18
    
So if one has a table in QGIS with numbers which are read in and are in text format, how could the "text" numbers greater than 2 billion or so be converted to floating point or integer numbers? –  HealthMaps Aug 13 '12 at 22:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.