Skip to content
QGIS
Guide

Vector vs Raster Data in GIS: Differences, Formats, When to Use

Published

Vector data stores geographic features as points, lines and polygons built from exact coordinate pairs, while raster data stores the world as a grid of equally sized cells where each cell holds one value. A vector road or building keeps sharp edges at any zoom, whereas a raster's detail stops at its cell size, from 20 cm (8 in) in aerial photos to 10 m (33 ft) or 30 m (98 ft) in free satellite imagery.

Think of vector data as a surveyor's notebook of coordinates connected by straight segments, and raster data as a tiled mosaic laid over the ground. Both are core to what GIS is, and many projects in QGIS combine them: a raster aerial photo or elevation model sits at the bottom, and vector parcels, roads and buildings sit on top.

3geometries

in vector data

points, lines and polygons

20 cm to 60 mcell size

typical open raster resolution

IGN aerial photos to Sentinel-2 bands

4×more cells

each time you halve the cell size

file size grows with the square of resolution

Two-panel comparison titled Vector vs raster: the same 560 m by 520 m of Annecy. The left panel shows 853 vector building polygons, 254 road lines, the Thiou canal and 72 public-building points with exact outlines. The right panel shows the same area burned into a raster grid of 56 by 52 cells (2,912 cells of 10 m), colored by class: building, road, water, ground and public building point.
Left: IGN BD TOPO vector features in Annecy's old town. Right: the same features burned into 10 m raster cells, the resolution of Sentinel-2's sharpest bands. Narrow streets break up, small buildings merge, and each point becomes a 10 m square.

To make the figure above, I took a 560 m by 520 m (1,837 ft by 1,706 ft) window of Annecy's old town from IGN's BD TOPO on 16 November 2026. The vector side draws 853 building polygons, 254 road lines and 72 public-building points with their true outlines. The raster side burns those same features into a grid of 56 by 52 cells (2,912 cells in total) at 10 m resolution. I built a 1 m class grid of water, road and building, assigned each 10 m cell the class that covers most of it, and filled one cell for each point. In the resulting grid, 43.8% of cells are building, 16.9% road, 6.4% water, 2.0% public-building points and 30.9% bare ground. Notice how the narrow streets and the Thiou canal break into stair-step blocks or vanish where roads and bridges cover more of the cell, and how a single point turns into a 10 m square because the raster cannot record where inside the cell the point stood.

Vector vs raster at a glance

PropertyVector dataRaster data
Basic unitPoints, lines and polygons made of coordinate pairs (vertices)A matrix of equal cells (pixels) in rows and columns
AttributesA table row per feature, holding dozens of text or number fieldsOne numeric value per cell per band
Precision at zoomEdges stay sharp at any scaleDetail stops at the cell size; zooming in shows square pixels
Best forDiscrete objects with clear boundaries: buildings, roads, parcels, bordersContinuous surfaces and imagery: elevation, temperature, rainfall, satellite photos
File size depends onNumber of features and verticesRows × columns × bytes per cell (independent of how busy the map is)
Common formatsShapefile (.shp), GeoPackage (.gpkg), GeoJSON (.geojson), KML, PostGISGeoTIFF (.tif), Cloud Optimized GeoTIFF, JPEG 2000 (.jp2), NetCDF (.nc), ASCII grid (.asc)
Typical analysisNetwork routing, spatial joins, buffers, parcel area and perimeterMap algebra, slope and viewshed, NDVI, land-cover classification

What is vector data in GIS?

Vector data represents geographic features using three geometry types built from (x, y) coordinate pairs (and sometimes z for height):

  1. Points. A single coordinate pair marking a location too small to draw as an area at your scale, such as a water well, a tree, a bus stop or an address point.
  2. Lines (polylines). An ordered list of vertices connected by segments. Lines represent linear networks and waterways: roads, railways, rivers, pipelines and contour lines.
  3. Polygons. A closed ring of vertices where the first and last coordinates match, enclosing an area. Buildings, land parcels, lakes and administrative boundaries are polygons.

Every vector feature is linked to one row in an attribute table. A single building polygon can carry its street address, construction year, roof material, floor count and tax identifier in that row. If you want to test real vector polygons in your own software, pull an area from our free building footprints downloader, which exports open building outlines as vector files.

Vector files stay compact when features are sparse: a file of a few hundred points stores only those points, while a raster of the same area must store a value for every cell, including all the empty ones.

What is raster data in GIS?

Raster data divides an area into a regular grid of equally sized rectangular (almost always square) cells arranged in rows and columns. As Esri's ArcGIS documentation puts it, a raster is a matrix of cells organized into rows and columns where each cell contains a value representing information. That value can be a terrain height in metres, a surface temperature, a land-cover class code, or a light reflectance number from a camera sensor.

Two-panel figure titled A raster stores one value per cell. On the left, a shaded 1 km by 1 km elevation raster of the Crêt du Maure hill above Annecy at 5 m cells, with a red square marking a sample area. On the right, the red square zoomed in to a grid of 9 by 8 cells of 20 m, with each cell's elevation in metres printed inside, from 603 m in the top row to 646 m in the bottom rows.
Left: a 1 km by 1 km slice of IGN's RGE ALTI elevation model on the Crêt du Maure hill above Annecy. Right: a 9 by 8 grid of 20 m cells with the single height number stored in each cell.

A raster does not store "hills" or "valleys" as objects. As the close-up from IGN's RGE ALTI model shows, each 20 m cell holds one number between 603 m and 646 m. GIS tools compute slope, aspect and hillshading on the fly by comparing each cell's number to its eight neighbours.

Single-band rasters hold one layer of numbers, such as elevation or rainfall. Multi-band rasters stack several grids over the same cells: a color aerial photo has three bands (red, green and blue), and some add a near-infrared band. The European Space Agency's Sentinel-2 satellites record 13 spectral bands per scene.

Cell size, resolution and file size

The ground length of one cell side is the raster's spatial resolution. A cell is the smallest thing a raster can distinguish: anything smaller than a cell gets averaged into the cell's single number or missed altogether.

SourceCell size (resolution)What one cell covers on the ground
IGN BD ORTHO aerial photos (France)20 cm (8 in)0.04 m²
Sentinel-2 visible and near-infrared (4 bands)10 m (33 ft)100 m²
Sentinel-2 red-edge and SWIR (6 bands)20 m (66 ft)400 m²
Landsat 8 panchromatic band15 m (49 ft)225 m²
Landsat 8 multispectral bands30 m (98 ft)900 m²
Sentinel-2 atmospheric bands (3 bands)60 m (197 ft)3,600 m²

Because a grid is two-dimensional, halving the cell size multiplies the number of cells by four. Moving from 10 m cells to 1 m cells multiplies the cell count by 100.

Uncompressed raster size is a direct multiplication: rows × columns × bytes per cell × bands. I tested this on 16 November 2026 with a 640 by 400 elevation raster stored as 32-bit floating-point numbers (4 bytes per cell):

  • Raw cell values: 640 × 400 × 4 = 1,024,000 bytes.
  • Written by GDAL as an uncompressed GeoTIFF (with header and CRS tags): 1,025,166 bytes.
  • Written with lossless DEFLATE compression and floating-point predictor (PREDICTOR=3): 428,433 bytes, or 42% of the uncompressed size.

When to use vector vs raster

Choose between the two models by asking whether your phenomenon has hard boundaries or changes continuously across space.

Use vector data when:

  • You are mapping discrete objects with legal or physical edges: property parcels, buildings, utility pipes, road centrelines, protected areas.
  • You need to attach a rich attribute table (names, dates, owners, capacities) to each feature.
  • You need network topology, such as finding the shortest driving route along roads or tracing upstream flow in a pipe network.
  • You print or display maps at many scales and need crisp lines and labels at every zoom level.

Use raster data when:

  • The value exists everywhere and changes smoothly: ground elevation, air temperature, soil moisture, noise levels or satellite reflectance.
  • Your data comes straight from a camera or scanner: satellite scenes, drone orthomosaics, aerial photography or scanned paper maps.
  • You want to run fast cell-by-cell math (map algebra) across several layers, such as subtracting two elevation grids to measure quarry volume or combining red and near-infrared bands for vegetation health.
  • You are running terrain or surface models: slope, aspect, watershed delineation, flood fill or viewshed analysis.

Both models can cross over when needed. Rasters often store discrete classes, such as a national land-cover grid where 1 means forest, 2 means water and 3 means urban. And vectors can represent continuous surfaces through contour lines or Triangulated Irregular Networks (TINs).

Common vector and raster file formats

If you are not sure whether a file on your disk is vector or raster, check its extension. Our full GIS file formats guide covers the technical limits of each, and here is how they split:

FormatExtensionTypeNotes
GeoPackage.gpkgBothModern OGC standard based on SQLite; one file can hold vector tables and raster tiles
Shapefile.shp (+ .shx, .dbf, .prj)VectorLegacy Esri format; 10-character field names, 2 GB limit per component file
GeoJSON.geojson, .jsonVectorText-based web format; stores coordinates and attributes in plain JSON
KML / KMZ.kml, .kmzVector (mostly)XML format used by Google Earth; can also wrap raster ground overlays
CSV with coordinates.csvVector (points)Tabular text with latitude/longitude or easting/northing columns
GeoTIFF / COG.tif, .tiffRasterIndustry standard for georeferenced grids and satellite bands
JPEG 2000.jp2RasterWavelet-compressed raster used by ESA for Sentinel-2 imagery
NetCDF.ncRasterMultidimensional arrays used for climate, ocean and weather grids
Esri ASCII Grid.ascRasterPlain-text header followed by space-separated cell numbers

How to convert between vector and raster

You can convert data in either direction inside QGIS or in your browser, though every conversion trades away some information.

Raster to vector (vectorizing)

Turning a raster into vector features happens in three main ways:

  1. Contour extraction. From a continuous elevation raster, you connect points of equal height into vector lines. Try this in your browser with our free contour line generator, which turns elevation data into downloadable vector contour lines without installing software.
  2. Polygonize (Raster > Conversion > Polygonize in QGIS). For a classified raster (such as land cover or flood depth zones), QGIS groups contiguous cells that share the same value into vector polygons. Because cells are squares, the raw polygons have stair-step edges unless you smooth them afterward. See our step-by-step guide on converting raster to vector in QGIS.
  3. Feature extraction from imagery. From an aerial or satellite photo, segmentation models trace buildings, roads or trees into clean vector polygons.

Vector to raster (rasterizing)

In QGIS, open Raster > Conversion > Rasterize (Vector to Raster). You choose the output cell size (in the layer's CRS units) and the attribute column whose number will fill the cells. Any detail smaller than your chosen cell size is lost, as shown in our 10 m Annecy test at the top of the page.

If you do not want to hunt through conversion menus and set cell dimensions by hand, AI Agent, the QGIS plugin we build, can run polygonize, rasterize or contour generation from one plain-language prompt inside your project.

Vector vs raster in graphic design (JPEG, PNG, SVG)

If you searched "vector vs raster" outside a mapping project, the underlying math is identical, without the Earth coordinates attached:

  • Raster graphics (JPEG, PNG, GIF, WebP, phone photos) are grids of colored pixels. When you zoom in past 100% or print a small JPEG on a large poster, the square pixels become visible and the image looks blurry or blocky. A JPEG is always a raster file.
  • Vector graphics (SVG, Adobe Illustrator .ai, EPS, fonts and logos) store shapes as mathematical paths, curves and points. You can scale an SVG logo from a business card to a billboard without losing sharpness.
  • Container formats (PDF, GeoPackage) can hold both vector paths and raster images inside the same file.

Questions people ask

Do it now with our free tool

Contour lines

Open the free tool

Do it in QGIS by asking for it

AI Agent carries out the task you describe, in your own QGIS project. Free, no card.

Try AI Agent for free

Keep reading