Vector and Raster
What’s the Difference?
This is a graphic I used to draw for my students. It was responsible for more light bulbs popping up over heads than just about anything else I showed them. "Ohhhhhhh, OK." Anyway, vector is a series of points (nodes), that are joined by lines (arcs -that’s where ESRI got it). Points are a node, lines are a strung-together series of nodes, and polygons are an enclosed series of arcs. Raster is an image -made up of a grid of pixels, each with a pixel value represented as a color.
Further, here is an illustration of the difference in a simplified geographic context.
The Pros and Cons
Here is a quick list of the ups and downs for both vector and raster. I’ll elaborate on these below…
|+ Actionable (enables specific user-interaction)|
+ Spatially query-able
+ Attribute query-able
+ Unlimited scalability
|+ Faster for more-detailed data|
+ Rich visuals
+ Typically, a more readily available public data source
|- Unwieldy file size for geographically complex data|
- Typically requires increased GIS know-how to fully leverage
- Less suited for rich visuals
- Relatively dead query-wise
- Limited scalability (pixelation)
Vectors breathe interaction into data layers. They provide hit areas for the cursor as it passes over. This hit area can trigger a tooltip or allow selection. In the image above, I could mouse over the differently-colored sections of that map to access varying data attributes.
A vector polygon can be used as a cookie-cutter to identify other vector data (usually within the query polygon -"How many wells are within the polygon I just drew" kind of stuff.).
Because vectors have data attributes associated with each shape, it is much more straight-forward to query the geometry (points, lines, or polygons) based upon them. A raster image knows only what color a pixel is, so attaching different meaningful data to various parts of a single image is nuts.
Vectors are able to be scaled up or down without losing sharpness. Magnifying a raster will reveal its pixel-y nature.
Unwieldy File Size
Because vector data is stored as a string of geographic coordinates, complex data can be very very large in file size and therefore take longer to pull into an online application and take longer to render.
Increased GIS Know-How
For those who have scrounged around for interesting data to throw into a map, you may have found that it is easier to grab map images rather than the source GIS files (which would probably be vector). This is changing quickly, however. The popularity of GeoRSS and KML are exploding and the once monolithic Shapefile is finally giving way to more common, shareable map layer formats.
Less Suited for Rich Visuals
When it comes to detailed visuals like satellite imagery or intricate population density maps, vector is ill-suited.
For detailed stuff, raster images are much much smaller than vector versions of the same detail.
Because raster is pixel-based, the level of detail is quite sharp. To replicate that same detail using polygons made up of millions of coordinate nodes would be overwhelming.
More Readily Available
Images are everywhere. Tools like MapCruncher makes their conversion into map overlays pretty straightforward.
This is huge. Raster, while visually rich, has tremendous interaction limitations. Features in the raster image are just colored pixels; good luck attaching meaningful data beyond that. Furthermore, layering in multiple raster overlays affords users no additional interaction. That is one of the weaknesses of ArcIMS applications. All those layers with their rich attributes are compressed into a single flat raster image with no sub-image hit areas to trigger tooltips or allow selection or really any truly interactive data diving.
Relatively Dead Query-Wise
This is related the the flattening weakness. Pulling additional attribute information for within-layer features is best left to vectors. Also, performing spatial queries based upon raster images is largely a no-go. This is where vector shines.
When you stretch a rater image it pixelates. Vector can be scaled indefinitely.
Some Specific Examples
It was very important to BP that their Hurricane Management System be able to query their assets and employees based upon areas predicted to be struck by oncoming hurricanes. As such, the impact plume (below in orange) had to be vector. As hurricanes advance, the National Weather Service issues alerts and delineates areas that are predicted to be impacted within some range of statistical certainty. The Hurricane Management System lists which assets and employees intersect the risk polygons so responsive measures can be taken. This level of interaction could not be achieved with a raster image of risk areas.
In this example, the Hurricane Management System has pulled in a raster graphic overlay that represents wind speed and wave size in the Gulf. Since this is a raster image, there is no querying capability, but it does look much nicer and provide more visual detail than a vector version could.
In this example from an application built for the US Office of the Director of National Intelligence, the incidents of Avian Flu (multi-colored people and birds) are represented as vector points which can be queried against the vector polygon that represents an Avian Flyway. "Show me all cases within the flyway?" No problem.
Here, incidents of Avian Flu are viewed within the context of a raster overlay of population density. Because the overlay is raster, I cannot explicitly ask, "How many cases occur within dark red." I do, however, get a great visual sense of where there are lots of people. A comparable vector version of this data overlay isn’t realistic; it is just too detailed. So what I lose in query-ability, I gain in rich visual communication.
A question that I hear often is, "So which is better, vector or raster?"
The answer is yes. Put your money on the folks who take a hybrid approach.