GIS I: Data Sources, Data Models, Data Structures, DBMS and Database Creation
1. What a GIS is, and where its data come from
A geographic information system captures, stores, queries, analyses and displays data that are referenced to locations on the Earth. Its components are hardware, software, data, people and methods (procedures). Every geographic feature has two parts: its spatial data (where — geometry and location) and its attribute (non-spatial) data (what — name, class, value), linked by an identifier. What distinguishes a GIS from a drawing program is that it knows spatial relationships and can compute with them.
| Kind | Examples | Typical model |
|---|---|---|
| Primary, captured directly | field survey with total station and GNSS, remote sensing images, aerial photographs, LiDAR point clouds | vector from survey; raster from imagery |
| Secondary, derived from existing records | digitised or scanned maps, census tables, cadastral records, existing digital databases | either; tables join to features as attributes |
2. Data models: vector, raster and TIN, and topology
| Aspect | Vector | Raster |
|---|---|---|
| Represents the world as | discrete objects: points, lines (arcs), polygons with exact coordinates | a grid of cells, each with one value; suits continuous fields |
| Positional precision | as precise as the coordinates | limited to the cell size |
| Storage | compact for sparse features | grows as the square of 1/cell size; halving the cell quadruples the cells |
| Analysis | networks, topology, precise measurement; overlay is computationally heavy | overlay and map algebra are simple cell-by-cell operations; networks are awkward |
| Natural source | survey, digitising, CAD | satellite images, scanned maps, DEMs |
The TIN (triangulated irregular network) represents a surface by triangles joining irregularly spaced points, usually by Delaunay triangulation (no point lies inside the circumcircle of any triangle, which avoids thin slivers); its dual is the Voronoi (Thiessen) diagram. TINs place many points where terrain is rough and few where it is smooth. Topology records spatial relationships explicitly: connectivity (arcs meet at nodes), contiguity/adjacency (each arc knows its left and right polygon) and containment (islands within polygons). For a connected planar network, Euler's relation V − E + F = 2 holds, counting the outside region as a face — a check that the topology is complete.
3. Data structures: storing rasters and vectors
- Cell-by-cell (full matrix): every cell stored; size = rows × columns × bytes per cell. 5000 × 4000 cells at 2 bytes is 40 × 10⁶ bytes.
- Run-length encoding: each row stored as (value, run length) pairs. The row A A A A B B B C C A becomes (A,4)(B,3)(C,2)(A,1): four runs, eight numbers instead of ten. It compresses large uniform areas well and noisy images badly.
- Chain code (Freeman): a boundary stored as a start cell and a sequence of direction codes, 0–3 for four directions or 0–7 for eight.
- Block code: uniform square blocks stored by position and size.
- Region quadtree: the grid is split recursively into four quadrants until each quadrant is uniform. A 2ⁿ × 2ⁿ grid has at most n levels of subdivision below the root; uniform regions stop early, so storage adapts to complexity. Quadtrees also index space for fast search.
Vector structures: spaghetti stores each feature as an independent list of coordinates, with no relationships, so shared boundaries are stored twice and can mismatch. The topological arc–node structure stores each arc once with its from-node, to-node, left polygon and right polygon; polygons are built from arcs. It removes duplication and makes adjacency and network queries possible. Spatial databases add spatial indexes — R-trees (nested bounding rectangles) and quadtrees — so a query need not test every feature.
4. DBMS and the creation of spatial and non-spatial databases
A database management system stores data independently of the programs that use them, controls concurrent access and integrity, and answers queries. Of the classical models — hierarchical (tree), network (graph) and relational — the relational model dominates: data in tables (relations) of rows (tuples, records) and columns (attributes, fields). A primary key uniquely identifies each row; a foreign key in one table refers to the primary key of another and supports joins. Normalisation removes redundancy: first normal form (atomic values), second (no partial dependence on a composite key), third (no dependence between non-key attributes). Queries are written in SQL: SELECT name FROM parcels WHERE area > 500. The georelational model keeps geometry in spatial files and attributes in a relational table joined by feature ID; modern spatial databases store geometry as a column type with spatial operators and indexes; object-oriented models bundle geometry, attributes and behaviour.
- Capture: digitise paper maps on a tablet or on screen (heads-up digitising), scan and vectorise, import survey coordinates and GNSS files, classify imagery.
- Georeference: transform digitiser or image coordinates to map coordinates with control points; an affine transformation has six parameters and needs at least three points; report the RMS error of the control points.
- Clean and build topology: remove undershoots (a line stopping short of another), overshoots (crossing past it), dangles, duplicate lines and sliver polygons; snap within a tolerance.
- Attach attributes: enter or join the non-spatial table by feature ID, with validation rules.
- Document: metadata — source, scale, datum and projection, date, accuracy, lineage.
Key takeaways
- A GIS links spatial data (geometry) to attribute data by an ID and knows spatial relationships; data come from primary capture or secondary records.
- Vector: exact objects and topology, good for networks; raster: cells, good for continuous fields and overlay; TIN: Delaunay triangles for surfaces.
- Topology = connectivity, adjacency, containment; V − E + F = 2 for a connected planar network including the outside face.
- Raster structures: full matrix, run-length, chain code, block code, quadtree; vector: spaghetti versus arc–node; spatial indexes: R-tree, quadtree.
- Relational DBMS: tables, primary and foreign keys, joins, normal forms, SQL; database creation = capture, georeference (affine ≥ 3 points), clean, attribute, document.
Practice questions (14)
Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.
Which data model is most natural for representing a continuously varying field such as surface temperature?
Show answer
Answer: A — Raster
A raster assigns a value to every cell of a grid, so it samples a continuous field everywhere; satellite thermal images are rasters for exactly this reason. Vector models describe discrete objects with boundaries, and networks describe connected lines.A 10 km × 10 km area is rasterised with 10 m cells, and then again with 5 m cells. The number of cells in the second raster, in millions, is ____.
Numerical answer — type the value.
Show answer
Answer: 4
At 10 m there are (10 000/10)² = 1000² = 1 × 10⁶ cells. At 5 m, (10 000/5)² = 2000² = 4 × 10⁶ cells: halving the cell size quadruples the number of cells, which is why raster storage grows so fast with resolution.A connected planar polygon network has 6 nodes and 9 arcs. Counting only the polygons inside the network (not the outside region), the number of polygons is ____.
Numerical answer — type the value.
Show answer
Answer: 4
Euler's relation V − E + F = 2 gives F = 2 − 6 + 9 = 5 faces, and one of those is the unbounded outside region, so there are 4 polygons. Forgetting that the outside counts as a face gives 5.The topological property that lets a GIS answer “which parcels share a boundary with parcel 12?” without any geometric computation is
Show answer
Answer: A — adjacency (contiguity), stored as left and right polygons of each arc
In an arc–node structure each arc records the polygon on its left and on its right, so the neighbours of parcel 12 are simply the other polygons on the arcs that bound it. Connectivity answers routing questions and containment answers island-in-polygon questions.One row of a raster reads A A A A B B B C C A. Stored by run-length encoding as (value, length) pairs, the number of runs is ____.
Numerical answer — type the value.
Show answer
Answer: 4
The runs are (A,4)(B,3)(C,2)(A,1): four runs, stored as eight numbers against ten cells. The final A is a new run because it is separated from the first A's by other values; counting distinct values (three) is the slip.A region quadtree is built for a 16 × 16 raster. The maximum number of levels of subdivision below the root is
Show answer
Answer: A — 4
Each subdivision halves the side: 16 → 8 → 4 → 2 → 1, which is four levels, since 16 = 2⁴. A quadrant stops splitting as soon as it is uniform, so real trees are usually shallower in places.An uncompressed raster has 5000 rows and 4000 columns and stores each cell in 2 bytes. Its size, in megabytes (1 MB = 10⁶ bytes), is ____.
Numerical answer — type the value.
Show answer
Answer: 40
Size = 5000 × 4000 × 2 = 40 000 000 bytes = 40 MB. Forgetting the 2 bytes per cell gives 20 MB.In a relational database, the attribute that uniquely identifies each record of a table is its
Show answer
Answer: A — primary key
A primary key has a unique, non-null value for every row. A foreign key refers to another table's primary key to join them; a spatial index speeds up geometric search; metadata describes the dataset.The minimum number of control points needed to georeference a scanned map with a first-order (affine) transformation is
Show answer
Answer: A — 3
The affine transformation X = a₀ + a₁x + a₂y, Y = b₀ + b₁x + b₂y has six unknown coefficients, and each control point gives two equations, so three points are the minimum. More are used in practice so that residuals and an RMS error can be computed; six is the parameter count, not the point count.After georeferencing, three control points show residual errors (Δx, Δy) of (0.3, 0.4), (0.6, 0.8) and (0.0, 0.5) map units. The RMS error, in map units (to two decimal places), is ____.
Numerical answer — type the value.
Show answer
Answer: 0.71
Point errors are √(0.09 + 0.16) = 0.5, √(0.36 + 0.64) = 1.0 and √(0 + 0.25) = 0.5. RMS = √((0.25 + 1.00 + 0.25)/3) = √0.5 = 0.707, i.e. 0.71. Averaging the three point errors (0.667) is not the root-mean-square.While digitising, a road line stops just short of the junction it should meet. This digitising error is
Show answer
Answer: A — an undershoot
An undershoot leaves a gap and a dangling node, so the network is broken and routing fails. An overshoot crosses past the junction, and slivers are thin false polygons from boundaries digitised twice. A snapping tolerance cures the first two.Which of the following are advantages of the vector data model over the raster model?
Show answer
Answer: A — Positional precision not limited by a cell size; B — Explicit topology suited to network analysis; C — Compact storage of sparse discrete features
Vector coordinates are as precise as they were measured, arc–node topology carries connectivity for routing, and a few lines take little space. Cell-by-cell overlay is the raster's strength: vector overlay needs line intersection and polygon rebuilding.Which of the following statements about GIS databases are correct?
Show answer
Answer: A — A foreign key links a record to the primary key of another table; B — Normalisation reduces redundancy and update anomalies; C — An R-tree indexes features by nested bounding rectangles
Foreign keys implement joins; normal forms remove repeated data that could be updated inconsistently; R-trees group features by bounding boxes so a query tests only overlapping boxes. The georelational model keeps geometry in spatial files and attributes in a separate relational table, joined by feature ID — not inside the vertex list.Which of the following are true of a Delaunay TIN?
Show answer
Answer: A — No data point lies inside the circumcircle of any triangle; B — It tends to avoid long, thin triangles; C — Its dual is the Voronoi (Thiessen) diagram
The empty-circumcircle property defines Delaunay triangulation, and it maximises the smallest angle, avoiding slivers; joining the circumcentres gives the Voronoi diagram, its dual. The point of a TIN is that the points are irregular, dense where the terrain is rough.