📋✅ Attribute Table in QGIS: Viewing and Editing Data
🟢 What is the Attribute Table?
The Attribute Table in QGIS stores all the non-spatial data (e.g., name, ID, population) attached to each spatial feature (point, line, or polygon).
Each row = one feature, and each column = one attribute field.
✅ Step-by-Step: View the Attribute Table
🔹 Step 1: Load or Create a Layer
-
Add a vector layer (shapefile, GeoPackage, etc.) to your project.
🔹 Step 2: Open Attribute Table
-
Right-click on the layer name → Open Attribute Table
or select the layer and click the Attribute Table icon (📋)
🟢 Attribute Table Interface Overview
Tool/Button | Function |
---|---|
🔍 Filter | Search or filter rows |
🧮 Field Calculator | Calculate or update values |
✏️ Toggle Editing | Start editing attributes |
➕ Add Feature | Add a new row/geometry |
➖ Delete Feature | Delete selected feature(s) |
📌 Select Rows | Highlight rows for editing/viewing |
✏️ Editing Attribute Data
✅ Step 1: Toggle Editing Mode
-
Click ✏️ Toggle Editing on the top-left of the table.
✅ Step 2: Make Changes
You can now:
-
Edit cell values directly (like in Excel)
-
Add new rows (if geometry is also added)
-
Delete rows (select row → click delete)
✅ Step 3: Save Changes
-
Click 💾 Save Edits after editing
-
Then click ✏️ Toggle Editing again to stop editing mode
🧮 Using the Field Calculator
The Field Calculator is powerful for:
-
Creating new fields
-
Updating existing fields
-
Calculating values (e.g., area, population density)
Example: Add an Area Field
-
Open Attribute Table → Click Field Calculator
-
Check ✅ Create a new field
-
Name:
Area_km2
-
Output type: Decimal number (real)
-
-
Expression:
$area / 1000000
(converts square meters to square kilometers)
-
Click OK
🔍 Filtering and Sorting Data
-
Use Filter (Funnel icon) to display only matching records
Use Expression Filter for advanced queries like:
"Population" > 1000 AND "District" = 'Cuttack'
-
Click on column headers to sort ascending/descending
📌 Pro Tips
-
Use the “Form View” tab (top-right) for single record editing
-
Join external data (e.g., CSV) to add more attributes
-
Export attribute table as CSV:
Right-click layer → Export → Save Features As → Format: CSV