Loading Data

Data can be added to QGIS from many different sources, including:

  • Shapefiles
  • Esri geodatabase
  • Geopackage
  • Spreadsheet
  • Databases (PostgreSQL, SpatialLite, and others)
  • Image file (raster data)
  • Web service (WFS, WMS)

Shapefiles

Shapefiles are one of the most common vector file formats used in GIS.

• Select Layer → Add Layer → Add Vector Layer from the menu.

Add vector layer

• In the Data Source Manager, click the three dots next to the Vector Datasets(s) box.

Click the three dots next to the Vector Dataset(s) box

• Browse to the Data → Shapefiles → Streets folder. Select streets_utm_zone_17.shp. Click Open.

Browsing to the shapefile

• Click Add. Close the Data Source Manager.

Add the layer, close the Data Source Manager window

• Result: A new spatial layer, representing Toronto’s street network, has been added to the map. (Note: This dataset was obtained from the City of Toronto’s Open Data website here: https://open.toronto.ca/dataset/toronto-centreline-tcl/)

Toronto streets layer in the map canvas

Spreadsheets

Data can be imported into GIS from spreadsheets (.csv, .xlsx, etc.) Spreadsheets can be automatically transformed into spatial layers if they contain geographic information (coordinates). Spreadsheet data can also be joined to spatial layers based on common attribute values, or converted from written text using a process called geocoding.

Add a spreadsheet containing geographic coordinates

• On your computer, navigate to the Data → Tables folder within the data folder. Double-click bike_share_stations.csv to open it in Excel or other software that can view spreadsheets.

Viewing spreadsheet data

• Note that each bike share station has latitude and longitude coordinates associated with it, in columns called ‘lat’ and ‘lon’, respectively. Close the spreadsheet.

Viewing spreadsheet data - coordinates

• In QGIS, click Layer → Add Layer → Add Delimited Text Layer.

Layer → Add Layer → Add Delimited Text Layer

• Click the three dots next to the File name box.

Click the three dots next to the File name box

• Navigate to bike_share_stations.csv and click Open.

Navigate to and open the spreadsheet

• Under the Geometry definition heading, click Point coordinates. Make sure lon has been selected for the X field, and lat has been selected for the Y field.

Set up the geometry definition - lat and lon

• Click Add. Close the Data Source Manager.

Add the layer, close the Data Source Manager window

• Result: a point layer showing bike share station locations has been added to the map.

Point layer on map canvas

Add data from a spreadsheet with geocoding

Geocoding attempts to match natural language street addresses to a physical location on the earth’s surface.

Example: 130 Saint George Street, Toronto ON M5S 0C2 = Lat: 43.664, Long: -79.399.

• Navigate to the data folder and open toronto_public_libraries.csv in Excel or another spreadsheet viewer.

Viewing spreadsheet data

• Note the columns containing street address information. Close the spreadsheet.

Columns containing street address info - StreetAddress, City, Province, PostalCode

• In QGIS, select MMQGIS → Geocode → Geocode CSV with web service. (If you don’t have this option, install the MMQGIS plugin as described in the Plugins section.)

<img src=’/qgis-mapping-spatial-analysis-intro/assets/images/geocode-with-web-service.png’ alt=”MMQGIS - Geocode CSV with web service”” width=’100%’ height=’100%’ />

• Navigate to and select toronto_public_libraries.csv as the Input CSV File.

Add the libraries csv as the input

• Select the StreetAddress, City, and Province columns for the Address, City, and State parameters (if QGIS hasn’t already done this automatically).

Tool parameters for Address, City, State

• Choose OpenStreetMap/Nominatim for the Web Service.

Web Service - OpenStreetMap/Nominatim

• Save the geocoding results in the data folder as library_geocode.shp. Save the Not Found Output Last in the data folder as library_geocode_errors.csv. Click Apply.

Specify locations on your computer for the outputs

• QGIS may be unresponsive for a few moments while the plugin queries the web service. Once it has completed, however, a results message will be displayed. Click Close.

• Result: a new point layer showing public library locations has been added to the map. The layer’s attribute table contains the information from the csv.

• Records for which the geocoder couldn’t figure out a location are recorded in the library_geocode_errors.csv file.

Attribute joins

Attribute joins append columns from one table (layer) to another, based on a common matching field.

Joining data in this way is very common in GIS and in working with databases.

Example of table join - two tables are united by a unique ID field

• Navigate to the Tables folder and open socialhousing.csv. This dataset shows the number of social housing units (including those that are rent geared to income) in Toronto, by neighbourhood. Note that there are 127 total records.

Viewing spreadsheet data

• Each neighbourhood in the spreadsheet is signified by an ID number that the City has designated. This number is stored in the Neighbourhood column.

Neighbourhood spreadsheet column containing unique numeric ID

• The Neighbourhoods polygon layer in QGIS also has this ID number in its attribute table. It is stored in the Neighbourhood ID field.

Corresponding unique numeric ID in the shapefile attribute table

We’ll use a join to attach the spreadsheet data to the polygon layer.

First, we’ll add the CSV to the QGIS project:

• Select Layer → Add Layer → Add Delimited Text Layer.

Add Delimited Text Layer menu item

• Navigate to and select socialhousing.csv. Choose no Geometry (Attribute only table).

Add non-spatial delimited text file

• Click Add. Close the Data Source Manager. The csv will be added to the project as a table. It will be listed in the Layers panel, but nothing will be added to the map.

Add the speadsheet, close the Data Source Manager window

Create the join:

• Right-click (Control-click on Mac) the neighbourhoods layer. Select Properties.

Neighbourhoods layer properties

• Click the Joins tab. Click the + (plus sign) button.

Properties → Add join

• Choose socialhousing as the Join layer, Neighbourhood as the Join field and ID as the Target field. Click OK.

Join parameters: Join layer = socialhousing, Join field = Neighbourhood, Target field = ID

• Note that the join is now listed in the layer properties. Click OK to close the layer properties window.

Layer properties window - click OK

• Open the attribute table of the neighbourhoods layer. The social housing columns are now part of this table.

Attribute table showing joined columns


First created: May 25, 2026
Last updated: October 09, 2026

Tutorial maintained by Cole White.

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International icon