This tutorial will guide you o how too calculate geometry for lines and polygon vector data. Add geometry attributes tool is used. It calculates length for lines and area and perimeter for polygons. It is important to note the coordinate reference system of your data before choosing the one to be used in the geometry calculation.