GIS I: Data Sources, Data Models, Data Structures, DBMS and Database Creation

This is a section of Part A, the Common Section, of the Geomatics Engineering (GE) paper. Part A's GIS heading reads “Introduction, Data Sources, Data Models and Data Structures, DBMS, Creation of Databases (spatial and non-spatial), Basic Spatial analysis: Interpolation, Buffer, Overlay, Terrain Modeling and Network analysis”. It is two subjects: how geographic data are represented and stored, and what is done with them. This chapter is the first. It defines a GIS and its components; lists the data sources; contrasts the vector, raster and TIN models and the topology that makes vector data analysable; works through the raster compression structures (run-length, chain code, quadtree) and the vector structures (spaghetti, arc–node); sets out the relational database model with its keys, normal forms and queries; and follows the creation of a database from digitising and georeferencing to error cleaning and metadata. Spatial analysis is the next chapter.

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.

Data sources
KindExamplesTypical model
Primary, captured directlyfield survey with total station and GNSS, remote sensing images, aerial photographs, LiDAR point cloudsvector from survey; raster from imagery
Secondary, derived from existing recordsdigitised or scanned maps, census tables, cadastral records, existing digital databaseseither; tables join to features as attributes

2. Data models: vector, raster and TIN, and topology

Vector against raster
AspectVectorRaster
Represents the world asdiscrete objects: points, lines (arcs), polygons with exact coordinatesa grid of cells, each with one value; suits continuous fields
Positional precisionas precise as the coordinateslimited to the cell size
Storagecompact for sparse featuresgrows as the square of 1/cell size; halving the cell quadruples the cells
Analysisnetworks, topology, precise measurement; overlay is computationally heavyoverlay and map algebra are simple cell-by-cell operations; networks are awkward
Natural sourcesurvey, digitising, CADsatellite 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.

  1. Capture: digitise paper maps on a tablet or on screen (heads-up digitising), scan and vectorise, import survey coordinates and GNSS files, classify imagery.
  2. 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.
  3. 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.
  4. Attach attributes: enter or join the non-spatial table by feature ID, with validation rules.
  5. Document: metadata — source, scale, datum and projection, date, accuracy, lineage.
⚠️ A GIS cannot add accuracy the source never had
Coordinates digitised from a 1:50 000 map print to the millimetre in the database, but they are only as good as the map, about ±12.5 m for a 0.25 mm plotting accuracy. Zooming in on a GIS layer never improves it — the metadata's scale field is what tells the user so.

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.

  1. Which data model is most natural for representing a continuously varying field such as surface temperature?

    1. Raster
    2. Spaghetti vector
    3. Point features only
    4. A network of arcs and nodes
    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.
  2. 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.
  3. 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.
  4. The topological property that lets a GIS answer “which parcels share a boundary with parcel 12?” without any geometric computation is

    1. adjacency (contiguity), stored as left and right polygons of each arc
    2. connectivity of arcs at nodes
    3. containment of islands
    4. the coordinate precision of the vertices
    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.
  5. 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.
  6. A region quadtree is built for a 16 × 16 raster. The maximum number of levels of subdivision below the root is

    1. 4
    2. 16
    3. 8
    4. 256
    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.
  7. 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.
  8. In a relational database, the attribute that uniquely identifies each record of a table is its

    1. primary key
    2. foreign key
    3. spatial index
    4. metadata
    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.
  9. The minimum number of control points needed to georeference a scanned map with a first-order (affine) transformation is

    1. 3
    2. 2
    3. 4
    4. 6
    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.
  10. 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.
  11. While digitising, a road line stops just short of the junction it should meet. This digitising error is

    1. an undershoot
    2. an overshoot
    3. a sliver polygon
    4. a spike
    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.
  12. Which of the following are advantages of the vector data model over the raster model?

    1. Positional precision not limited by a cell size
    2. Explicit topology suited to network analysis
    3. Compact storage of sparse discrete features
    4. Simpler cell-by-cell overlay of many layers
    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.
  13. Which of the following statements about GIS databases are correct?

    1. A foreign key links a record to the primary key of another table
    2. Normalisation reduces redundancy and update anomalies
    3. An R-tree indexes features by nested bounding rectangles
    4. In the georelational model, attributes are stored inside the coordinate list of each vertex
    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.
  14. Which of the following are true of a Delaunay TIN?

    1. No data point lies inside the circumcircle of any triangle
    2. It tends to avoid long, thin triangles
    3. Its dual is the Voronoi (Thiessen) diagram
    4. It requires points on a regular grid
    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.