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.
Overview

1. What a GIS is, and where its data come from

1 min read · 1 part

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

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…

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

1 min read · 1 part
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.

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…

3. Data structures: storing rasters and vectors

1 min read · 6 parts
  • 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.

Spaghetti vs topological arc–node
Spaghetti
  • Each feature an independent coordinate list
  • No relationships stored
  • Shared boundaries stored twice
Topological arc–node
  • Arc with from-node, to-node, left and right polygon
  • Adjacency and network queries possible
  • Each arc stored once

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…

4. DBMS and the creation of spatial and non-spatial databases

2 min read · 8 parts

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.
🎯 Raster storage arithmetic
A raster of 1000 × 1000 cells at 8 bits per cell is 10⁶ bytes, about 1 MB; at 16 bits it is 2 MB, and a three-band image at 8 bits is 3 MB. Halving the cell size quadruples the number of cells. Run-length encoding stores a row of 500 identical cells as one pair (value, 500), so it compresses a categorical map with large uniform regions well and an image with noisy values hardly at all.
Creating a spatial database
  1. CaptureDigitise, scan, import survey and GNSS
  2. GeoreferenceControl points; report RMS error
  3. Clean and build topologyRemove undershoots, overshoots, slivers
  4. Attach attributesJoin by feature ID
  5. DocumentMetadata

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…

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 (24)

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.
Show the other 21 questions
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. In the vector data model, a road centreline is normally stored as a

    1. line (arc), an ordered list of coordinate pairs
    2. polygon
    3. grid of cells
    4. single point
    Show answer

    Answer: A — line (arc), an ordered list of coordinate pairs

    Linear features are polylines: an ordered sequence of vertices between two nodes. A polygon would need a closed ring and an area, and a grid of cells is the raster representation, not the vector one.
  13. A 2 km × 3 km area is rasterised with 20 m square cells. The number of cells is ____.

    Numerical answer — type the value.

    Show answer

    Answer: 15000

    100 columns × 150 rows = 15 000 cells (area 6 × 10⁶ m² divided by 400 m² per cell). Dividing by 20 instead of 20² (300 000) forgets that cells are areas.
  14. In GIS terrain modelling, the abbreviation TIN stands for

    1. Triangulated Irregular Network
    2. Terrain Information Node
    3. Topological Index Network
    4. Tiled Image Navigation
    Show answer

    Answer: A — Triangulated Irregular Network

    A TIN joins irregularly spaced elevation points into non-overlapping triangles (usually Delaunay), each a planar facet. The other expansions are invented; a TIN is a vector surface model, unlike a raster DEM.
  15. In a relational attribute table, each row and each column represent respectively

    1. a field and a record
    2. a key and an index
    3. a table and a database
    4. a record (one feature) and a field (one attribute)
    Show answer

    Answer: D — a record (one feature) and a field (one attribute)

    Rows (tuples) are individual records such as one parcel; columns hold one attribute (area, owner) for all records. Swapping them is the common slip.
  16. A raster with 30 m cells is resampled to 90 m cells over the same area. The number of cells is reduced by a factor of ____.

    Numerical answer — type the value.

    Show answer

    Answer: 9

    Each side is 3 times coarser, so each new cell covers 3 × 3 = 9 old cells. Answering 3 forgets that resolution changes in both directions.
  17. A second-order polynomial transformation for georeferencing has six coefficients for each output coordinate. The minimum number of control points needed is ____.

    Numerical answer — type the value.

    Show answer

    Answer: 6

    x′ = a₀ + a₁x + a₂y + a₃xy + a₄x² + a₅y² has 6 unknowns, and each control point gives one equation per coordinate, so at least 6 points (more for a residual check). Answering 3 is the first-order (affine) minimum.
  18. A raster stored with 8 bits per cell can hold how many distinct cell values? ____

    Numerical answer — type the value.

    Show answer

    Answer: 256

    2⁸ = 256 values (0–255 if unsigned), the usual range of satellite image DNs. Answering 8 counts bits, and 255 forgets that 0 is also a value.
  19. Normalising a relational GIS attribute database chiefly

    1. compresses images by run-length encoding
    2. converts vector data to raster
    3. removes redundant storage and update anomalies by splitting data into related tables
    4. rescales attribute values to the range 0–1
    Show answer

    Answer: C — removes redundant storage and update anomalies by splitting data into related tables

    Normal forms ensure each fact is stored once, so changing an owner's address cannot leave inconsistent copies. Rescaling values to 0–1 is statistical normalisation, a different use of the same word.
  20. A map at 1 : 25 000 is digitised with a positional error of 0.5 mm on the map. The corresponding ground error, in m (one decimal), is ____.

    Numerical answer — type the value.

    Show answer

    Answer: 12.5

    Ground error = map error × scale denominator = 0.0005 m × 25 000 = 12.5 m. Dividing by the scale (2 × 10⁻⁸ m) inverts the conversion; this is why digitised data cannot be more accurate than their source scale allows.
  21. Which statements about keys and relationships in a relational GIS database are correct?

    1. A primary key value may not be null (entity integrity).
    2. A primary key may contain duplicate values provided the column is indexed.
    3. A foreign key refers to the primary key of another table.
    4. A one-to-many relationship is implemented by placing the foreign key in the table on the "many" side.
    Show answer

    Answer: A — A primary key value may not be null (entity integrity).; C — A foreign key refers to the primary key of another table.; D — A one-to-many relationship is implemented by placing the foreign key in the table on the "many" side.

    Primary keys must be unique and non-null; foreign keys link to them, and the many-side table carries the foreign key (many parcels → one owner). Indexing speeds look-ups but never permits duplicates in a primary key, so the last statement is false.