Lesson 3.3Lesson 3.3 · Georeferencing & Data Preparation
Attribute Tables & Joins
Stitching outside facts onto your shapes
You have ward boundaries with no data, and a Census spreadsheet with no shapes.
The boundary layer knows where every ward is but nothing about who lives there. The Census file knows the population of every ward but cannot draw a single one. Neither is useful alone. A join marries them — it matches each spreadsheet row to its boundary using a shared code, and suddenly you can shade a map by population, find under-served wards, and argue from evidence. Learning to join tables well is where GIS stops being a drawing tool and starts being an analysis engine.
The map is only as honest as the year and the boundary behind the number you shaded it by.
The attribute table: one row per feature
Open any vector layer's attribute table and you see a spreadsheet where each row is one feature and each column is one field (attribute). The ward polygon you click on the map is the same object as its highlighted row — shape and facts, two views of one thing, as Module 0 established.
Every layer carries at least a hidden identifier and a geometry reference; the useful fields are the ones you add: name, population, land use, area. The table is where selection, calculation and joining happen. Select rows here and the shapes highlight on the map; compute a new field here and every shape gains a value. Most "GIS analysis" is, underneath, disciplined work on this table.
Field types: why a code stored as text will betray you
Each field has a data type, and choosing it correctly is quietly critical. An integer holds whole numbers (a ward id, a count). A real (float/double) holds decimals (area in hectares). A text (string) holds names and codes. A date holds calendar values.
Two traps recur. First, numbers stored as text will not sum, sort or compare numerically — "100" sorts before "99" as text. Second, and the cause of most failed joins: the key field must have the same type in both tables. A ward code stored as an integer in your boundaries but as text (with a stray leading zero or trailing space) in the Census file will simply refuse to match, and the join fails silently — rows drop with no error. Decide the type of every field, and above all the type of your key, before you join anything.
Half of all 'the join didn't work' problems are one column that is text on one side and a number on the other.
The table join: matching by a shared key
A table join (attribute join) appends the columns of a second table onto your layer wherever a chosen key field matches. The key is a value both tables share — a ward code, a census location code, a village id. You tell the software: join the Census table to the ward layer where wardid equals wardid, and every matched boundary inherits the population, literacy and household columns.
Most joins are one-to-one (one boundary, one matching row) or many-to-one (many features share a lookup value). The result is usually a virtual join — live and unsaved — so remember to export to a new file to make it permanent. Watch the match rate the software reports: if only 190 of 198 wards matched, eight keys disagree somewhere, and those eight wards will be blank on your map.
A join is a promise about a key. Break the promise — mismatched codes — and rows vanish without a warning.
The Census-to-boundary join, done honestly
This is the workhorse of Indian urban analysis, and it has a specific discipline. India's Census releases data keyed by standardised location codes; your boundary layer must carry the same codes for the join to bite. Before joining: confirm both sides use the identical code field (not the name — names have spelling variants, "Bengaluru" vs "Bangalore"); strip stray spaces; match the data types; and note the Census year and administrative vintage, because ward and district boundaries are periodically redrawn.
One conceptual caution carries into everything you map from such data. Values reported per ward or per zone depend on how those units are drawn — change the boundaries and the pattern can change too. This is the Modifiable Areal Unit Problem (MAUP), and it means a choropleth of joined Census data is a statement about the units as much as the phenomenon. Report your unit and year; do not over-read a pattern that the zoning itself may have created.
The spatial join: matching by location, no key needed
Sometimes there is no shared code — you have bus-stop points and ward polygons and want to know how many stops fall in each ward. A spatial join matches features by their geometry instead of a key: for each ward, it finds the points that fall within it and, say, counts them or sums an attribute. The spatial relationship you choose — intersects, within, contains, nearest — defines the match.
Spatial joins are how you attach context that only geography can supply: stops per ward, jobs within a catchment, which zone each building sits in. They demand two things you already know to check — both layers in the same CRS (next lesson) and clean topology, so a point on a boundary is not ambiguously in two wards. Get those right and a spatial join answers questions no shared key ever could.
Census of India
Decadal demographic & socio-economic tables, country to village (India)
The classic non-spatial table you join to boundaries by location code; free public data. censusindia.gov.in
data.gov.in (NDSAP 2012, GODL)
India Open Government Data platform
Where many joinable government tables live under the Government Open Data License – India.
ISO 19110
Feature cataloguing methodology (global)
The discipline of documenting each field and its meaning before you join — so a key is unambiguous.
ISO 19115
Geographic metadata (global)
Record the key field, units, source and lineage so a join is reproducible by the next person.
Workshop — join Census data to ward boundaries
Take a ward (or district) boundary layer and a Census CSV, join them by a shared code, then use a spatial join to count point features per ward.
QGIS 3.44 (Joins, Join Attributes by Location) or ArcGIS Pro 3.7 (Add Join, Spatial Join); a boundary layer, a Census CSV and a points layer.
Given: a boundary polygon layer with a code field + a Census CSV with the same code + a points layer (e.g. amenities) Goal: (1) a boundary layer carrying population; (2) a count of points per ward
- 1Load both tables and inspect the key. Open the attribute table of the boundaries and the CSV, and confirm the code field has the same name, type and formatting on both sides (fix stray spaces / leading zeros first).
- 2Run the table join. In QGIS: Layer Properties ▸ Joins ▸ add join, set Join field and Target field to the code. In ArcGIS Pro: right-click the layer ▸ Joins and Relates ▸ Add Join on the code field.
- 3Check the match rate. Confirm how many features got a population value; investigate any unmatched wards (mismatched code, spelling or vintage) rather than ignoring the blanks.
- 4Make it permanent. In QGIS: Export ▸ Save Features As a new GeoPackage. In ArcGIS Pro: Export Features to a new feature class so the joined fields are stored.
- 5Do a spatial join for the points. In QGIS: Processing ▸ Join Attributes by Location (Summary), predicate 'within', summarise by count. In ArcGIS Pro: Analysis ▸ Tools ▸ Spatial Join, match option 'Within', with a Count.
- 6Symbolise the result as a graduated (choropleth) map of population or point-count, and note the Census year and unit vintage on the layout.
You’ll walk away with
A ward layer carrying joined Census population plus a spatial-join count of points per ward, exported to a permanent file — ready to symbolise as a choropleth.
Three altitudes on the same idea
Read the band that fits you — or all three.
Joins turn a bare context layer into a data-rich brief. Join demographic or amenity data onto your neighbourhood polygons and a site's catchment stops being a guess — you can state households, age mix or nearby facilities to justify a programme. A spatial join counts what actually falls within a walking radius of your plot.
The Census-to-boundary join is the backbone of statutory analysis. Population, density, literacy and household data become mappable only once joined to ward or zone boundaries by a matching code. Guard the key discipline and the vintage of both layers — and remember MAUP when you present any per-zone rate, because the units shape the story.
Spatial joins convert 'this area feels under-served' into a count. Stops per block, trees per street, entrances per frontage — all come from matching features by location. Because these metrics feed walkability and public-realm arguments, insist on a common CRS and clean topology so a boundary point is never double-counted.
“A join failed only if the software throws an error.”
Do it yourself
No software — test your grip on keys and matches.
- 1A boundary layer stores ward_id as integer; the CSV stores it as text '007'. Predict what happens on join and name the fix.
- 2Give one question a table join can answer and one that only a spatial join can — for the same ward layer.
- 3Your join reports 190 of 198 features matched. What is your next action, and what should you NOT do?
- 4Explain the Modifiable Areal Unit Problem in one sentence to a client who wants a 'density map'.
- 5For a spatial join of points to polygons, why must both layers share a CRS and have clean topology?
The one line to carry out
Peer-reviewed journals & authoritative standards
- 01Chang, K.-T. — Introduction to Geographic Information Systems, 9th ed. — McGraw-Hill Education, 2019.
- 02de Smith, M.J., Goodchild, M.F. & Longley, P.A. — Geospatial Analysis: A Comprehensive Guide, 7th ed. — Winchelsea Press, 2025.
- 03Openshaw, S. — The Modifiable Areal Unit Problem (CATMOG 38) — Geo Books, Norwich, 1984.
- 04Longley, P.A., Goodchild, M.F., Maguire, D.J. & Rhind, D.W. — Geographic Information Science and Systems, 4th ed. — Wiley, 2015.
- 05Bolstad, P. & Manson, S. — GIS Fundamentals: A First Text on Geographic Information Systems, 7th ed. — Eider Press, 2022.
Joins assume both layers agree on where things are — which fails the moment their coordinate systems differ, so the final lesson tackles cleaning messy data, fixing geometries and transforming between CRSs.
The author
Amogh N P
Architect, interior designer, and creative polymath. Studio Matrx began in his notebooks — his vision of design made honest, useful, and open to everyone. Its Academy is written and taught in his memory, and free, forever.
More about Amogh →