Find a course

Module 2: Spatial DataLesson 3 of 1114 min

Vector and Raster Data Models

Compare the vector model of points, lines and polygons with the raster model of grid cells, and learn common GIS file formats and when to use each.

Step 1 of 13Learn

Two ways to represent the world

Imagine mapping a lake. You could draw its outline as a polygon with a precise boundary. Or you could lay a grid over the area and mark each cell as water or not water. Both are valid. They are the two main data models in GIS.

The vector model represents discrete features with geometry:

  • Points: a single coordinate pair. Wells, trees, crime incidents, cell towers. Whether something is a point depends on scale: a city is a point on a world map but a polygon on a regional map.
  • Lines (polylines): a sequence of connected points. Roads, rivers, pipelines, power lines.
  • Polygons: closed shapes enclosing an area. Lakes, parcels, buildings, countries, census tracts.

Each vector feature links to a row in an attribute table, with columns (fields) such as name, type, length or population. Vector data is precise for boundaries, compact for discrete features, and good for networks and topology, such as which roads connect or which parcels share a border.

The raster model divides space into a grid of equal-sized cells (pixels), each holding a value: elevation in meters, temperature, land-cover class, reflectance in a satellite band. Raster data is ideal for continuous phenomena that vary smoothly across space, like elevation, rainfall or temperature, and for imagery from satellites, drones and scanned maps. Calculations across whole grids are fast and simple.

A rule of thumb: discrete objects with clear boundaries suit vector; continuous surfaces and imagery suit raster.

Step 2 of 13Practice · Sort into groups

Which data model is usually the better fit for each dataset?

Tap an item, then tap its group (or drag it there).

Step 3 of 13Compare

Vector versus raster

AspectVectorRaster
Building blocksPoints, lines and polygonsA grid of cells (pixels)
Best forDiscrete features with clear edgesContinuous surfaces that vary everywhere
AttributesA table row per featureOne value per cell
Detail depends onNumber of verticesCell size (resolution)
Typical fileGeoPackage, shapefile, GeoJSONGeoTIFF

Step 4 of 13Learn

Raster resolution and its trade-offs

The key property of a raster is its spatial resolution: the ground size of one cell. A raster with 30 m resolution has cells 30 m × 30 m, so each cell covers 900 m². Landsat satellite imagery is typically 30 m for its multispectral bands; Sentinel-2 offers 10 m for several bands; commercial satellites and drones can reach well under 1 m.

Finer resolution shows more detail but has costs. Halving the cell size quadruples the number of cells, because the grid gets twice as many rows and twice as many columns. A 10 km × 10 km area at 30 m resolution needs about 111,000 cells; at 1 m it needs 100 million. File sizes and processing times grow quickly.

Resolution also determines what you can detect. A 30 m cell cannot show an individual house; it records a mixed value of roofs, lawns and roads, a mixed pixel. Choose resolution to fit the question: regional land cover might be fine at 30 m, while mapping individual trees needs sub-meter data.

Raster values can be:

  • Continuous: any value in a range, such as elevation (412.7 m).
  • Categorical (discrete): codes for classes, such as 1 = water, 2 = forest, 3 = urban.

A digital elevation model (DEM) is a raster in which each cell holds an elevation. DEMs are among the most widely used rasters, the basis for slope, watersheds, flood modeling and 3D views.

Step 5 of 13Explore

Resolution and number of cells

For a square study area, the number of raster cells grows with the square of (area width ÷ cell size). Move the cell-size slider to see how quickly cell counts rise as resolution gets finer.

0255075100 204060
Cells at 30 m (millions)
0.11 million
Cells at 10 m (millions)
1 million
Cells at 1 m (millions)
100 million

Step 6 of 13Practice · Work it out

A raster has a cell size of 20 m. If you resample it to 10 m cells over the same area, by what factor does the number of cells increase?

Step 7 of 13Learn

Common file formats

GIS data comes in many formats. Knowing the common ones saves frustration.

Vector formats:

  • Shapefile (.shp): an old but still common format created by Esri. Despite the name, it is several files that must stay together: .shp (geometry), .shx (index), .dbf (attributes) and usually .prj (coordinate system). Missing the .prj file is a classic cause of layers appearing in the wrong place. Shapefiles have limits, such as 10-character field names.
  • GeoPackage (.gpkg): an open standard based on SQLite. A single file can hold many vector layers, rasters and tables, with long field names. It is the default in QGIS and a good modern choice.
  • GeoJSON (.geojson): a text format widely used on the web, easy to read and share, best for small to medium datasets. It uses WGS 84 longitude and latitude by specification.
  • KML/KMZ: the format used by Google Earth.

Raster formats:

  • GeoTIFF (.tif): a TIFF image with embedded georeferencing, the most common raster format. Cloud-optimized GeoTIFFs (COGs) allow efficient streaming over the web.
  • JPEG 2000, NetCDF (often used for climate data with time dimensions) and others.

Databases: Spatial databases such as PostgreSQL with PostGIS store large, shared datasets and allow spatial SQL queries.

When sharing data, include the coordinate system and a short description of fields, the minimum metadata anyone needs to use it correctly.

Step 8 of 13Note

Step 9 of 13Practice · Match the pairs

Match each file format with its description.

Tap an answer, then tap the place where it belongs (or drag it there).

  1. Shapefile
  2. GeoPackage
  3. GeoJSON
  4. GeoTIFF
  5. KML

Step 10 of 13Diagram

Common GIS file formats

Common GIS file formatsHierarchy diagram: GIS data formats, Vector, Raster, Database, Shapefile, GeoPackage, GeoJSON, KML/KMZ, GeoTIFF / COG, NetCDF, PostGIS.GIS data formatsVectorShapefileGeoPackageGeoJSONKML/KMZRasterGeoTIFF / COGNetCDFDatabasePostGIS

Tap a shape with to see more.

GIS data formats
Vector
Raster
Database
Shapefile

Keep .shp, .shx, .dbf and .prj together.

GeoPackage

One SQLite file, many layers. Default in QGIS.

GeoJSON
KML/KMZ
GeoTIFF / COG
NetCDF

Common for climate data with a time dimension.

PostGIS

Step 11 of 13Note

Step 12 of 13Practice · What would you do?

What would you do?

A colleague emails you "rivers.shp" alone. When you open it, the attribute table is empty and the layer appears in the wrong place. What happened?

Step 13 of 13Practice · Choose one

Which data model is generally best for representing elevation across a mountain region?