What is the difference between raster and vector data?

Raster and vector are two very different but common data formats used to store geospatial data.
Vector data use X and Y coordinates to define the locations of points, lines, and areas (polygons) that correspond to map features such as fire hydrants, trails, and parcels. As such, vector data tend to define centers and edges of features.
Raster data, on the other hand, use a matrix of square areas to define where features are located. These squares, also called pixels, …