Raster is faster but vector is corrector!
Have you ever heard that phrase when debating whether to use raster or vector data for visualizing layers (e.g. demographics, financial, human mobility) or real world features (e.g. houses, roads, trees, rivers) within Spatial Data Science? Aside from the imperfect English, is vector indeed corrector?
In this post we take a look at the key differences between these two types of spatial data and discuss when it is appropriate to use one or the other. First though, let’s define exactly what we mean when referring to spatial data as either raster or vector.
Raster data is made up as a matrix of pixels, also referred to as cells in much the same way as you might find when working within a spreadsheet. They are often square and regularly spaced but don’t have to be. Think of walking over a field divided into a grid of squares with each square representing a value which can be discrete (e.g. soil type) or continuous (e.g. elevation).
Raster data can be added as a basemap within the CARTO platform which by default uses vector graphics for map rendering.
Rather than working with a matrix of cells, vector data stores basic geometries (made up of one or more interconnected vertices), with three key types:
Below we can see vector data (specifically polygons representing the evolution of Manhattan’s building footprints over time) within a map created using CARTO VL.
Vector data is fully supported across the CARTO platform since Location Intelligence relies on the ability to analyze and visualize data in such a format.
Want to try for yourself?Sign up for a free account
Map Algebra with raster data is usually quick and easy to perform
Some specific use cases can only be achieved with raster data (e.g. modeling water flow over the land surface)
Linear features and paths are difficult to display
Subject to a pixelated look and feel
Datasets can become very large because they record values for each cell
Graphical output is generally more aesthetically-pleasing
Higher geographic accuracy because data isn't dependent on grid size
Continuous data is poorly stored and displayed
Needs a lot of work and maintenance to ensure that it is accurate and reliable
When working with raster or vector data within the sphere of spatial analysis there are of course a myriad of use cases that can be employed but as has been touched upon already there are specific cases where it can make sense to use one over another.
For example due to the nature of its collection, raster is often the only choice when working with remote sensing data captured by cameras on planes or satellites. The spatial resolution of such data will be determined by the capabilities of the sensor used to take an image which is why it can be subject to a pixelated look when using a low resolution.
The image below, which could be mistaken for a vector data layer, is a satellite image of agricultural land in Haskell County, Kansas.
The power of vector data becomes evident when we start to move from simply asking where something occurs to why. This is true spatial analysis and allows us to gain deeper insights from the data as GIS evolves to Spatial Data Science. Some questions that can be answered leveraging vector data include:
As we’ve seen there are distinct use cases for using either raster or vector data. Many will make impassioned arguments extolling the virtues of one or the other but thankfully since raster can be converted to vector and vice versa there is no need to choose one exclusively.
Want to learn more?Get in touch with one of our experts
Many comparisons have been made between these two iconic cities, not least in terms of size, population and other factors like quality of life and the best pizza slice, but...Data Visualization
Updated as of 2nd April (added DrupalCon, OSCON, updated Cisco Live & SAP Sapphire). Due to the large number of events currently being cancelled or postponed we will up...Data Visualization
Please fill out the below form and we'll be in touch real soon.