Mapping the digital world, one bit at a time.

Technology

Raster vs Vector: Choosing the Right Geospatial Data Format

Raster vs Vector: Choosing the Right Geospatial Data Format

What is the width of a river? A vector dataset answers with a surveyed line, a coordinate at each bend and an attribute table. A raster dataset answers with a row of pixels, each holding a value. Both are correct. They behave very differently once you start measuring, styling or storing the result, and the choice you make early tends to follow a project all the way to the printed map.

Two ways of describing the same place

Raster: a grid of values

A raster covers an area with a regular grid of cells. Every cell holds one value per band, and that value might represent elevation, temperature, rainfall, a land-cover class or a colour from a satellite sensor. The cell size is the resolution: a ten-metre raster spends a hundred square metres of ground on every single number. That is elegant for anything that changes gradually across space, and blunt for anything with a sharp edge.

Vector: geometry with attributes

A vector stores features as coordinates — points, lines and polygons — with attributes attached. A bus stop is a point, a road centreline is a line, a council boundary is a polygon. Because the geometry is exact, a boundary falls where you say it falls rather than at the nearest cell edge. Features also have identity: each row can carry a name, a code, a date and anything else you can fit in a table.

Where raster data earns its place

Satellite and aerial imagery arrives as raster. So do elevation models, slope, aspect, hillshades and nearly every modelled surface, from flood depth to noise propagation. Continuous phenomena resist being chopped into polygons, because you would need an arbitrary number of them and would still be guessing between the edges.

Raster also handles cell-by-cell arithmetic gracefully. Subtract one season's vegetation index from another, add a rainfall layer into a runoff model, or build a cost surface for a least-cost path. These operations run simply and quickly across millions of cells. The trade-offs are real, though: mixed pixels, where one cell covers both tarmac and grass and receives a single averaged number; file sizes that grow with the square of resolution; and hard edges that look blocky when a user zooms in.

Where vector data earns its place

Vector suits things with identity. A planning application, a postcode district, a pipeline, a delivery round. Each feature is a record, so you can attach attributes and join them to a spreadsheet by a shared key. Topology matters as well: shared boundaries between neighbouring polygons, and road networks where turn restrictions and one-way streets drive realistic routing. Network analysis on a raster road layer is approximate at best; on a vector network it is exact.

Sparse data stays compact in vector form. Ten thousand scattered points are a few hundred kilobytes as GeoJSON and many megabytes as a raster fine enough to show them individually. Watch the vertex count, though. A boundary digitised at 1:1000 will not line up neatly with one digitised at 1:25000, and a coastline traced from high-resolution imagery can carry far more detail than the map will ever display.

Storage, resolution and performance

Raster size is roughly rows × columns × bands × bit depth before compression. Doubling the resolution quadruples the cell count, which is why pyramids and overviews matter: pre-built lower-resolution copies let a viewer load a zoomed-out map instantly instead of reading the full dataset. For vector, size scales with the number of vertices rather than the area covered, and a spatial index is what keeps a map panning smoothly.

  • Raster: tiled and compressed GeoTIFF with overviews for analysis, Cloud-Optimised GeoTIFF for streaming to the web, JPEG2000 or MrSID where large imagery archives need heavy compression.
  • Vector: GeoPackage for desktop and mobile work, PostGIS where data is shared and edited by several people, GeoJSON or FlatGeobuf for web delivery, and shapefiles only when a legacy tool leaves no alternative.

Visual clarity and scale

Vectors scale cleanly. A line stays a line at any zoom, which is why boundaries, labels and road centrelines are almost always drawn as vectors. Rasters soften or pixelate when over-zoomed unless the viewer is swapping between overview levels, and rasterising polygons for a print map at high DPI gives noticeably jagged edges unless you oversample.

The opposite is also true. A choropleth built from large, irregular polygons can flatter the data, because the eye reads area as importance. A continuous surface — a hillshade, a heat map, a smooth interpolated field — reads more honestly as raster. Most web maps quietly combine both: vector tiles for labels and boundaries sitting over a raster basemap.

Mixing the two

The formats are not rivals, and most real projects use both. Zonal statistics takes a raster surface and summarises it inside vector zones — average canopy height per ward, mean slope per field parcel. A vector mask clips imagery to a study area before analysis. A classified raster can be vectorised to produce tidy polygons, then simplified so the file stays manageable. Convert deliberately, check the result, and keep the original: every conversion loses something, whether that is precision, attribute detail or edge accuracy.

Choosing well: a practical checklist

If you need a value everywhere, choose raster. If you need to know exactly where something is, choose vector.
  1. Write down the question the data must answer. Average values across a surface point to raster; per-feature records point to vector.
  2. Check what you were given. Reprocessing imagery into polygons rarely improves it, and tracing boundaries from a coarse raster invents precision that is not there.
  3. Estimate the size at the resolution or detail you actually need, not the one that looks good in a sample.
  4. Think about the end use: interactive web map, printed report, routing engine or statistical model.
  5. Confirm the toolchain. Some analysis functions only accept one format, and converting mid-project adds a step that can be avoided at the start.
  6. Test with a small extract first. Load it in the viewer your audience will use and zoom to the extremes before committing.

Get those six points settled and the raster-versus-vector question usually answers itself. Where it does not, pick the format that preserves the original measurements, and convert later if the display demands it.

Photo: Markus Spiske / Pexels

Related Posts

A Beginner's Guide to UK Postcodes for Geospatial Analysis

Geodata

A Beginner's Guide to UK Postcodes for Geospatial Analysis

A practical introduction to UK postcode structure, geocoding options and aggregation choices for mapping location...

Mapping Public Rights of Way in England and Wales

Maps

Mapping Public Rights of Way in England and Wales

A practical guide to England and Wales' definitive maps, CRoW access land and the open data sources you can use to...