Raster and vector data

Mapping data can be stored in either a raster or vector format data. Learn about the benefits and limitations of each.

To convert map information into a format that a computer can read, you need to describe the shapes and locations of features as a series of numbers. Computers store information in sequences of binary digits (bits). These form a code for every possible number or letter.

Binary encoding fits with how maps use a system of coordinates to reference geographical locations on the earth's surface. These coordinate systems can be local, national or international.

You’ll find a series of numbers along the sides of an Ordnance Survey map. These are coordinates from the British National Grid. All locations and shapes can be defined in terms of x and y coordinates from a given grid system. these numerical values translate map information into digital form in both vector and raster formats.

Raster data

In raster data the entire area of the map is subdivided into a grid of tiny cells. A value in each of the cells represents what’s at the corresponding location on the ground. Think of raster data as a matrix of values.

Raster data stores map information as digital images., The cell values relate to the pixel colours of the image. To reproduce the image, the computer reads each of these cell values and applies them to the pixels on your screen.

Vector data

In vector data, the features are recorded one by one. Shapes are defined by the numerical values of xy coordinate pairs.

  • A point is defined by a single pair of coordinate values.
  • A line is defined by a sequence of coordinate pairs that locate the points along the line.
  • An area is defined like a line. The first and last points are the same, creating a shape, or polygon.

Think of vector data as a list of values.

The position and shape of a building is captured as four pairs of coordinates. To reproduce the building in a GIS, the computer reads these values and draws a line linking the coordinate positions.

Vector data can also store information about features. These attributes are a very important feature.

Raster vs. Vector

Both types of data are very useful, for different reasons:

Vector Raster
Compact file sizes Large file size relative to vector data
Quick to display on screen Slower to display
Can store attributes of each feature Contains no attribute information
Unstyled data is very plain Arguably prettier
May be given your choice of look No choice over how the data looks

As you zoom in through raster data, the pixel structure becomes obvious. Eventually the image looks more like modern art than a map. The definition of the features depends on the size of the individual grid cells – the resolution. The vector data is more like a graph with a line drawn between points. The width stays the same even if you zoom right in.

Unstyled vector version of OS VectorMap Local (left) blending into the raster version (right)

Mapping agreements
Find our more about the Public Sector Mapping Agreement (PSMA) or the One Scotland Mapping Agreement (OSMA).

Online videos, product guides and licensing guidance.
Make the most of your data