using field calculator in Qgis 1.8.0 to get the area, it shows just right at first but when I save it, the values become Null.
-
From what data is your layer (Shapefile, Spatialite, GPX, Postgis)? Can you edit the geometry?– AndreJApr 8, 2013 at 5:36
-
Its a shape file– PamelaApr 8, 2013 at 17:18
-
I have the same problem, I have tried anything.– Damiano CerroneMar 27, 2015 at 15:40
-
Welcome! Sorry, but your comment does not qualify as an answer and will most probably be deleted. If you have comments to the question I suggest you elaborate your efforts as comments to the question.– ragnvaldMar 27, 2015 at 16:21
2 Answers
What Coordinate system is your shapefile layer in? If you have something in degrees, the area will be computed in square degrees (which does not make sense, and will be a very low value).
Note that the project CRS can be different, but has no effect on $area
.
If your layer CRS is in metres, try a greater value for width. 99999.99 m² may be too small for the areas. The formatting is only applied after saving, thats why you see the correct result at first.
-
I changed the width for a greater value and it worked :D! thank you very much– PamelaApr 8, 2013 at 18:56
just a guess but this is what I did wrong... you need to make the sure the columns properties are set correctly if you are creating a new column in the attribute table
when setting up the column you need to make sure you have the numbers right ie whole numbers or decimal (or text) and width and precision as well
-
-
I checked the colum properties and they are just fine, but now the all values become zero– PamelaApr 8, 2013 at 17:01
-
i already tried creating first a new field with this properties (real numbers, width 7 and precision2) saving those changes and then updating that existing field with $area and it still doesnt work– PamelaApr 8, 2013 at 17:11