Basic vector GIS

Viewing, sorting and filtering the attribute table

Open a layer's attribute table, sort and search its records, filter columns, hide and reorder fields, and zoom to features from the table.

Beginner3 min read

You will learn

  • Open the attribute table and switch between layers.
  • Sort, search and filter records.
  • Hide, reorder and resize columns, and zoom to a feature.

Prerequisites

Data for this tutorial

Wards (synthetic) Download wards.geojson

Format
GeoJSON
Geometry
Polygon
CRS
EPSG:32643 (WGS 84 / UTM zone 43N)
Content
84 wards (31 peri-urban, 19 rural, 34 urban), 333,497 residents
In Orbis
Browser panel ▸ Tutorial sample data (synthetic) ▸ Wards, or Load complete tutorial pack.
Fields used in the tutorials
FieldTypeDescription
ward_idtextWard code W01 to W84.
ward_nametextWard name.
zonetexturban, peri-urban or rural.
populationintegerResidents.
householdsintegerHouseholds.
area_km2realEllipsoidal area in km².
density_km2realPersons per km².
literacy_raterealLiterate share, per cent.

Licence: CC0 1.0. All tutorial data is synthetic and generated by Orbis. About the datasets

The task

Every vector feature has attributes: a row in a table with one column per field. The attribute table lets you read, sort and filter those rows and links them to the map. You will explore the 84 wards of the tutorial district.

Steps

  1. Add Wards from Browser ▸ Tutorial sample data (synthetic). Click it in the Layers panel and press F6. The Attribute table opens in the bottom panel. The layer selector at its left switches to another layer's table.

    The attribute table of the Wards layer with the columns ward_id, ward_name, zone, population, households and area_km2
    The attribute table of the Wards layer.
  1. Sort. Click the population header: the rows are sorted from the smallest to the largest population; click again for the reverse order and a third time to remove the sort. Right-click a header for Sort ascending and Sort descending.
  1. Search. Type rural in Search all fields. Only rows with "rural" in any field remain; the counter shows 19 / 84 features.
  1. Column filters. Click the filter button next to the search box. A filter row appears under the headers. Type >5000 under population: only the 28 wards with more than 5,000 residents remain. Filters accept text, numbers with >, >=, <, <=, = and !=, NULL (empty values) and !NULL (non-empty values).
  1. Columns. Drag a header to move the column, drag the right edge of a header to resize it, and choose Hide column in the header menu to hide it. Show n hidden column(s) brings them back.
  1. From the table to the map. Click a row to select the ward; it is highlighted on the map. Double-click a row to zoom the map to that ward.

Expected result

You can sort the wards by population, see only the rural wards, and find a ward on the map from its row. Filters and the search change only what the table shows, not the layer.

Common mistakes

  • Expecting a filter to change the layer. Table filters only hide rows. To create a layer with only some features, use Extract by attribute or Extract by expression in the toolbox.
  • Text sorted as numbers. If numbers are stored in a text field, "100" sorts before "20". Check the field type in the header tooltip.

Troubleshooting

  • The table is empty or shows another layer. Choose the layer in the selector at the left of the table toolbar.
  • The table shows no rows after filtering. Clear the search box and the column filters; the counter shown / total tells you that rows are hidden.