Syllabus & Marks Distribution
| Detail | Information |
|---|---|
| Chapter | 3 — Spatial Data Models |
| Teaching Hours | 3 hours |
| Marks Allocation | 6 marks |
| Total Course Marks | 80 marks |
| Weight | 7.5% of total |
Syllabus Topics
- Concept of data model
- Raster data model
- Compression
- Indexing and hierarchical data structures
- Vector data model
- Topology
- TIN data model
Importance & Frequently Asked Topics HIGH
Marks Distribution by Each Exam
Asked 22 times across past exams. Total marks: 143. Average marks per exam: ~10.
| Exam | Marks |
|---|---|
| 2071 Bhadra | 12 |
| 2071 Magh | 7 |
| 2072 Ashwin | 6 |
| 2072 Magh | 5 |
| 2073 Bhadra | 12 |
| 2073 Magh | 6 |
| 2074 Bhadra | 10 |
| 2074 Magh | ~5 |
| 2075 Bhadra | 12 |
| 2075 Magh | 4 |
| 2076 Bhadra | 9 |
| 2078 Chaitra | 12 |
| 2079 Chaitra | 16 |
| 2080 Chaitra | 17 |
| 2081 Chaitra | 10 |
| 2082 Shrawan | — |
Frequently Asked Topics
| Topic | Times Asked | Frequency |
|---|---|---|
| Compression | 10 | |
| Concept of Data Model | 8 | |
| Raster Data Model | 5 | |
| Topology | 3 | |
| Vector Data Model | 2 | |
| TIN Data Model | 2 |
Topic-wise Importance & Exam Tips
| Topic | Importance | Key Points / Exam Tips |
|---|---|---|
| Raster vs Vector data model comparison | High | Very frequently asked. Use comparison table covering structure, accuracy, storage, analysis, and best-use cases. |
| Topology in vector data model | High | Define topology, explain three topological rules (connectivity, adjacency/contiguity, containment). Draw node-arc-polygon diagrams. |
| TIN data model | High | Explain Delaunay triangulation, advantages over raster DEM, and applications in terrain modeling. |
| Raster compression (Run-length encoding, Quadtree) | Medium | Numerical problems may be asked. Know how to compress a grid and calculate percentage decrease in storage. |
| Concept of data model | Medium | Define what a spatial data model is and why it's needed to represent real-world features digitally. |
| Indexing and hierarchical data structures | Low | Brief explanation of quadtree indexing for spatial search optimization. |
Key Concepts (Textbook pp.67–86)
- Geographic Phenomenon: “A manifestation of an entity or process of interest that can be named or described, can be georeferenced, and can be assigned a time interval at which it is/was present.” (Textbook p.67)
- Geographic Field: A phenomenon for which, at every point in the study area, a value can be determined: f(x,y) → value. Examples: elevation, temperature, rainfall. (Textbook p.69)
- Geographic Object: Well-distinguished, discrete, bounded entities that populate the study area. The space between objects is potentially “empty.” Examples: buildings, roads, lakes. (Textbook p.70)
- Rule of Thumb: Natural phenomena are usually modelled as fields (e.g., elevation surface). Man-made features are usually modelled as objects (e.g., buildings, roads). (Textbook p.70)
- Tobler’s First Law of Geography: “Locations that are closer together are more likely to have similar values than locations that are far apart.” This principle of spatial autocorrelation underpins interpolation and geostatistics. (Textbook p.83)
- Continuous vs. Discrete Fields: Continuous fields change gradually (elevation, temperature). Discrete fields divide space into bounded parts, each with a single value (land use, soil type). (Textbook pp.72–73)
- Crisp vs. Fuzzy Boundaries: Crisp boundaries can be determined with arbitrary precision (man-made: political borders, property lines). Fuzzy boundaries are transition zones (natural: soil types, vegetation gradients). (Textbook p.81)
1. Types of Spatial Data Models in GIS
PAST EXAM QUESTIONS ON THIS TOPIC:
- Explain different types of data models [4] (2073 Bhadra, Q3a)
- Explain different types of data models [3] (2076 Bhadra, Q3a)
- Explain different types of data models in GIS [6] (2078 Chaitra, Q1)
A data model in GIS is a mathematical and conceptual framework used to represent real-world geographic features in a digital format. The primary spatial data models used to abstract and manage this information include:
- Vector Data Model: Represents discrete geographic features using coordinates to form points, lines, and polygons. It is ideal for objects with distinct boundaries, such as buildings, administrative borders, or road networks.
- Raster Data Model: Represents continuous spatial phenomena through a grid of equally sized cells (pixels), where each cell holds a specific value. It is best suited for continuous data like elevation, temperature, or satellite imagery.
- TIN (Triangulated Irregular Network): A vector-based representation of a continuous surface consisting of non-overlapping, contiguous triangles. It is primarily used for high-precision elevation modeling and terrain analysis.
2. The Network Data Model
PAST EXAM QUESTIONS ON THIS TOPIC:
- What is the Network data model? Describe with examples [6] (2075 Bhadra, Q5)
The Network Data Model is a specialized, topologically structured vector model designed to represent interconnected linear features. It defines how lines connect to each other at nodes (intersections) to model the flow of resources or movement.
- Examples: It is heavily used in civil engineering and urban planning to map road networks (for finding the shortest route), river systems (for tracing hydrological flow), and utility grids (such as water pipes or electrical lines to manage distribution and outages).
3. Attribute Variables: Qualitative vs. Quantitative
PAST EXAM QUESTIONS ON THIS TOPIC:
- Write short notes on: Different types of attribute variable used in GIS [2] (2074 Bhadra, Q6iii)
- Differentiate between qualitative and quantitative attributes in a vector dataset [4] (2080 Chaitra, Q8a)
Attribute data provides the descriptive, non-spatial information linked to spatial geometries. These variables are broadly categorized into two types:
| Aspect | Qualitative Attributes | Quantitative Attributes |
|---|---|---|
| Definition | Categorical/descriptive properties without numerical value or rank | Measurable numerical quantities that define magnitude |
| Nature | Describes "what kind" or "which category" | Describes "how much" or "how many" |
| Sub-types | Nominal (names, categories) and Ordinal (ranked categories) | Discrete (counts) and Continuous (measurements) |
| Examples | City name, soil type (sandy, clay), zoning categories | Population (50,000), road length (2.5 km), temperature (25°C) |
| Mathematical operations | Cannot calculate mean or sum (only mode, frequency) | Can calculate mean, sum, standard deviation, etc. |
| Symbology in GIS | Unique values / categorized symbols (different colors per category) | Graduated colors or proportional symbols |
| Classification method | Unique values | Equal interval, quantile, natural breaks, standard deviation |
4. Levels of Measurement and their Impact on Symbology
PAST EXAM QUESTIONS ON THIS TOPIC:
- What are the levels of measurement of attribute data? How do they affect the symbology? [6] (2079 Chaitra, Q3a)
- Explain four levels (nominal, ordinal, interval, ratio) of commonly recognized data measurement (2081 Chaitra)
The scale of measurement of attribute data dictates the analytical operations possible and directly determines the symbology used to visually communicate the map's message.
- Nominal Data: Categorical data with no inherent order or ranking (e.g., land use types like forest, agriculture, urban).
- Symbology: Represented using "Unique Values." Different categories are shown using distinct, unranked colors or distinct symbols (e.g., green for forest, gray for urban).
- Ordinal Data: Categorical data that has a logical order or rank, but the intervals between ranks are not mathematically equal (e.g., risk zones classified as low, medium, and high).
- Symbology: Represented using "Graduated Colors," typically a sequential color ramp (e.g., light yellow for low risk, transitioning to dark red for high risk).
- Interval Data: Numeric data with a known, equal interval between values, but lacking a true zero point (e.g., Temperature in Celsius or elevation above sea level, where zero does not signify the absolute absence of the quantity).
- Symbology: Often mapped using classified numeric ranges with graduated color schemes, or diverging color ramps to show variation above and below a central mean.
- Ratio Data: Numeric data with a true, absolute zero point, allowing for proportional comparisons (e.g., population count, area, distance).
- Symbology: Effectively represented using "Proportional Symbols" (e.g., larger circles for cities with higher populations) or "Graduated Colors" normalized by area (like a choropleth map showing population density).
1. Vector vs. Raster Data Models
PAST EXAM QUESTIONS ON THIS TOPIC:
- Explain Vector model and Raster GIS Model with suitable examples [Part of 10] (2074 Magh, Q1)
- Discuss the key differences between vector and raster data models, highlighting strengths and weaknesses. Include a sketch [3+4] (2080 Chaitra, Q1)
- What are the basic elements of raster data model? Explain advantage and disadvantage of raster vs vector [3+] (2072 Magh, Q3)
Geographic Information Systems (GIS) use two main ways to represent the real world: Vector and Raster.
| Feature | Vector Data Model | Raster Data Model |
|---|---|---|
| Basic Concept | Uses geometry (points, lines, polygons) to represent exact real-world shapes. | Uses a grid of square cells (pixels) to cover an area, where each cell has a value. |
| Best Used For | Discrete data with clear boundaries (e.g., a specific building, a road, a property line). | Continuous data that changes smoothly over space (e.g., elevation, temperature, rainfall). |
| Visualizing a Scene | A tree is a single point, a road is a smooth line, and a building is an exact enclosed shape (polygon). | The entire area is a grid. A building is a group of cells colored "building," and a road is a jagged line of "road" cells. |
| Advantages | Very accurate boundaries; smaller file sizes; excellent for network analysis (like finding the shortest driving route). | Simple structure; great for overlaying maps; handles continuous surfaces and satellite imagery perfectly. |
| Disadvantages | Complex data structure; bad for continuous gradients like elevation; overlaying maps requires heavy computing. | Can look pixelated/blocky; large file sizes; terrible for precise network routing. |
Important Distinctions (Textbook pp.86–94)
- Grid vs. Raster: These terms are not synonymous. A grid stores values at the intersections of regularly spaced lines. A raster stores values for the entire cell area (cell values, not point values). The value for a raster cell is assumed valid for all locations within that cell. (Textbook p.86)
- Resolution: The cell size determines the level of detail. Smaller cells → better quality but larger file size. Cell size should match the accuracy of the original data source. (Lectures p.13)
- Raster Algebra: Because raster cells can be handled as 2D arrays, many analytical operations (overlay, neighbourhood) are easy to program. This makes raster structures popular for mathematical modelling. (Lectures p.13)
2. Types of Raster Models
PAST EXAM QUESTIONS ON THIS TOPIC:
- Explain different types of Raster Models [6] (2071 Bhadra, Q3a)
Raster models are grouped into three basic types based on what their grid cells represent:
- Continuous (Surface) Rasters: Values change gradually. For example, an elevation map where cell values represent height above sea level. There are no sudden boundaries.
- Discrete (Thematic) Rasters: Values represent categories. For example, a land-use map where all cells representing "forest" have a value of 1, and all cells representing "water" have a value of 2.
- Image Rasters: Values represent light or energy. This is typical for satellite imagery or drone photos.
3. Raster Compression & Vectorization
PAST EXAM QUESTIONS ON THIS TOPIC:
- Explain the raster compression techniques with appropriate examples [4] (2079 Chaitra, Q3b/Q4b)
- Define the terms region quadtree and vectorization [1+1] (2071 Magh, Q2a)
- Explain run length and quadtree compression techniques for raster data. (2081 Chaitra)
- Explain run length and quadtree compression techniques for raster data. (2081 Chaitra)
Raster files (grids) can get huge. We use compression techniques to make the files smaller without losing information.
- Run Length Encoding (RLE):
- How it works: Instead of saving the value of every single cell in a row, it groups identical values together.
- Example: If a row has five cells of "Forest" (Value 1), instead of storing 1, 1, 1, 1, 1, RLE stores it as (5 of 1).
- Region Quadtree:
- How it works: It divides the entire map grid into four large square blocks (quadrants). If a block is completely uniform (e.g., all water), it stops. If a block has mixed values (e.g., water and land), it splits that block into four smaller blocks. It repeats this until every block contains only one uniform value.
- Vectorization (Concept):
- How it works: This is the process of converting a Raster grid into Vector lines and polygons. Think of it as tracing a scanned pixelated image to create smooth, editable lines.
4. Raster Data Storage Formats (BSQ, BIL, BIP)
PAST EXAM QUESTIONS ON THIS TOPIC:
- Illustrate BSQ, BIL, and BIP raster format (2075 Magh, Q5d)
When working with satellite images that have multiple layers (like a Red band, a Green band, and a Blue band), the computer needs a rule for how to store that data line-by-line.
- BSQ (Band Sequential): Stores all the data for Band 1 first, then all the data for Band 2, and so on. (Great if you only want to look at one band at a time).
- BIL (Band Interleaved by Line): Stores row 1 of Band 1, then row 1 of Band 2, then row 1 of Band 3. Then it moves to row 2. (A good middle-ground format).
- BIP (Band Interleaved by Pixel): Stores pixel 1 of Band 1, pixel 1 of Band 2, pixel 1 of Band 3. Then moves to pixel 2. (Great for analyzing the exact color of a specific spot quickly).
3.4 Indexing and Hierarchical Data Structures
No direct past exam questions have been asked from this section, but it is part of the syllabus and may appear in future exams.
When a GIS database contains millions of spatial features (e.g., every building in Kathmandu Valley), finding which features fall within a query area requires an efficient search strategy. Spatial indexing organizes features so the system doesn't have to check every single feature — it can quickly narrow down candidates.
Why Spatial Indexing is Needed
Without indexing, a spatial query like "Find all buildings within 1 km of this road" would require checking every building in the entire database — a brute-force approach that becomes impossibly slow with large datasets. Spatial indexes partition space into manageable regions so only relevant features are examined.
Common Spatial Indexing Methods
-
Grid Index: The study area is divided into a regular grid of equal-sized cells. Each feature is assigned to the cell(s) it overlaps. During a query, only features in the relevant cells are checked.
- Advantage: Simple to implement
- Disadvantage: Inefficient when features are unevenly distributed (many empty cells, some overloaded cells)
-
Quadtree: A hierarchical structure that recursively subdivides space into four quadrants. Areas with more features are subdivided further, while empty areas remain as large, undivided blocks. (This is related to the quadtree compression technique covered in Section 3.3.)
- Advantage: Adapts to data density — more detail where needed
- Disadvantage: More complex to build and maintain
-
R-Tree (Rectangle Tree): Groups nearby spatial objects into minimum bounding rectangles (MBRs) and organizes them in a balanced tree structure. When searching, the algorithm first checks which bounding rectangles intersect the query window, then examines the actual features only within matching rectangles.
- Advantage: Very efficient for both point and polygon data; used in most modern GIS (PostGIS, ArcGIS)
- Disadvantage: MBRs can overlap, causing some redundant checks
Hierarchical Data Structures
In the context of GIS, hierarchical structures organize spatial data in a tree-like fashion where:
- The root represents the entire study area
- Each branch represents a spatial subdivision
- The leaves contain the actual data values or feature references
Examples include the quadtree (divides into 4), octree (divides into 8, used for 3D data), and k-d trees (binary space partitioning). These structures enable fast spatial searches with time complexity of O(log n) instead of O(n).
1. Concept and Importance of Topology
PAST EXAM QUESTIONS ON THIS TOPIC:
- Write short notes on: Topology [3] (2071 Magh, Q6b)
- Why is topology important in GIS? (2075 Bhadra, Q3b)
What is Topology? Topology is a set of rules and mathematical concepts that define the spatial relationships between adjacent or connected geographic features (points, lines, and polygons) in a vector data model. It dictates how features share geometry.
Why is it important in GIS?
- Data Quality and Validation: Topology ensures data integrity by preventing common digitizing errors. It forces boundaries to match perfectly, eliminating overlapping polygons or empty gaps (slivers) between adjacent features like land parcels.
- Connectivity (Network Analysis): It explicitly defines how lines connect at intersections (nodes). This is absolutely critical for network analysis, such as finding the shortest driving route, modeling water flow in pipes, or analyzing traffic.
- Adjacency and Containment: Topology allows the GIS software to "know" spatial facts without calculating them on the fly. It knows which countries share a border (adjacency) or which cities are located entirely within a specific province (containment).
2. The TIN (Triangulated Irregular Network) Data Model
PAST EXAM QUESTIONS ON THIS TOPIC:
- Explain TIN Data model [4] (2072 Ashwin, Q1c)
- Does TIN belong to a raster or a vector and why? [4] (2071 Magh, Q2a)
What is a TIN? A TIN is a digital data structure used to represent continuous 3D surfaces most commonly terrain or elevation. It constructs this surface using a network of non-overlapping contiguous triangles. The corners of these triangles are created from irregularly spaced data points (called mass points) where each point contains an X Y and Z (elevation) coordinate.
Does TIN belong to Raster or Vector?
A TIN strictly belongs to the vector data model.
Why? Unlike a raster model which relies on a uniform grid of identical square cells (pixels) to represent a surface a TIN is built entirely from fundamental vector geometries. It uses points (the nodes with XYZ coordinates) connected by lines (the edges) to form polygons (the triangular faces). Because it does not use a continuous pixel grid it is classified as a vector surface model.
Delaunay Triangulation (Textbook p.94)
Delaunay triangulation is a method of constructing triangles from a set of sample points such that the triangles are as equilateral as possible. The key property: the circumscribed circle (circumcircle) of each triangle contains no other anchor/sample point inside it. This maximizes the minimum angle of all triangles, avoiding long, thin “sliver” triangles that produce poor interpolation results.
Thiessen/Voronoi Polygons: The dual of a Delaunay triangulation. Each Voronoi polygon contains all locations closer to a particular sample point than to any other sample point. Together, Delaunay triangulation and Voronoi polygons provide complementary views of spatial proximity.
3. Topology within the TIN Data Model
PAST EXAM QUESTIONS ON THIS TOPIC:
- What is topology in TIN data model? [2] (2073 Bhadra, Q3b)
What is topology in a TIN?
In a TIN model topology refers to the explicit mathematical relationships maintained between its components: the nodes edges and triangular faces.
- The Structure: The TIN database doesn't just draw triangles; it explicitly records which three nodes make up a specific triangle and which triangles share a common edge.
- The Rule: In a proper TIN topology every edge is shared by exactly two adjacent triangles (unless it is on the outer boundary of the model) and multiple triangles share the same corner node.
- The Benefit: Because these topological relationships are hardcoded the GIS can rapidly perform complex 3D surface analyses across the terrain such as calculating slope aspect (the direction a slope faces) and line-of-sight visibility without having to recalculate how the points connect every time.
Numerical Procedures
Lossless vs. Lossy Compression (Lectures p.14, 16)
- Lossless compression: Original data can be precisely reconstructed. Run-length encoding (RLE) and block encoding are lossless. Suitable for DEMs and classified rasters where exact values matter.
- Lossy compression: Data cannot be fully reconstructed but achieves much higher compression ratios. MrSID (wavelet-based) can compress aerial photographs dramatically but is not suitable for DEMs or analytical rasters.
- JPEG 2000: Uses wavelet compression similar to MrSID, increasingly used for image compression in geospatial applications.
- File size examples: A 30 m DEM ≈ 1.1 MB; a 10 m DEM ≈ 9.9 MB. High-resolution rasters require compression for practical storage and web delivery. (Lectures p.14)
1. Run Length Encoding (RLE)
(Applies to questions asking for Run Length Encoding)
This method compresses data by grouping identical adjacent cell values in a single row.
- Read Row by Row: Start at the top-left cell of the raster grid and read across the first row.
- Count Consecutive Values: Count how many times a specific value repeats sequentially.
- Write the Pair: Write down the count followed by the value. (For example if you see five cells with the number "27" write it as (5 27) or 5:27).
- Reset at Changes or New Rows: When the number changes start a new count. When you reach the end of a row always start a fresh count for the next row (standard row-by-row RLE).
- Final Output: Your answer should be a linear list of these pairs for the entire grid.
2. Quadtree Encoding
(Applies to questions asking for Quad tree encoding)
This is a spatial compression method that divides grids into four quadrants (NW NE SW SE).
- Check the Whole Grid: Look at the entire grid (e.g. 8x8). Does every single cell have the exact same value?
- If yes: The entire grid is just one value. Stop.
- If no: Proceed to Step 2.
- Divide into Four: Split the grid evenly into four quadrants.
- Evaluate Each Quadrant: Look at the top-left quadrant (NW) first.
- Are all cells inside it identical? If yes record that value.
- If there are mixed values split that specific quadrant into four smaller quadrants.
- Repeat (Recurse): Continue this process of evaluating and splitting for the NE SW and SE quadrants. Keep splitting mixed blocks until every block you have contains only a single uniform value.
- Final Output: Draw a tree diagram. The top root is the whole grid branching into 4 nodes. Uniform nodes stop (leaf nodes). Mixed nodes branch into 4 more nodes.
3. Block Encoding
(Applies to questions asking for Block encoding)
Instead of grouping rows or dividing by strict quadrants this method looks for the largest possible square blocks of identical values anywhere in the grid.
- Find the Largest Squares: Scan the grid for the biggest possible square (e.g. 4x4) where all cells are the exact same value.
- Record the Block: Write down three things for that block:
- Its starting coordinate (usually the row and column of its top-left or bottom-left corner).
- The size of the square (e.g. 4).
- The value of the cells inside it.
- Move to Smaller Squares: Once you've mapped out the largest squares find the next largest (e.g. 2x2 squares) and record them.
- Record Single Cells: Finally any leftover cells that don't form a 2x2 or larger square must be recorded as 1x1 blocks.
- Final Output: A list of coordinates sizes and values.
4. Chain Encoding
(Applies to questions asking for Chain encoding)
This method is used to trace the boundary of a specific feature (like a polygon of "forest" cells). It relies on a directional grid (usually 0 to 7 where 0 is East 1 is North-East 2 is North etc.).
- Pick a Start Node: Choose an outer boundary pixel of the shape you are tracing. Record its (X Y) coordinate as the starting point.
- Trace the Boundary: Move to the next adjacent pixel along the boundary of the shape.
- Record the Direction: Write down the directional code (0-7) that corresponds to the direction you just moved.
- Loop Back: Continue moving along the edge recording the direction code for every step until you arrive back at your starting pixel.
- Final Output: The starting coordinate followed by a sequence of directional numbers.
5. Value Point Encoding
(Applies to questions asking for Value point encoding)
This is basically an index of coordinates for every value.
- List Unique Values: Look at the grid and write down every unique value that appears (e.g. Forest Water Settlement).
- Find Coordinates: Establish a coordinate system (e.g. top-left cell is 0 0 or 1 1).
- Group by Value: For each unique value simply write a list of the (X Y) coordinates of every single cell that contains that value.
- Final Output: A grouped list: Value A: (1 1) (1 2) (2 1)...
6. Calculating Percentage Decrease in Size
(Applies to questions asking for % decrease in size)
This proves how effective your compression was.
- Calculate Uncompressed Size: Count the total number of cells in the original grid (e.g. an 8x8 grid = 64 cells).
- Calculate Compressed Size: Count the number of data elements in your compressed version. (For RLE count the number of data pairs you created. For Quadtree count the total number of leaf nodes in your tree).
- Apply the Formula: Use the standard percentage decrease formula:
Percentage Decrease = ((Uncompressed Size − Compressed Size) / Uncompressed Size) × 100%
Solved Numerical Examples (Past Exam Questions)
The following are fully worked solutions from past examination papers demonstrating the practical application of every raster encoding method. Study the step-by-step approach carefully — the same methodology applies to any grid you encounter in the exam.
Example 1
PAST EXAM QUESTIONS ON THIS TOPIC:
- Write down the three raster encoding methods and % decrease in size for the following figure [6] (2074 Bhadra, Q1b)
- How is the following raster encoded using full raster encoding, run length encoding, quad tree encoding, and value point encoding? [6] (2073 Magh, Q3)
Given Grid (8 × 8):
| C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | |
|---|---|---|---|---|---|---|---|---|
| R1 | F | F | F | F | W | W | F | F |
| R2 | F | F | F | F | W | W | F | F |
| R3 | F | F | F | F | O | O | F | F |
| R4 | F | F | F | F | O | O | F | F |
| R5 | F | F | F | F | S | S | S | S |
| R6 | F | F | F | F | S | S | S | S |
| R7 | F | F | F | F | S | S | W | W |
| R8 | F | F | F | F | S | S | W | W |
Original (uncompressed) size = 8 × 8 = 64 cells.
Solution (a) — Full Raster:
Simply list every cell value row by row. Total stored values = 64 (no compression).
F F F F W W F F | F F F F W W F F | F F F F O O F F | F F F F O O F F | F F F F S S S S | F F F F S S S S | F F F F S S W W | F F F F S S W W
Solution (b) — Run-Length Encoding (RLE):
| Row | RLE Pairs | Pairs |
|---|---|---|
| R1 | (F, 4), (W, 2), (F, 2) | 3 |
| R2 | (F, 4), (W, 2), (F, 2) | 3 |
| R3 | (F, 4), (O, 2), (F, 2) | 3 |
| R4 | (F, 4), (O, 2), (F, 2) | 3 |
| R5 | (F, 4), (S, 4) | 2 |
| R6 | (F, 4), (S, 4) | 2 |
| R7 | (F, 4), (S, 2), (W, 2) | 3 |
| R8 | (F, 4), (S, 2), (W, 2) | 3 |
Total RLE pairs = 3 + 3 + 3 + 3 + 2 + 2 + 3 + 3 = 22
Solution (c) — Quadtree Encoding:
Recursively divide the 8 × 8 grid into four equal quadrants. If a quadrant is homogeneous (all cells same value), it becomes a leaf node. Otherwise, subdivide again.
- Root (8 × 8): Not uniform → Split into four 4 × 4 quadrants
- NW (R1–4, C1–4): All F → Leaf: F
- NE (R1–4, C5–8): Mixed (W, F, O) → Split into four 2 × 2
- NE-NW (R1–2, C5–6): All W → Leaf: W
- NE-NE (R1–2, C7–8): All F → Leaf: F
- NE-SW (R3–4, C5–6): All O → Leaf: O
- NE-SE (R3–4, C7–8): All F → Leaf: F
- SW (R5–8, C1–4): All F → Leaf: F
- SE (R5–8, C5–8): Mixed (S, W) → Split into four 2 × 2
- SE-NW (R5–6, C5–6): All S → Leaf: S
- SE-NE (R5–6, C7–8): All S → Leaf: S
- SE-SW (R7–8, C5–6): All S → Leaf: S
- SE-SE (R7–8, C7–8): All W → Leaf: W
Total leaf nodes = 10 (F, W, F, O, F, F, S, S, S, W)
Solution (d) — Value Point Encoding:
List every unique value and the (Row, Col) coordinates of each cell containing that value:
| Value | Coordinates | Count |
|---|---|---|
| F | (1,1)–(1,4), (1,7)–(1,8), (2,1)–(2,4), (2,7)–(2,8), (3,1)–(3,4), (3,7)–(3,8), (4,1)–(4,4), (4,7)–(4,8), (5,1)–(5,4), (6,1)–(6,4), (7,1)–(7,4), (8,1)–(8,4) | 40 |
| W | (1,5), (1,6), (2,5), (2,6), (7,7), (7,8), (8,7), (8,8) | 8 |
| O | (3,5), (3,6), (4,5), (4,6) | 4 |
| S | (5,5)–(5,8), (6,5)–(6,8), (7,5), (7,6), (8,5), (8,6) | 12 |
Unique values = 4. All 64 cell positions are recorded, grouped under their respective values.
Example 3
PAST EXAM QUESTIONS ON THIS TOPIC:
- Compress the given raster data using the quadtree method [4] (2075 Bhadra, Q3a)
Given Grid (8 × 8):
| C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | |
|---|---|---|---|---|---|---|---|---|
| R1 | 12 | 12 | 12 | 12 | 10 | 10 | 10 | 10 |
| R2 | 12 | 12 | 12 | 12 | 10 | 10 | 10 | 10 |
| R3 | 12 | 12 | 12 | 12 | 10 | 10 | 10 | 10 |
| R4 | 12 | 12 | 12 | 12 | 10 | 10 | 10 | 10 |
| R5 | 9 | 9 | 7 | 2 | 6 | 6 | 4 | 4 |
| R6 | 9 | 9 | 1 | 3 | 6 | 6 | 4 | 4 |
| R7 | 3 | 3 | 8 | 8 | 2 | 2 | 5 | 5 |
| R8 | 3 | 3 | 8 | 8 | 2 | 2 | 5 | 5 |
Original size = 8 × 8 = 64 cells.
Quadtree Decomposition:
- Root (8 × 8): Not uniform → Split
- NW (R1–4, C1–4): All 12 → Leaf: 12
- NE (R1–4, C5–8): All 10 → Leaf: 10
- SW (R5–8, C1–4): Mixed → Split
- SW-NW (R5–6, C1–2): All 9 → Leaf: 9
- SW-NE (R5–6, C3–4): Mixed (7, 2, 1, 3) → Split
- SW-NE-NW (R5, C3): 7 → Leaf: 7
- SW-NE-NE (R5, C4): 2 → Leaf: 2
- SW-NE-SW (R6, C3): 1 → Leaf: 1
- SW-NE-SE (R6, C4): 3 → Leaf: 3
- SW-SW (R7–8, C1–2): All 3 → Leaf: 3
- SW-SE (R7–8, C3–4): All 8 → Leaf: 8
- SE (R5–8, C5–8): Mixed → Split
- SE-NW (R5–6, C5–6): All 6 → Leaf: 6
- SE-NE (R5–6, C7–8): All 4 → Leaf: 4
- SE-SW (R7–8, C5–6): All 2 → Leaf: 2
- SE-SE (R7–8, C7–8): All 5 → Leaf: 5
Total leaf nodes = 13: (12, 10, 9, 7, 2, 1, 3, 3, 8, 6, 4, 2, 5)
Example 4
PAST EXAM QUESTIONS ON THIS TOPIC:
- Explain run length encoding. Also produce: (a) Quad tree (b) Block encoding (c) Chain encoding [4+2+2+2] (2080 Chaitra, Q7)
Given Grid (8 × 8):
| C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | |
|---|---|---|---|---|---|---|---|---|
| R1 | 25 | 25 | 31 | 31 | 25 | 25 | 3 | 3 |
| R2 | 25 | 25 | 31 | 31 | 25 | 25 | 3 | 3 |
| R3 | 25 | 25 | 31 | 31 | 25 | 25 | 3 | 3 |
| R4 | 25 | 25 | 31 | 31 | 25 | 25 | 3 | 3 |
| R5 | 27 | 27 | 27 | 27 | 27 | 27 | 27 | 27 |
| R6 | 27 | 27 | 27 | 27 | 27 | 27 | 27 | 27 |
| R7 | 27 | 27 | 27 | 27 | 27 | 27 | 35 | 27 |
| R8 | 27 | 27 | 27 | 27 | 27 | 27 | 27 | 27 |
Original size = 8 × 8 = 64 cells.
Solution (a) — Run-Length Encoding (RLE) [4 marks]:
| Row | RLE Pairs | Pairs |
|---|---|---|
| R1 | (25, 2), (31, 2), (25, 2), (3, 2) | 4 |
| R2 | (25, 2), (31, 2), (25, 2), (3, 2) | 4 |
| R3 | (25, 2), (31, 2), (25, 2), (3, 2) | 4 |
| R4 | (25, 2), (31, 2), (25, 2), (3, 2) | 4 |
| R5 | (27, 8) | 1 |
| R6 | (27, 8) | 1 |
| R7 | (27, 6), (35, 1), (27, 1) | 3 |
| R8 | (27, 8) | 1 |
Total RLE pairs = 4 + 4 + 4 + 4 + 1 + 1 + 3 + 1 = 22
Solution (b) — Quadtree Encoding [2 marks]:
- Root (8 × 8): Not uniform → Split
- NW (R1–4, C1–4): Mixed (25, 31) → Split
- NW-NW (R1–2, C1–2): All 25 → Leaf: 25
- NW-NE (R1–2, C3–4): All 31 → Leaf: 31
- NW-SW (R3–4, C1–2): All 25 → Leaf: 25
- NW-SE (R3–4, C3–4): All 31 → Leaf: 31
- NE (R1–4, C5–8): Mixed (25, 3) → Split
- NE-NW (R1–2, C5–6): All 25 → Leaf: 25
- NE-NE (R1–2, C7–8): All 3 → Leaf: 3
- NE-SW (R3–4, C5–6): All 25 → Leaf: 25
- NE-SE (R3–4, C7–8): All 3 → Leaf: 3
- SW (R5–8, C1–4): All 27 → Leaf: 27
- SE (R5–8, C5–8): Mixed (27, 35) → Split
- SE-NW (R5–6, C5–6): All 27 → Leaf: 27
- SE-NE (R5–6, C7–8): All 27 → Leaf: 27
- SE-SW (R7–8, C5–6): All 27 → Leaf: 27
- SE-SE (R7–8, C7–8): Mixed (35, 27) → Split
- SE-SE-NW (R7, C7): 35 → Leaf: 35
- SE-SE-NE (R7, C8): 27 → Leaf: 27
- SE-SE-SW (R8, C7): 27 → Leaf: 27
- SE-SE-SE (R8, C8): 27 → Leaf: 27
- NW (R1–4, C1–4): Mixed (25, 31) → Split
Total leaf nodes = 16
Solution (c) — Block Encoding [2 marks]:
Identify the largest homogeneous rectangular blocks:
| Block | Value | Start | Size | Cells |
|---|---|---|---|---|
| B1 | 25 | (R1, C1) | 4 × 2 | 8 |
| B2 | 31 | (R1, C3) | 4 × 2 | 8 |
| B3 | 25 | (R1, C5) | 4 × 2 | 8 |
| B4 | 3 | (R1, C7) | 4 × 2 | 8 |
| B5 | 27 | (R5, C1) | 4 × 6 | 24 |
| B6 | 27 | (R5, C7) | 2 × 2 | 4 |
| B7 | 35 | (R7, C7) | 1 × 1 | 1 |
| B8 | 27 | (R7, C8) | 1 × 1 | 1 |
| B9 | 27 | (R8, C7) | 1 × 2 | 2 |
Total blocks = 9
Solution (d) — Chain Encoding [2 marks]:
Chain encoding traces the boundary of each connected region using the 8-direction Freeman chain code:
2 = North (↑) 0 = East (→) 6 = South (↓) 4 = West (←)
Trace the boundary of each distinct region clockwise from its top-left cell:
| Region (Value) | Start Cell | Freeman Chain Code |
|---|---|---|
| 25 (Patch 1: R1–4, C1–2) | (1, 1) | 0, 6, 6, 6, 4, 2, 2, 2 |
| 31 (R1–4, C3–4) | (1, 3) | 0, 6, 6, 6, 4, 2, 2, 2 |
| 25 (Patch 2: R1–4, C5–6) | (1, 5) | 0, 6, 6, 6, 4, 2, 2, 2 |
| 3 (R1–4, C7–8) | (1, 7) | 0, 6, 6, 6, 4, 2, 2, 2 |
| 27 (R5–8, C1–8, except (7,7)) | (5, 1) | 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2 |
| 35 (single cell R7, C7) | (7, 7) | 0, 6, 4, 2 (single-cell boundary) |
Example 5
PAST EXAM QUESTIONS ON THIS TOPIC:
- How will the following land use raster be compressed using quadtree compression technique and run length coding technique? [6] (2076 Bhadra, Q3b)
Given Grid (8 × 8):
| C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | |
|---|---|---|---|---|---|---|---|---|
| R1 | 1 | 1 | 1 | 1 | 3 | 3 | 4 | 4 |
| R2 | 1 | 1 | 1 | 1 | 3 | 3 | 4 | 4 |
| R3 | 1 | 1 | 1 | 1 | 3 | 3 | 4 | 4 |
| R4 | 1 | 1 | 1 | 1 | 5 | 5 | 5 | 4 |
| R5 | 2 | 2 | 2 | 2 | 5 | 5 | 5 | 5 |
| R6 | 2 | 2 | 2 | 2 | 5 | 5 | 5 | 5 |
| R7 | 1 | 1 | 1 | 1 | 3 | 3 | 5 | 5 |
| R8 | 1 | 1 | 1 | 1 | 3 | 3 | 5 | 5 |
Original size = 8 × 8 = 64 cells.
Solution (a) — Quadtree Encoding:
- Root (8 × 8): Not uniform → Split
- NW (R1–4, C1–4): All 1 → Leaf: 1
- NE (R1–4, C5–8): Mixed (3, 4, 5) → Split
- NE-NW (R1–2, C5–6): All 3 → Leaf: 3
- NE-NE (R1–2, C7–8): All 4 → Leaf: 4
- NE-SW (R3–4, C5–6): Mixed (3,3,5,5) → Split
- NE-SW-NW (R3, C5): 3 → Leaf: 3
- NE-SW-NE (R3, C6): 3 → Leaf: 3
- NE-SW-SW (R4, C5): 5 → Leaf: 5
- NE-SW-SE (R4, C6): 5 → Leaf: 5
- NE-SE (R3–4, C7–8): Mixed (4,4,5,4) → Split
- NE-SE-NW (R3, C7): 4 → Leaf: 4
- NE-SE-NE (R3, C8): 4 → Leaf: 4
- NE-SE-SW (R4, C7): 5 → Leaf: 5
- NE-SE-SE (R4, C8): 4 → Leaf: 4
- SW (R5–8, C1–4): Mixed (2, 1) → Split
- SW-NW (R5–6, C1–2): All 2 → Leaf: 2
- SW-NE (R5–6, C3–4): All 2 → Leaf: 2
- SW-SW (R7–8, C1–2): All 1 → Leaf: 1
- SW-SE (R7–8, C3–4): All 1 → Leaf: 1
- SE (R5–8, C5–8): Mixed (5, 3) → Split
- SE-NW (R5–6, C5–6): All 5 → Leaf: 5
- SE-NE (R5–6, C7–8): All 5 → Leaf: 5
- SE-SW (R7–8, C5–6): All 3 → Leaf: 3
- SE-SE (R7–8, C7–8): All 5 → Leaf: 5
Total leaf nodes = 19
Solution (b) — Run-Length Encoding (RLE):
| Row | RLE Pairs | Pairs |
|---|---|---|
| R1 | (1, 4), (3, 2), (4, 2) | 3 |
| R2 | (1, 4), (3, 2), (4, 2) | 3 |
| R3 | (1, 4), (3, 2), (4, 2) | 3 |
| R4 | (1, 4), (5, 3), (4, 1) | 3 |
| R5 | (2, 4), (5, 4) | 2 |
| R6 | (2, 4), (5, 4) | 2 |
| R7 | (1, 4), (3, 2), (5, 2) | 3 |
| R8 | (1, 4), (3, 2), (5, 2) | 3 |
Total RLE pairs = 3 + 3 + 3 + 3 + 2 + 2 + 3 + 3 = 22
Example 6
PAST EXAM QUESTIONS ON THIS TOPIC:
- Show the encoding of the following raster using run length and Quadtree encoding [6] (2073 Bhadra, Q3c)
Given Grid (8 × 8):
| C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | |
|---|---|---|---|---|---|---|---|---|
| R1 | 12 | 12 | 12 | 12 | 12 | 12 | 12 | 12 |
| R2 | 12 | 12 | 12 | 12 | 12 | 12 | 12 | 12 |
| R3 | 12 | 12 | 12 | 12 | 12 | 12 | 12 | 12 |
| R4 | 12 | 12 | 12 | 12 | 12 | 12 | 12 | 12 |
| R5 | 5 | 5 | 6 | 6 | 9 | 9 | 9 | 9 |
| R6 | 5 | 5 | 61 | 62 | 9 | 6 | 9 | 9 |
| R7 | 7 | 7 | 7 | 7 | 9 | 9 | 9 | 9 |
| R8 | 7 | 7 | 7 | 7 | 9 | 9 | 9 | 9 |
Original size = 8 × 8 = 64 cells.
Solution (a) — Run-Length Encoding (RLE):
| Row | RLE Pairs | Pairs |
|---|---|---|
| R1 | (12, 8) | 1 |
| R2 | (12, 8) | 1 |
| R3 | (12, 8) | 1 |
| R4 | (12, 8) | 1 |
| R5 | (5, 2), (6, 2), (9, 4) | 3 |
| R6 | (5, 2), (61, 1), (62, 1), (9, 1), (6, 1), (9, 2) | 6 |
| R7 | (7, 4), (9, 4) | 2 |
| R8 | (7, 4), (9, 4) | 2 |
Total RLE pairs = 1 + 1 + 1 + 1 + 3 + 6 + 2 + 2 = 17
Solution (b) — Quadtree Encoding:
- Root (8 × 8): Not uniform → Split
- NW (R1–4, C1–4): All 12 → Leaf: 12
- NE (R1–4, C5–8): All 12 → Leaf: 12
- SW (R5–8, C1–4): Mixed → Split
- SW-NW (R5–6, C1–2): All 5 → Leaf: 5
- SW-NE (R5–6, C3–4): Mixed (6, 6, 61, 62) → Split
- SW-NE-NW (R5, C3): 6 → Leaf: 6
- SW-NE-NE (R5, C4): 6 → Leaf: 6
- SW-NE-SW (R6, C3): 61 → Leaf: 61
- SW-NE-SE (R6, C4): 62 → Leaf: 62
- SW-SW (R7–8, C1–2): All 7 → Leaf: 7
- SW-SE (R7–8, C3–4): All 7 → Leaf: 7
- SE (R5–8, C5–8): Mixed → Split
- SE-NW (R5–6, C5–6): Mixed (9,6,9,62) → Split to 4 leaves
- SE-NE (R5–6, C7–8): All 9 → Leaf: 9
- SE-SW (R7–8, C5–6): All 9 → Leaf: 9
- SE-SE (R7–8, C7–8): All 9 → Leaf: 9
Total Quadtree leaf nodes = 2 (NW, NE) + 6 (SW children) + 7 (SE children) = 15 nodes (approx).
Interactive Raster Encoding Solver
Enter values into the 8×8 grid below (or load an exam preset) and instantly compute Run-Length Encoding (RLE), Quadtree Encoding, and percentage decrease. The solver shows every step of the encoding process.
🧩 Enter 8×8 Raster Grid
- SE-NW (R5–6, C5–6): Mixed (9, 9, 9, 6) → Split
- SE-NW-NW (R5, C5): 9 → Leaf: 9
- SE-NW-NE (R5, C6): 9 → Leaf: 9
- SE-NW-SW (R6, C5): 9 → Leaf: 9
- SE-NW-SE (R6, C6): 6 → Leaf: 6
- SE-NE (R5–6, C7–8): All 9 → Leaf: 9
- SE-SW (R7–8, C5–6): All 9 → Leaf: 9
- SE-SE (R7–8, C7–8): All 9 → Leaf: 9
Total leaf nodes = 16
Example 7
PAST EXAM QUESTIONS ON THIS TOPIC:
Past Exam Q7
Given Grid (8 × 8):
| C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | |
|---|---|---|---|---|---|---|---|---|
| R1 | 88 | 88 | 75 | 34 | 9 | 9 | 9 | 9 |
| R2 | 88 | 88 | 33 | 75 | 9 | 9 | 9 | 9 |
| R3 | 88 | 88 | 88 | 34 | 9 | 9 | 9 | 9 |
| R4 | 77 | 77 | 77 | 77 | 9 | 9 | 9 | 9 |
| R5 | 56 | 56 | 56 | 56 | 56 | 56 | 10 | 10 |
| R6 | 56 | 56 | 56 | 56 | 33 | 25 | 10 | 10 |
| R7 | 56 | 56 | 56 | 56 | 33 | 33 | 33 | 9 |
| R8 | 56 | 56 | 56 | 56 | 33 | 33 | 33 | 33 |
Original size = 8 × 8 = 64 cells.
Solution (a) — Run-Length Encoding (RLE):
| Row | RLE Pairs | Pairs |
|---|---|---|
| R1 | (88, 2), (75, 1), (34, 1), (9, 4) | 4 |
| R2 | (88, 2), (33, 1), (75, 1), (9, 4) | 4 |
| R3 | (88, 3), (34, 1), (9, 4) | 3 |
| R4 | (77, 4), (9, 4) | 2 |
| R5 | (56, 6), (10, 2) | 2 |
| R6 | (56, 4), (33, 1), (25, 1), (10, 2) | 4 |
| R7 | (56, 4), (33, 3), (9, 1) | 3 |
| R8 | (56, 4), (33, 4) | 2 |
Total RLE pairs = 4 + 4 + 3 + 2 + 2 + 4 + 3 + 2 = 24
Solution (b) — Quadtree Encoding:
- Root (8 × 8): Not uniform → Split
- NW (R1–4, C1–4): Mixed → Split
- NW-NW (R1–2, C1–2): All 88 → Leaf: 88
- NW-NE (R1–2, C3–4): Mixed (75, 34, 33, 75) → Split
- NW-NE-NW (R1, C3): 75 → Leaf: 75
- NW-NE-NE (R1, C4): 34 → Leaf: 34
- NW-NE-SW (R2, C3): 33 → Leaf: 33
- NW-NE-SE (R2, C4): 75 → Leaf: 75
- NW-SW (R3–4, C1–2): Mixed (88, 88, 77, 77) → Split
- NW-SW-NW (R3, C1): 88 → Leaf: 88
- NW-SW-NE (R3, C2): 88 → Leaf: 88
- NW-SW-SW (R4, C1): 77 → Leaf: 77
- NW-SW-SE (R4, C2): 77 → Leaf: 77
- NW-SE (R3–4, C3–4): Mixed (88, 34, 77, 77) → Split
- NW-SE-NW (R3, C3): 88 → Leaf: 88
- NW-SE-NE (R3, C4): 34 → Leaf: 34
- NW-SE-SW (R4, C3): 77 → Leaf: 77
- NW-SE-SE (R4, C4): 77 → Leaf: 77
- NE (R1–4, C5–8): All 9 → Leaf: 9
- SW (R5–8, C1–4): All 56 → Leaf: 56
- SE (R5–8, C5–8): Mixed → Split
- SE-NW (R5–6, C5–6): Mixed (56, 56, 33, 25) → Split
- SE-NW-NW (R5, C5): 56 → Leaf: 56
- SE-NW-NE (R5, C6): 56 → Leaf: 56
- SE-NW-SW (R6, C5): 33 → Leaf: 33
- SE-NW-SE (R6, C6): 25 → Leaf: 25
- SE-NE (R5–6, C7–8): All 10 → Leaf: 10
- SE-SW (R7–8, C5–6): All 33 → Leaf: 33
- SE-SE (R7–8, C7–8): Mixed (33, 9, 33, 33) → Split
- SE-SE-NW (R7, C7): 33 → Leaf: 33
- SE-SE-NE (R7, C8): 9 → Leaf: 9
- SE-SE-SW (R8, C7): 33 → Leaf: 33
- SE-SE-SE (R8, C8): 33 → Leaf: 33
- SE-NW (R5–6, C5–6): Mixed (56, 56, 33, 25) → Split
- NW (R1–4, C1–4): Mixed → Split
Total leaf nodes = 25
Chapter Summary
This chapter explains the three fundamental spatial data models used in GIS. The Raster Data Model represents the world as a grid of cells (pixels), each holding a single value — ideal for continuous phenomena like elevation, temperature, and rainfall. Raster compression techniques (run-length encoding, quadtree) reduce storage requirements. The Vector Data Model represents features as points, lines, and polygons with precise coordinates — ideal for discrete features like roads, buildings, and boundaries. Topology (the mathematical rules governing spatial relationships like adjacency, connectivity, containment) is critical for vector data integrity. The TIN (Triangulated Irregular Network) Data Model uses irregularly-spaced sample points connected into non-overlapping triangles (Delaunay triangulation) for efficient terrain surface modeling. Indexing and hierarchical data structures (quadtrees, R-trees) for efficient spatial data retrieval are also covered.