This census help guide will take you step by step through joining data to boundary shapefiles. Once you have downloaded Census data in .dbf format, you can join it to a shapefile and map it in ArcGIS Online.
If you're using ArcGIS Desktop/ArcMap or ArcGIS Pro, please see our help guides that covers those workflows.
If you have any issues with this process or further questions, please don't hesitate to contact us!
If you haven't used Canadian census data before, please consult our Choosing Census Geography help guide to figure out which census geography will work best for what you'd like to map.
Once you know the census geography you are going to map, you need the corresponding boundary shapefile.
- If you are only looking at Ottawa-Gatineau, find the shapefiles here (includes historic years back to 1951).
- For Canada-wide boundary files from 2021 and many previous census years, find links from this page.
- Make sure to use the shapefile for the same census year as the data you're using!
- The Statistics Canada links provided are generally more straightforward. Select "Cartographic Boundary File."
You may find it helpful to save the shapefile in a project folder with the data you wish to map.
For uploading to ArcGIS Online, keep the shapefile and all its component parts (.shp, .dbf, .prj, etc.) in a .zip folder.
If you are using census tracts (CTs) please refer to Step 3a below, as the decimals in the GEO UID field make things a bit more complicated.
The process for ArcGIS Online is a bit different than for ArcGIS Pro or ArcGIS Desktop/ArcMap.
- Follow Steps 1-5 on our Downloading Canadian Census Analyser Data help guide
- For the output format, select Screen output - MS Excel ready
- Any of the CSV options will also work, but you'll need to download the header file to know what the column headers (COL0, etc.) represent
- A CSV file will download automatically called census.csv
It's now necessary to format the census.csv file so it functions properly in ArcGIS Online.
- Open census.csv in Excel or another spreadsheet software
- You'll notice that the top few rows include descriptions of the column headers, which are currently COL0, COL1, etc.
-
Image:
-
- Copy and paste the column headers into the appropriate column, replacing COL0 and similar.
- It is good practice in GIS to remove all spaces from column headers, and to also keep them as short as possible.
-
Image:
- Finally, delete the column header information at the top of the CSV, as well as any empty rows between the new column headers and the data. Save the CSV.
-
Image:
-
GEO_UIDs for census tracts (CTs) and CT Names are numerical codes with leading and trailing zeros (e.g. 5050003.00 and 0000.00, 0001.04, 0001.05, etc.). These numerical codes (GEO_UID and/or CT Name) must be kept intact in order to have a common column to complete the join process. Please follow the workflow below to ensure your CT data table is properly formatted to complete your join in ArcGIS Online:
- Follow Steps 1-5 on our Downloading Canadian Census Analyser Data help guide
- Select output format and submit query and download. Under Select the output format, choose Download to a file and dBase (DBF) file. A DBF will keep the data formatting intact. Click on Submit Query.
Image:
- A new download page should open with a link to download your DBF and a Header file link. Right-click on the Header file link and save as a text file or in Notebook. You will need the header file as reference as your data table headers will be listed as COL_1, COL_2, etc.
Image:
- Find the DBF file you just downloaded (likely in your downloads folder). Right-click on the DBF and choose Open with and choose Excel (If we originally downloaded the data as an Excel of CSV sheet, the data formatting would not be intact). If Excel does not show up in the suggested list of apps, click on Choose another app and browse through program files to select it.
Image:
- Once the DBF is opened in Excel, you can see that the GEO_UID and the CT_Names are intact. You may notice that the columns are very wide apart. Resize your column widths so that most of your data columns are visible. Change the column header names using the Header file you downloaded as reference. Next, select the columns with the GEO_UID and the CT_Name. In the Number tab, in the grey ribbon, use the drop down menu to choose text. This ensures that our numbers are stored as text and remain intact.
Image:
- Next, save as a Comma Separated Value (CSV) file. Click on File in the top left corner and choose Save as. Browse to the location you want to save your file. Give your file a name and choose CSV (Comma delimited) as your file format. Click Save. DO NOT OPEN THE CSV after saving - this is very important (and weird...we know). Close excel.
Image:
- Again, do not open the CSV after saving. Close Excel. Navigate to the file location. Right-click on the CSV and choose open with Notepad. This will allow you to view the data and see if it has saved correctly. If successful, you should see the data with leading and trailing zeros.
Image:
- Great! Close Notepad and launch ArcGIS Online. Once signed in, under Content, Click on + New Item.
Image:
- Choose to add a file from your Device and follow the prompts: Browse to your file location and click Open | Choose Add (yourfilename) and create hosted feature layer | click Next. It may take a few seconds for this process to complete depending on the size of your datafile.
- Your next prompt will be for Location settings. Drop down the Address and place names menu and choose None (your data contains no coordinates, addresses, or geometry) | Click Next
Image:
- In the next prompt, add any useful descriptive information, change the title if you want, add tags, etc. and click Save.
- You should be redirected to the Overview page of your newly created feature layer table. click on the Data tab in the blue ribbon | make sure Table view is selected | check to see that your leading and trailing zeros are intact in the UID and CT Name columns.
Image:
If you're a current Carleton University student, staff, or faculty member and haven't yet obtained an ArcGIS Online account, please follow these instructions to get an ArcGIS Online account.
- Login to ArcGIS Online
- Click Content
- Click New Item
- Drag and drop or browse and select the CSV from Step 3.
- In the next screen, choose the "Add [filename].csv and create a hosted feature layer or table" option
-
Image:
-
- You'll now confirm that the field types are correct.
- Make sure that text fields are String and numbers are either Integer (no decimal places) or Double (decimal places)
- Information about ArcGIS field types
-
Image:
- Under Location Settings on the next screen, click None - This CSV contains no location data and will be added as a table.
-
Image:
-
- Finally, on the last screen, give your CSV a helpful title (e.g. Federal Electoral Districts with population change 2016 to 2021), add tags, categories, and a summary, and click Done.
- Login to ArcGIS Online
- Click Content
- Click New Item
- Drag and drop or browse and select your zipped shapefile from Step 2.
- In this example, Federal Electoral District boundaries were downloaded from Statistics Canada, which arrived as a .zip file (lfed000b21a_e.zip) that is being directly uploaded to ArcGIS Online
- In the next screen, create a hosted feature layer
-
Image:
-
- Give your shapefile a helpful title (e.g. Canadian Federal Electoral Districts 2021) and wait for it to load, which may take a few minutes depending on the size of the file.
- Since you're creating a hosted feature layer, that may also take a few moments once the main Overview page for your new layer loads.
This step involves using the Join Features tool to stick the CSV data onto the shapefile so you can display the results in a map.
The GEO UID field is the key: it is a numeric code that is unique for each Census Canada geography so no two GEO UIDs are the same, whether they're census tracts, federal electoral districts, or provinces.
- Once your shapefile has loaded as a hosted feature layer, click Open In Map Viewer
- The Map Viewer will open with your shapefile visible
- On the left side of the Map Viewer, there is a line of icons. Click Tables, and then Add Table
-
Image:
-
- Select the table of census data that you added, and it should appear near the bottom of the map pane.
- This is a good time to save your map!
- Click the Save & Open icon on the left side, then give your map a name and save.
- Click the Layers icon, just above the Tables icon on the left.
- This allows you to see the options for any spatial layers you have in your map
- Click the name of your boundary file (e.g. Canadian Federal Electoral Districts 2021) and click the Analysis icon on the right side of the screen
- Then click Tools and search for 'join' in the search bar
-
Image:
-
- Select Join Features
- First, select the Target and Join layers
- The Target layer is the layer that will have the data joined to it, so in this example it's the shapefile (e.g. Federal Electoral District feature layer)
- The Join layer is the layer with the data that will be stuck on the Target layer, so in this example it's the table (e.g. Federal Electoral Districts with population change CSV)
-
Image:
- Then, select the Join Settings
- Use Attribute Relationship should be toggled on
- Target Field: the UID field in the shapefile. Because Federal Electoral Districts (FEDs) are being used in this example, the target field is FEDUID.
- Join Field: the GEOUID in the CSV file.
-
Image:
- The following defaults should be fine:
- Join Operation: Join one to one
- Join Type: Inner Join
- Give the resulting feature layer a helpful name (e.g. Federal Electoral District boundaries 2021 with population change)
- You can click Estimate Credits as well. For 338 features it was 0.67 credits. Contact gis@carleton.ca if you require more credits.
- Click Run
- Beside the Tools tab, there is a History tab that shows the status of the analysis tool.
- This is a great time to have a break as it will take a few minutes or more to process (it took about 5 minutes for 338 Federal Electoral Districts): grab something to eat or drink, look out a window, play with a pet, or something else you find relaxing and enjoyable!
- The new feature layer should appear in the map once it's ready.
- Save your map!