What is Spatial Data?

Spatial data, sometimes called ‘geospatial data’, is data that contains locational information, most often coordinate points. Just like text documents require specific software to open and edit them, spatial data require certain software to open, view, analyze, and modify them.

This course will introduce you to different tools and platforms for working with spatial data. The main kind of software for visualizing, analyzing, and modifying spatial data is Geographic Information System, or a GIS. Additionally, there are browser-based platforms for uploading and visualizing spatial data. We will talk more about GIS tomorrow, and online platforms later in the week.

Before we turn to visualizing spatial data, we must first be able to identify data as spatial. It is important to understand the different forms spatial data take and how to make data legible to different mapping platforms. Outside this workshop, you will not always be given pre-prepared data that’s stored in the appropriate format for the task at hand. Rather, it is most likely you will be downloading data from the web or creating and combining new data — all of which requires knowledge of data types and file formats.

On this page:

Raster vs. Vector Data

There are 2 main types of spatial data: vector and raster.

Raster data is made up of pixels arranged in a grid, whereas vector data is made up of vertices and the paths between them that create geometries representing real-world features. If you’re working with continuous geospatial phenomena such as satellite imagery, topography, or climatic data (like rainfall or temperature), you’re likely using raster data. If you’re working with points, lines, or polygons, that’s likely vector data.

Vector Data

Each vector dataset will contain either points, lines, or polygons. However, a dataset can include multiple features (multiple points, or multiple lines, or multiple polygons). For example, below are a handful of vector datasets, including Vancouver neighborhoods (polygons), city blocks (polygons), restaurants (points) and streets (lines). A Geographic Information System (GIS) allows you to add multiple datasets, layering them on top of each other in order to run calculations between them to answer spatial questions. For instance, in a GIS, you could load in the below datasets and then use vector analysis tools to learn how many restaurants are within a 5 kilometer radius of a given city block, or the square area of each neighborhood.


Raster Data

Rasters, on the other hand, can generally only store one value per pixel. This value could be a color representing different kinds of topography (think of the whites, greens, and browns representing different elevations in the image below) or the quantity of something like rainfall, temperature, or distance. Multiple rasters can be overlaid to generate a multi-part raster, but generally, each pixel of a single raster can store one value meaning your raster is showing one variable. You can also do math between raster layers, or run boolean operations to isolate all pixels that do or do not meet certain criteria. An example of this is Suitability Analysis, where multiple rasters are created, each representing the where a single criteria is met; then, these rasters are overlaid to visualize areas of high suitability (such as habitat).

Below is are three examples of raster data: topography, aerial imagery, and historical rainfall for the month of February (averaged 1970-2000) from WorldClim, an excellent database of freely available historical climate data.


File Extensions

Just like a textual data can be stored in different document formats (.docx, .pdf, .txt, .rtf, etc.), spatial data can be stored in different formats too. The file extensions of spatial data give us clues about the kind of data we’re working with. Although the nuance of file formats might seem too detail oriented for an introduction to reference mapping, being aware of different spatial data types and formats will help you know what to download and troubleshoot why something may not be opening/working. If you have no prior experience with spatial data, this may be quite overwhelming right now. However, with a little bit of practical experience under your belt file formatting will quickly become common sense to you. See here for an exhaustive list of formats spatial data can take.

Raster data will often be TIF (aka TIFF) file and have the extension .tif or .tiff. Raster data may also be in an ASCII text file, with the extension .asc, or a compressed raster file formats.

Vector data come in more diverse file formats:

  • The Shapefile is an industry standard format with the extension .shp (and a host of “sidecar files” — be sure to keep them all together). Vector data downloaded in a shapefile format will almost always need to be unzipped before use. Shapefiles store data in binary. Therefore, shapefiles are not legible to human eyes and can only be opened and visualized by a GIS.
  • GeoJSON, on the other hand, stores vector data in .geojson files that can be opened (and edited) in a code editor or online in geojson.io. From there, geoJSON can easily be parsed with human eyes.
  • Spatial data might even be stored in an excel sheet or a .csv file.
  • KML, or Keyhole Markup Language, is particular to Google Earth and Google Maps and doesn’t work well in a GIS. This is why, when using Google platforms, you’ll need to upload your data in either .kml or .csv format.
  • If your data does not have an explicit spatial component, but includes place names or addresses, with a little work, this can be made legible to tools and platforms designed to read spatial data. Also note that historical data might come in the form of a scanned map that will need to be “georeferenced”, or projected into a 2-dimensional coordinate space. Additionally, in a GIS, you can convert raster data to vector data and vector data to raster data, and extract raster values to a vector dataset.
  • If your data’s locative information is in the form of text — for example, country/city names or street addresses — this can be made legible to a GIS with a few extra steps (see geocoding). You may have to create new columns and populate them with coordinate information.



Data Sources

Now that you understands what spatial data is and the different formats it comes in, you may be wondering Where, then, do you find spatial data? Maybe you already have some, maybe you’re still searching. A lot of spatial data is accessible via the internet, albeit under different licenses.

Historical Data and DH Specific Data Sources

Libraries, Municipal portals, and Governmental agencies

Municipal and governmental agencies local to your project are also great places to begin looking. For example, see for Vancouver the Vancouver Open Data Portal, Data BC for Provincial data, and Natural Resources Canada or here for national resource data. Many Canadian cities have their own municipal open data source, though downloading the data will be different depending on the platform used by each city.

Free and open source context layers

Natural Earth, which we will use today, provides free, public domain raster and vector data at a global scale. For example, you can download country and state outlines (and from various state-based perspectives), rivers/lakes/reservoirs, oceans and coastlines, and landmasses. You can also download hillshade data from Natural Earth whose symbology you can adjust in QGIS to show topography. This makes it an excellent resource for simple reference mapping for academic publication.

World (historical) data

The Humanitarian Data Exchange contains lots of useful global data. WorldClim publishes historical climate data such as precipitation and temperature, which you can download as raster datasets. For free and open-source infrastructural data, see Open Street Maps (OSM). Refer to our Plugins in QGIS Workshop for a demonstration of how to extract and download OSM data or use it as a basemap for your maps.

Satellite Imagery

Satellite imagery can often be downloaded directly from providers. For example, download Sentinel data from the Copernicus Browser. If you’re using QGIS, the SRTM-Downloader plugin is a handy tool to download NASA data for a specific area of interest directly from within your GIS interface. If you are a UBC student, staff, or faculty, you can request a Planet account to gain access to much more imagery.

Creating your own

Finally, you can always create your own vector layers, or create new shapefiles within a GIS by tracing existing data. We will discuss data creation and editing further on another day.

If you are working with historical or physical maps and want to digitize them or otherwise create spatial data using them as template, you might need to use a georeferencer. We will discuss georeferencing more later in the week.

Resources for Finding and Working with Spatial Data


View in GitHub

Loading last updated date...