Raster and vector are the two basic data structures for storing and manipulating images and graphics data on a computer. Major GIS and CAD (Computer Aided Design) software packages available today are primarily based on one of the two structures, either raster based or vector based, while they have some extended functions to support other data structures.
Raster images come in the form of individual pixels, and each spatial location or resolution element has a pixel associated where the pixel value indicates the attribute, such as color, elevation, or an ID number. Raster images are normally acquired by optical scanner, digital CCD camera and other raster imaging devices. Its spatial resolution is determined by the resolution of the acquisition device and the quality of the original data source. Because a raster image has to have pixels for all spatial locations, it is strictly limited by how big a spatial area it can represent. When increasing the spatial resolution by 2 times, the total size of a two-dimensional raster image will increase by 4 times because the number of pixels is doubled in both X and Y dimensions. The same is true when a larger area is to be covered when using same spatial resolution.
Vector data comes in the form of points and lines that are geometrically and mathematically associated. Points are stored using the coordinates, for example, a two-dimensional point is stored as (x, y). Lines are stored as a series of point pairs, where each pair represents a straight line segment, for example, (x1, y1) and (x2, y2) indicating a line from (x1, y1) to (x2, y2).
In general, vector data structure produces smaller file size than raster image because a raster image needs space for all pixels while only point coordinates are stored in vector representation. This is particularly true in the case when the graphics or images have large homogenous regions and the boundaries and shapes are the primary interest. Besides the size issue, vector data is easier than raster data to handle on a computer because it has fewer data items and it is more flexible to be adjusted for different scale, for example, a projection system in mapping application. This makes vector data structure the apparent choice for most mapping, GIS and CAD software packages. Also, topology among graphical objects or items are much easier to be represented using vector form, since a commonly shared edge can be easily defined according to its left and right side polygons. On the other hand, this is almost impossible or very difficult to do with pixels.