Raster vs Vector

Almost everything in geospatial analysis is stored in one of two shapes, and the choice is not a technical detail but a decision about how you picture the world. The raster model treats space as a continuous field and samples it on a regular grid, so the world becomes an array of cells each holding a measured value. The vector model treats the world as a collection of distinct things — a road, a lake, a field boundary — and records each one as an exact geometric shape with a row of attributes. A satellite image is the archetypal raster; a map of parcels or rivers is the archetypal vector. Understanding what each model can and cannot say is the foundation for almost every later decision, because the same patch of ground can be described faithfully in either, and the two answer different kinds of question.

Raster: the world as a grid of samples

A raster divides an area into a grid of equally sized cells, or pixels, and stores one or more numbers in each. Those numbers are samples of some quantity measured across a continuous surface: reflected light in a spectral band, an elevation, a temperature, a modelled rainfall total. The grid has no knowledge of the objects in the scene — it does not “see” a forest or a field, only a dense field of values that a forest or a field happens to produce. Meaning is read out of the pattern of numbers afterwards.

Two properties define what a raster can tell you. The first is its cell size, the ground distance each pixel covers, which sets the finest detail the grid can resolve and is discussed at length under resolution. The second is its georeferencing — the coordinate reference system and affine transform introduced in Digital Imagery — which pins the grid to the Earth so that a row and column become a real place. Because a raster stores a value everywhere within its extent, it is the natural home for phenomena that genuinely exist everywhere and vary smoothly: there is a brightness, an elevation, and a surface temperature at every point on the ground, whether or not any object sits there.

Vector: the world as discrete features

A vector dataset represents the world as separate features, each defined by explicit geometry. There are three basic geometric types. A point is a single location — a weather station, a sample plot, a city marked as a dot. A line, or polyline, is an ordered sequence of points describing something long and thin: a river, a road, a flight track. A polygon is a closed ring of points enclosing an area: a lake, an administrative boundary, an agricultural field. Whatever the type, the geometry is stored as exact coordinates rather than sampled onto a grid, so a feature has crisp edges and a definite shape at any scale.

What makes the vector model powerful is that each feature is a thing you can name and describe. Space between features is simply empty — a vector map of rivers says nothing at all about the land in between, because that land is not a feature it represents. This is the mirror image of the raster’s stance: the raster is exhaustive but anonymous, filling its whole extent with values that carry no identity, while the vector is selective but articulate, describing only the objects it chooses to record but describing each of them precisely.

Attributes, values, and topology

The two models attach information to space in different ways. In a raster the information is the pixel value; a cell’s only content is the number or numbers stored there, and if you want a category rather than a measurement — a land-cover class from classification, for instance — that category is encoded as a value in the grid. In a vector dataset the geometry and the information are separate: each feature links to a row in an attribute table that can hold many fields of different kinds, so a single polygon can carry a name, an area, an owner, a date, and a measured value all at once.

Vector geometry can also express topology — the relationships of adjacency, containment, and connectivity between features. A road network knows which segments meet at a junction; a set of parcels knows which share a boundary; a polygon knows what falls inside it. A raster has no such notion of relationship beyond the fixed neighbourhood of the grid: cells are simply next to one another in rows and columns, and any higher-level structure has to be inferred from the pattern of values.

Choosing the natural model for a question

The right model follows from the nature of the thing you are describing. Continuous phenomena that vary across every point of a surface — reflectance, elevation, temperature, slope, a probability — are naturally raster, because a value genuinely exists everywhere and a grid samples it evenly. Discrete objects with identity and boundaries — parcels, roads, monitoring sites, jurisdictions — are naturally vector, because they are countable things with attributes rather than a field of measurements.

A useful test is to ask whether the answer you want is a surface or a list. “How warm is it here?” is a surface question, answered everywhere, and suits a raster. “Which fields exceeded a threshold, and by how much?” is a question about named objects and their properties, and suits a vector table. Many real analyses need both models because they ask both kinds of question at once, which is why the interaction between them matters as much as either alone.

Where the two models meet

In practice raster and vector are constantly combined, and a few operations do most of the work. Sampling reads raster values at vector locations — extracting the pixel value under each monitoring point, or the elevation along a line. Masking uses a polygon to restrict a raster analysis to a region of interest, so that only cells inside a boundary are considered. Zonal, or feature-based, summaries go a step further: they aggregate all the raster cells that fall within each vector feature into a single statistic — the mean rainfall per catchment, the burned area within each district, the average brightness inside each field. These operations are how a continuous measurement surface is turned into attributes attached to the objects a decision is actually about, and they depend on both datasets sharing a common coordinate system so that a cell and a feature really do refer to the same ground.

What conversion costs

Because the models are complementary, data is often converted from one to the other, and it is worth being clear about what each conversion loses. Rasterizing a vector — burning its features onto a grid — forces crisp geometry onto fixed cells, so smooth boundaries become stair-stepped and features smaller than a cell either vanish or are rounded up to fill one. The result depends entirely on the chosen cell size, and the exact edges of the original are gone. Vectorizing a raster does the reverse, tracing outlines around groups of like-valued cells to make polygons, and it inherits the grid’s blockiness: the derived boundaries follow pixel edges rather than the true edge of whatever was measured, and noise in the values can produce spurious slivers.

Neither conversion adds information; each discards or approximates some. That does not make conversion wrong — it is often exactly what a workflow needs — but it does mean the model a dataset starts in is the one that carries its full fidelity, and every hop between models is a place where detail quietly leaks away. Keeping continuous measurements as rasters and discrete objects as vectors for as long as possible, and converting only when a specific question demands it, is the habit that keeps an analysis honest about what its data actually supports.