22/10/2012

QGIS 1.8 headaches - calculating area


Calculating area headaches

I did not have this problem in previous QGIS version but cannot seem to solve this issue with QGIS version 1.8. Against a consultant work where the area of polygons were configured in Real, I went along to check it out by creating 3 new columns with different configurations to record my version of 'area' (type/width/precision) for integer (aiw2p0), real(arw2p0) and string(asw2p0). Although the outcome of the calculations for all 3 types were similar (although more detail) and similar to the consultant's work, the moment I saved the file, the results summarized itself: integer rounded off as a whole number, string did not round off, left a decimal point but no precision info whereas real was did not round off but did not leave a decimal point. I'm stuck! It obviously would be impractical to keep an obsolete QGIS version just to calculate areas. Anyone out there got any advise?

UPDATE

I got an email from Tim Sutton dated 14.11.2012 who advised me

 "Probably you did not allocate enough decimal places when you created
the field. Try using something like:

10 digits with 5 places when you add the field to the table."

Well folks, you can try this out too. I haven't the time yet as I have to entertain my mother-in-law who just came by for holiday ...

12 comments:

  1. What version of GDAL do you have installed? I guess it is because of it.

    ReplyDelete
  2. According to the Synaptic Package Manager, the package libgdal1-1.7.0 of version 1.7.3-6ubuntu3 is currently installed.

    ReplyDelete
  3. it is strange. what does 'about QGIS menu' say?

    ReplyDelete
    Replies
    1. My 'About QGIS' states Complied against GDAL/OGR is 1.7.3 and Running against GDAL/OGR is 1.7.3.

      Delete
  4. There is an unofficial version of QGIS. I suppose the problem is solved there.

    http://nextgis.ru/en/nextgis-qgis/

    But this version is for Win-users only =(

    ReplyDelete
    Replies
    1. I sent my query to the QGIS user mailing list but am not sure if I sent it the right way (Rarely use this facility to send but view coz I always find its procedure a bit confusing). We'll see.

      Delete
  5. well, Integer types are always whole numbers.

    What is your precision settings for the real number field, arw2p0. Have you tried a width of 3, precision of 2 instead?

    ReplyDelete
    Replies
    1. I tried this out and comparison between the consultant's figure against my results were varied e.g. 1.08 against my 1 then 51.454 against my 51 and 1976.03 against my 196.

      Delete
  6. Replies
    1. Output preview states expression is invalid

      Delete
    2. hmm. that's weird. what kind of database are you using?

      Delete
    3. It's just a vector .shp file. I tried a few other locality (.shp) and the results are the same.

      Delete