GIS Spatial Data Types: Vector vs Raster

Spatial Data Types: Raster vs Vector
Spatial Data Types: Raster vs Vector

What GIS Data Types Exist?

Data consists of observations we make from seeing the real world. Spatial data consists observations with locations. Spatial data identifies features and positions on the Earth’s surface. Spatial data is how we put our observations on the map.

All GIS software has been designed to handle spatial data. Spatial data (also called geospatial data) is how geographic information is captured in a GIS.

Vector and raster data are the two primary data types used in GIS. Both vector and raster data have spatial referencing systems. These are latitudes and longitudes that pinpoint positions on Earth.

We know the two main spatial data models are vector and raster data. But what is the difference between raster and vector data? When should data be displayed as a raster or vector?

Let’s explore spatial data types in more detail:

Vector Spatial Data Types

Vector data is not made up of a grid of pixels. Instead, vector graphics are comprised of vertices and paths.

The three basic symbol types for vector data are points, lines and polygons (areas). Since the dawn of time, maps have been using symbols to represent real-world features. In GIS terminology, real-world features are called spatial entities.

The cartographer decides how much data needs to be generalized in a map. This depends on scale and how much detail will be displayed in the map. The decision to choose vector points, lines or polygons is governed by the cartographer and scale of the map.

Points as XY Coordinates

Vector points are simply XY coordinates. When features are too small to be represented as polygons, points are used.

For example:

At a regional scale, city extents can be displayed as polygons because this amount of detail can be seen when zoomed in. But at a global scale, cities can be represented as points because the detail of city boundaries cannot be seen.

Vector data are stored as pairs of XY coordinates (latitude and longitude) represented as a point. Attribute information like street name or date of construction could accompany it in a spatial database or table describing its current use.

Point Vector Data Type

Lines As Connected Points

Vector lines connect vertices with paths. If you were to connect the dots in a particular order, you would end up with a vector line feature.

Lines usually represent features that are linear in nature. Cartographers can use a different thickness of line to show size of the feature. For example, 500 meter wide river may be thicker than a 50 meter wide river.

They can exist in the real-world such as roads or rivers. Or they can also be artificial divisions such as regional borders or administrative boundaries.

Points are simply pairs of XY coordinates (latitude and longitude). When you connect each point or vertex with a line in a particular order, they become a vector line feature.

Networks are line data sets but they are often considered to be different. This is because linear networks are topologically connected elements. They consist of junctions and turns with connectivity. If you were to find an optimal route using a traffic line network, it would follow one-way streets and turn restrictions to solve an analysis. Networks are just that smart.

Vector Data Type Line

Polygons As Closed Lines

When a set of vertices are joined in a particular order and closed, they becomes a vector polygon feature. In order to create a polygon, the first and last coordinate pair are the same and all other pairs must be unique.

Polygons represent features that have a two-dimensional area. Examples of polygons are buildings, agricultural fields and discrete administrative areas.

Cartographers use polygons when the map scale is large enough to be represented as polygons.

Vector Data Type Polygon

Raster Spatial Data Types

Raster data is made up of pixels (also referred to as grid cells). They are usually regularly-spaced and square but they don’t have to be. Rasters often look pixelated because each pixel is associated with a value or class.

For example:

Each pixel value in a digital photograph is associated with a red, green and blue value. Or each value in a digital elevation model represents a value of elevation. It could represent anything from thematic categories, heights or spectral value.

Raster models are useful for storing data that varies continuously, as in an aerial photograph, an elevation surface or a satellite image. But it depends on the cell size for spatial accuracy.

Raster Cellsize

Raster data models can be discrete and continuous.

Discrete rasters

Discrete rasters are also referred to as thematic or categorical raster data. They have distinct themes or categories. For example, one grid cell represents a land cover class or a soil type.

In a discrete raster land cover/use map, you can distinguish each thematic class. Each class can be discretely defined where it begins and ends. Each land cover cell is definable. The land cover class fills the entire area of the cell

Discrete data usually consists of integers to represent classes. For example, the value 1 might represent urban areas, the value 2 represents forest, etc. Political boundaries or ownership are other examples of discrete rasters.

Discrete raster

Continuous Rasters

Continuous rasters are grid cells with gradual changing data such as elevation, temperature or an aerial photograph. Continuous data is also known as non-discrete or surface data.

A continuous raster surface can be derived from a fixed registration point. For example, a digital elevation model is measured from sea level. Each cell represents a value above or below sea level. An aspect cell value is derived from a fixed direction such as north, east, south or west.

Phenomena can gradually vary along a continuous raster from a specific source. For example, a raster depicting an oil spill can show how the fluid moves from high concentration to low concentration. At the source of the oil spill, concentration is higher. It diffuses outwards with diminishing values as a function of distance.

Continuous raster

Vector Data Advantages and Disadvantages

Did you know?

Spaghetti Data Model
Spaghetti Data Model

The spaghetti data model was one of the first conceptual models to structure features in a GIS. It was a simple GIS model where lines may cross without intersecting or topology and usually no attributes are created.

Vector Advantages:

Vector data is not made up of a grid of pixels. Instead, vector data is comprised of paths. This means that graphical output is generally more aesthetically-pleasing. It gives higher geographic accuracy because data isn’t dependent on grid size.

Topology rules can help data integrity with vector data models. Vector data structure is the model of choice for efficient network analysis and proximity operations.

Vector Disadvantages:

Continuous data is poorly stored and displayed as vectors. In order to display continuous data as a vector, it would require substantial generalization.

Although topology is useful for vector data, it is often processing intensive. Any feature edits requires updates on topology. With a lot of features, vector manipulation algorithms are complex.

Raster Data Advantages and Disadvantages

Raster Advantages:

Raster grid format is the natural output of choice of satellite data. Raster positions are simple. With cell size and a bottom-left coordinate, each cell position can be inferred.

Data analysis with raster data is usually quick and easy to perform. With map algebra, quantitative analysis is intuitive equally with discrete or continuous rasters.

Map Algebra

Raster Disadvantages:

Graphic output and quality is based on cell size. It can have a pixelated look and feel. Linear features and paths are difficult to display and depends on spatial resolution.

Networks are awkward with raster data. They are difficult to establish. Multiple fields with attribute data is difficulty and maps are often restricted to displaying a single attribute field.

Raster datasets can become potentially very large because a value must be recorded and stored for each cell in an image. This means that a soil map with 20 classes requires the same amount of storage space as a map showing only one value such as a forest. Resolution increases as the size of the cell decreases. But this comes at a cost for speed of processing and data storage.

Take Your Pick: Vector or Raster Spatial Data Types

Deciding which spatial data type should be used to model real-world features is not always straight-forward.

Sometimes the answer is simple:

Aerial imagery is only available in raster format. But there are many other features that can be stored as a vector or raster data type.

It really depends on the way in which the individual conceptualizes the feature to select spatial data types.

  • Do you want to work with pixels or coordinates? Raster data works with pixels. Vector data consists of coordinates.
  • Do you want to scale your features? Vectors can scale objects up to the size of a billboard. You don’t get that type of flexibility with raster data
  • Do you have restrictions for file size? Raster file size can result larger in comparison with vector data sets with the same phenomenon and area.

Spatial Data Structures

Spatial data types provide the information that a computer requires to reconstruct the spatial data in digital form.

In the raster world, we have grid cells representing real world features. In the vector world, we have points, lines and polygons that consist of vertices and paths. Vector and raster data have their advantages and disadvantages.

But don’t sweat it:

Vectors can be converted to raster. And vice versa.

Do you have anything to add? Submit your comments below.

8 Comments on GIS Spatial Data Types: Vector vs Raster

  1. Generally vectors can be more complex, and don’t have the chessboard appearance like rasters… So I’d lean towards vector to represent reality better

  2. How is a surface created that shows the distance from a particular point in all directions in the vector and raster data models

  3. Thanks for the post. I found myself on this website because I am trying to learn the advantages of both raster and vector. So even though I am not going to be building a map, this was really useful info to help me understand some of the uses and properties of both image types.

    Thanks again.

  4. I have binary data that is either going to be represented by a 1 (0-15% slope) or 0 (>15% slope) slope. If publishing on a webmap, I am under the impression that raster would be a better format to use. Any thoughts?

Leave a Reply