Elective Geographical Information System

Geographical Information SystemUnit 37 min read

Spatial Data Structures & GIS Database Design

Unit 3 of Geographical Information System: Explores how spatial data is organized in GIS (vector vs. raster models, topological structures, spatial indexing) and database design principles (relational vs. object-oriented, schema design for spatial queries, and normalization techniques).

Core Concepts: How GIS Stores Spatial Data

1. Vector vs. Raster Data Models

Spatial data in GIS is stored in two fundamental models: vector and raster. Each has distinct characteristics, trade-offs, and ideal use cases.

Vector Data Model

  • Represents geographic features as discrete objects (points, lines, polygons).
  • Uses coordinates (x,y) to define geometry.
  • Stores attributes (e.g., land use type, population) in tabular form.
  • Best for: Discrete features like roads, boundaries, or buildings.

Raster Data Model

  • Represents the world as a grid of cells (pixels), each with a value (e.g., elevation, land cover).
  • Uses cell resolution (e.g., 30m × 30m) to define precision.
  • Best for: Continuous phenomena like elevation, temperature, or satellite imagery.
classDiagram
    class Vector {
        +Points (x,y)
        +Lines (series of points)
        +Polygons (closed lines)
        +Attributes (tabular)
    }
    class Raster {
        +Grid cells (pixels)
        +Cell values (e.g., elevation, NDVI)
        +Resolution (cell size)
    }
    Vector --> "Uses" Coordinates
    Raster --> "Uses" Grid

Worked Example: Kathmandu Traffic Routes

  • Vector: Roads in Kathmandu are stored as lines with attributes like road_name, width, and traffic_volume.
  • Raster: Elevation data for the city is stored as a grid where each cell represents height above sea level (e.g., 1,250m).
  • Why? Vector is better for navigation apps (e.g., Pathao), while raster helps in terrain analysis for urban planning.

2. Spatial Data Structures

How GIS organizes vector data for efficient storage and querying.

A. Topological Structures

Topology defines spatial relationships between features (e.g., adjacency, connectivity, containment).

  • Key Topological Primitives:
    • Nodes: Endpoints of lines (e.g., road intersections).
    • Edges: Lines connecting nodes (e.g., road segments).
    • Faces: Polygons bounded by edges (e.g., administrative boundaries).
  • Example: In a digital map of Pokhara, a topological structure ensures that roads (edges) correctly connect at intersections (nodes), and lakes (polygons) are properly enclosed.
graph TD
    A["Node (Intersection)"] -->|"Edge"| B["Node (Next Intersection)"]
    A -->|"Edge"| C["Node (Third Intersection)"]
    B -->|"Edge"| C

B. Spatial Indexing

Accelerates queries by organizing data spatially (e.g., finding all features within a radius).

  • Common Techniques:
    • Quadtree: Recursively divides space into four quadrants.
    • R-tree: Hierarchical structure for bounding boxes (used in PostGIS).
    • Grid Index: Divides space into a regular grid.

Worked Example: Daraz Delivery Routes

  • Daraz uses spatial indexing to quickly find the nearest delivery agent for an order in Kathmandu.
  • If an order is placed in Thapathali, the system queries the R-tree index to locate the closest agent within a 5km radius.

3. Database Design for GIS

GIS databases must handle spatial and attribute data efficiently.

A. Relational vs. Object-Oriented Databases

Feature Relational Database (e.g., PostGIS) Object-Oriented Database (e.g., Oracle Spatial)
Data Model Tables (rows, columns) Objects (classes, inheritance)
Spatial Support Extensions (e.g., PostGIS) Native (e.g., Oracle Spatial)
Query Language SQL (with spatial functions) SQL + object methods
Best For Large-scale GIS projects Complex spatial relationships (e.g., CAD data)

B. Schema Design for Spatial Queries

A well-designed schema supports efficient spatial queries:

  1. Normalization: Reduce redundancy (e.g., store road attributes in a separate table).
  2. Spatial Joins: Link tables based on location (e.g., join buildings to land_parcels).
  3. Geometric Columns: Use GEOMETRY or GEOGRAPHY data types (PostGIS).

Worked Example: Ncell Tower Coverage

  • Ncell stores cell tower locations as points with attributes like tower_id, height, and coverage_radius.
  • A query like "SELECT * FROM towers WHERE ST_DWithin(geometry, ST_MakePoint(85.32, 27.7), 10000)" finds all towers within 10km of a given point (e.g., for network planning).

4. Data Quality and Integrity

Ensuring spatial data is accurate, consistent, and fit for purpose.

  • Key Considerations:
    • Accuracy: How close data is to real-world measurements (e.g., GPS error).
    • Precision: Level of detail (e.g., 1m vs. 10m resolution).
    • Topological Validity: No gaps or overlaps in polygons.
    • Attribute Accuracy: Correctness of non-spatial data (e.g., population counts).

In the Real World

  1. eSewa and Khalti (Digital Payments)

    • Spatial Data Use: Both apps use geocoding (converting addresses to coordinates) to locate merchants and users.
    • How? When you pay for a bus ticket in Pokhara, the app queries a vector dataset of bus stops to verify the location and calculate fare distances.
  2. Pathao (Ride-Hailing)

    • Spatial Indexing: Pathao’s algorithm uses an R-tree to match riders with the nearest available driver in real time.
    • Example: If you request a ride in Kirtipur, the system instantly retrieves all drivers within a 3km radius from the spatial index.
  3. NTC (Telecom Infrastructure Planning)

    • Raster Data: NTC uses DEM (Digital Elevation Model) raster data to plan tower placements, avoiding high terrain that blocks signals.
    • Vector Data: Stores existing tower locations as points with connectivity data to optimize network coverage.

Exam Tip

  1. Define Key Terms Clearly:

    • Differentiate between vector (discrete) and raster (continuous) data.
    • Explain topology with examples (e.g., adjacency in administrative boundaries).
  2. Compare Structures:

    • Contrast quadtree vs. R-tree in terms of use cases (e.g., quadtree for uniform grids, R-tree for dynamic data).
  3. Worked Examples:

    • Always tie examples to real-world Nepalese contexts (e.g., Daraz logistics, Ncell coverage, or Kathmandu traffic).
    • Show SQL spatial queries (e.g., ST_DWithin, ST_Intersects) in PostGIS.
  4. Database Design:

    • Sketch a relational schema for a GIS project (e.g., land records, disaster management).
    • Highlight normalization and spatial joins as key design principles.
  5. Visuals in Exams:

    • If asked to "explain spatial indexing," draw a quadtree or R-tree diagram and label it.
    • For topology, show a road network with nodes and edges.

Final Note: GIS is about organizing data for real-world problems. Whether it’s optimizing Pathao routes or planning NTC towers, understanding spatial structures and database design is critical. Practice sketching diagrams and writing queries—examiners love clear, visual answers!

Based on the TU BSc CSIT syllabus for Geographical Information System, unit 3.

Discussion

Loading…