GIS Fundamentals: Raster vs Vector Data

A geographic information system (GIS) is a computer-based system for capturing, storing, analyzing and displaying data that are linked to locations on Earth; it represents the world with two main data models: vector data (points, lines and polygons defined by coordinates) and raster data (a grid of cells, each with a value). In brief: vector data suit discrete features such as roads, buildings and boundaries, and carry attribute tables; raster data suit continuous surfaces such as elevation, temperature and satellite images. A GIS stores data in layers that can be combined, and it relies on coordinate systems and map projections to place data accurately on the map.

GIS is used in planning, environmental management, health, transport, business and many other fields, and understanding the basic data models is the foundation of all spatial analysis. This guide explains the components of GIS, vector and raster data, coordinate systems and projections, data quality, compares the two data models in a table, works through calculations of cell size, polygon area and projection distortion, outlines the history and corrects common mistakes.

What is a GIS?

A GIS has five main components: hardware (computers, servers, GPS devices), software (such as ArcGIS or the free and open-source QGIS), data (the spatial and attribute information), people (analysts, planners and users) and methods (the procedures and workflows). Its power lies in the ability to link where something is with what it is. Data are organized in layers (also called themes), for example roads, rivers, land use, elevation and population, which are stacked and can be combined to answer questions, such as “Which homes lie within a flood zone and more than 2 km from a hospital?” A GIS can capture data (from GPS, surveys, digitizing maps and satellite images), manage it in databases, analyze it with spatial tools and present the results as maps, tables and charts.

What is vector data?

Vector data describe features as geometric shapes defined by coordinates.

Each feature is linked to a row in an attribute table that stores information such as name, type, population or date. Common file formats are the shapefile, GeoPackage and GeoJSON. Vector data are precise, scale well without losing sharpness and produce good-looking maps, and they allow topology (the relationships such as adjacency and connectivity, essential for network analysis). They are less suited to continuously varying phenomena, and complex overlay operations can be computationally demanding.

What is raster data?

Raster data divide space into a regular grid of cells (pixels), each with a single value. The size of the cell is the spatial resolution: a 30 m raster has cells of 30 m by 30 m. Typical examples are digital elevation models (DEMs), satellite and aerial images, scanned maps, and surfaces for temperature, rainfall or land cover. A raster can have a single band (such as elevation) or several (such as the red, green and blue and infrared bands of a satellite image). Values can be continuous (elevation in meters) or categorical (land cover class codes). Raster data are simple, suit continuous surfaces, and make map algebra easy (the calculation of new rasters by arithmetic on cell values), but fine resolution creates large files, the cell is a simplification of reality, and the shapes of features are stair-stepped (“blocky”) at large scale. Formats include GeoTIFF and ESRI grid.

Vector features compared with a raster grid of cells Vector Raster points, lines, polygons grid of cells, each with a value
Schematic comparison. Vector data store features as points, lines and polygons with exact coordinates. Raster data divide an area into a grid of cells, and each cell holds a value, so shapes appear as blocky patterns (shaded cells).

How do coordinate systems and projections work?

To place data on the Earth, a GIS needs a coordinate reference system (CRS). A geographic coordinate system uses latitude and longitude on a model of the Earth (a datum), the most common being WGS 84, used by GPS (EPSG code 4326). A projected coordinate system converts these spherical coordinates to a flat map with units such as meters, for example Universal Transverse Mercator (UTM) zones, or a national grid. Every projection distorts one or more of shape, area, distance and direction. The Mercator projection preserves angles and is useful for navigation, but exaggerates area toward the poles: the scale factor at latitude φ is 1 ÷ cos φ, so features at 60° N appear twice as wide and four times as large in area. Equal-area projections, such as Mollweide or Albers, are used for comparing areas, and a good rule is to choose the projection that fits the purpose and the region. All layers in the same map must use the same CRS, or the GIS must reproject them on the fly, or they will not line up.

Data quality matters: accuracy (closeness to the true value), precision, completeness, currency and metadata (information about the source, date, scale and method). Scale also limits what can be shown: data digitized from a small-scale map cannot be trusted at large scale.

Raster and vector compared

Raster and vector data models
Feature Vector Raster
StructurePoints, lines, polygons with coordinatesGrid of cells with values
Best forDiscrete featuresContinuous surfaces and images
ExamplesRoads, buildings, boundariesElevation, satellite images, temperature
AttributesAttribute table per featureOne value per cell (per band)
PrecisionHigh, scale-independent shapesLimited by cell size
File sizeUsually smallerGrows quickly with finer resolution
Common formatsShapefile, GeoPackage, GeoJSONGeoTIFF, grid

Worked example: cells, areas and distortion

  1. Number of cells: an area of 1 km × 1 km (1,000 m × 1,000 m) is covered by a raster with 10 m cells. The number of cells is (1,000 ÷ 10) × (1,000 ÷ 10) = 100 × 100 = 10,000. With 1 m cells, it is 1,000 × 1,000 = 1,000,000, which is 100 times as many cells.
  2. File size: if each cell is stored as a 4-byte number, the 10 m raster needs 10,000 × 4 = 40,000 bytes, or 40 KB, and the 1 m raster needs 1,000,000 × 4 = 4,000,000 bytes, or 4 MB. Making the cells 10 times smaller increases the size by 100 times.
  3. Area from cells: a land cover class occupies 2,500 cells of 30 m by 30 m. Each cell has an area of 900 m2, so the area is 2,500 × 900 = 2,250,000 m2 = 2.25 km2, or 225 hectares.
  4. Polygon area (shoelace formula): a polygon has vertices (0, 0), (6, 0), (6, 4), (3, 6) and (0, 4) in kilometers. Using the shoelace formula, the sum of (xi × yi+1 − xi+1 × yi) is 0 + 24 + 24 + 12 + 0 = 60, so the area is 60 ÷ 2 = 30 km2. This agrees with a rectangle of 6 × 4 = 24 km2 plus a triangle of 6 × 2 ÷ 2 = 6 km2.
  5. Line length: a road has vertices (0, 0), (3, 4) and (3, 10), in km. The first segment is √(32 + 42) = 5 km and the second is 10 − 4 = 6 km, so the total is 11 km.
  6. Mercator distortion: at 60° N the scale factor is 1 ÷ cos 60° = 1 ÷ 0.5 = 2, so distances look twice as long and areas 22 = 4 times as large as at the equator. At 45° N the factor is 1.41 and the area factor is 2.

How did GIS develop?

Early examples of overlaying spatial information include John Snow’s 1854 map of cholera cases in London and Charles Joseph Minard’s flow maps of the 1860s. The first operational GIS was the Canada Geographic Information System, designed by Roger Tomlinson in the 1960s to inventory land use, and Tomlinson is often called the “father of GIS.” The Harvard Laboratory for Computer Graphics developed pioneering software in the late 1960s and 1970s, and Esri (founded in 1969) released commercial products, with ArcInfo in 1982. Personal computers, GPS and the internet expanded GIS in the 1990s and 2000s, and open-source projects such as GRASS and QGIS (first released in 2002) made it widely accessible. Web maps such as Google Maps (2005), OpenStreetMap (2004) and mobile apps have brought spatial data to a mass audience, and cloud platforms now process very large datasets.

Which mistakes are common?

Mistake 1: Mixing layers with different coordinate systems

Layers with different CRSs may not line up or may give wrong measurements. Check and reproject data before analysis.

Mistake 2: Measuring area or distance in a geographic (latitude-longitude) coordinate system

Degrees are not equal units of length or area. Use an appropriate projected CRS in meters for measurement.

Mistake 3: Choosing raster or vector without thinking about the data

Continuous surfaces are usually raster and discrete features vector. Converting between the models loses information, so it should be done with care.

Mistake 4: Trusting data without checking the metadata

Date, scale, accuracy and source determine whether the data are suitable for the task.