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?
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 ...
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 ...
What version of GDAL do you have installed? I guess it is because of it.
ReplyDeleteAccording to the Synaptic Package Manager, the package libgdal1-1.7.0 of version 1.7.3-6ubuntu3 is currently installed.
ReplyDeleteit is strange. what does 'about QGIS menu' say?
ReplyDeleteMy 'About QGIS' states Complied against GDAL/OGR is 1.7.3 and Running against GDAL/OGR is 1.7.3.
DeleteThere is an unofficial version of QGIS. I suppose the problem is solved there.
ReplyDeletehttp://nextgis.ru/en/nextgis-qgis/
But this version is for Win-users only =(
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.
Deletewell, Integer types are always whole numbers.
ReplyDeleteWhat is your precision settings for the real number field, arw2p0. Have you tried a width of 3, precision of 2 instead?
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.
Deletealso: round($area, 2)
ReplyDeleteOutput preview states expression is invalid
Deletehmm. that's weird. what kind of database are you using?
DeleteIt's just a vector .shp file. I tried a few other locality (.shp) and the results are the same.
Delete