Knowledge / Geoinformatics / Surveying (Geomatics) / Spatial data models and spatial databases

Spatial data models and spatial databases

Geoinformatics / Surveying (Geomatics) (B.Tech) · Geographic information systems · free study notes for exams, placements and interviews

In short

A spatial data model is the formal way the continuous real world is simplified into discrete, computer-storable objects — points, lines, polygons, cells or surfaces — together with their attributes and their spatial relationships. A spatial database is a DBMS (usually relational) extended with geometry data types, spatial indexes and spatial operators so that location can be queried in SQL alongside ordinary attributes. Getting the model right decides whether a GIS can answer questions about adjacency, connectivity and containment at all, and whether a national database of millions of parcels performs. This topic is the conceptual backbone of GIS papers in B.Tech Geoinformatics, carries marks in GATE Geomatics (GE) under "GIS: data models, data structures, topology, database queries", and is tested in technical rounds at Survey of India, NRSC/ISRO, NIC, NSDI/state GIS cells, RMSI, Esri India, Genesys, CyberTech, MapmyIndia (Mappls), Tata Consultancy Services geospatial units and smart-city/AMRUT consultancies.

Explained

Levels of abstraction: from reality to bits

Vector data model

Raster data model

Surface, network, object and time models

Spatial databases: architecture, types, indexing

Data quality, metadata and the Indian policy frame

Key points

Formulas and examples

Raster storage size S = rows × columns × bytes-per-cell × bands (bytes); rows = N/Δ, columns = E/Δ for a block N m by E m at cell size Δ m
Number of cells n = (Area of coverage) / Δ² — Δ in metres gives area in m²
Compression ratio CR = (uncompressed size) / (compressed size)
Delaunay/TIN triangle count: for V mass points with H on the convex hull, triangles T = 2V − H − 2; edges E = 3V − H − 3
Euler formula check for a planar topological map: N − A + P = 2, where N = nodes, A = arcs, P = polygons including the universe polygon
Slope of a TIN facet (plane through 3 points): slope = arctan(√((∂z/∂x)² + (∂z/∂y)²)), expressed in degrees or percent (100 × tan)
Plane/MBR area of geometry: A = ½ |Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)| (shoelace formula), in m² when coordinates are projected metres
Point-in-polygon: ray-casting — an odd number of boundary crossings means inside
Positional accuracy RMSE = √(Σ((xᵢ−xᵣ)² + (yᵢ−yᵣ)²)/n), in metres
Vector-raster conversion error: maximum positional shift of a rasterised boundary ≈ Δ/√2 (half-diagonal of a cell)

Example 1 — raster volume and the resolution penalty. A 10 km × 10 km LISS-IV tile is to be stored at 5 m resolution, 4 spectral bands, 16-bit (2 bytes) per cell.

Example 2 — run-length encoding gain. A single-band 8-bit land-use raster, 1,000 × 1,000 cells, averages 25 runs per row.

Example 3 — topology check with Euler's formula. A cleaned polygon coverage reports 148 nodes, 236 arcs and 90 polygons (including the universe polygon).

Example 4 — TIN size and a facet slope. A UAV survey gives 1,500 mass points, of which 60 lie on the convex hull.

Example 5 — spatial index and query cost. A PostGIS table holds 2,000,000 building footprints for a city; a query asks for buildings within 200 m of a metro alignment, and the search window retrieves 3,500 candidate MBRs.

CREATE TABLE buildings (
  gid      serial PRIMARY KEY,
  ulpin    varchar(14),
  use_code varchar(10),
  geom     geometry(MultiPolygon, 32644)   -- UTM 44N, WGS-84
);
CREATE INDEX buildings_geom_gix ON buildings USING GIST (geom);
ANALYZE buildings;

-- spatial join with a buffer, areas in m² because the CRS is projected
SELECT b.ulpin, ROUND(ST_Area(b.geom)::numeric, 2) AS area_m2
FROM   buildings b
JOIN   metro_line m ON ST_DWithin(b.geom, m.geom, 200)
WHERE  b.use_code = 'RES';

-- topology/validity audit before loading into production
SELECT gid, ST_IsValidReason(geom) FROM buildings WHERE NOT ST_IsValid(geom);
CriterionVectorRaster
PositionExplicit coordinatesImplicit (row, column + geo-transform)
Best forDiscrete entities, cadastre, networks, cartographyContinuous surfaces, imagery, modelling
TopologyExplicit (arc-node) or computedImplicit neighbourhood only
OverlayGeometrically complex, slowSimple cell-by-cell map algebra
VolumeCompact for class mapsLarge; grows as 1/Δ²
Accuracy limitDigitising and source scaleCell size, mixed pixels
Output lookSharp, scalable linesBlocky at large zoom
Typical formatsShapefile, GeoPackage, GeoJSON, geodatabaseGeoTIFF/COG, IMG, NetCDF, ASCII grid
FeatureShapefileGeoPackageFile geodatabasePostGIS table
Storage3+ files (.shp/.shx/.dbf)One SQLite fileFolder of binary filesRDBMS
TopologyNone (spaghetti)Validity rules, no topology engineRules, domains, subtypesConstraints + ST_IsValid, pgRouting/topology ext.
Field name limit10 charactersNoneLong namesNone
Size limit2 GB per fileVery largeVery largeVery large
Multi-user editingNoLimitedLimited (enterprise GDB needed)Yes, ACID + versioning
CRS storage.prj, often incompleteFull, EPSG-basedFullSRID in spatial_ref_sys

Where it is used

Interview questions

Common mistakes

Related topics

Spatial analysis and geostatistics · GIS software and web GIS: QGIS, ArcGIS and GeoServer · Map projections, datums and coordinate systems · Remote sensing and digital image processing · GNSS and modern surveying · Photogrammetry, LiDAR and DEM generation

Open in the Knowledge reader →Find jobs →