GGR273 Lab 1: Smart Cities – Bike Sharing Locations
Lab 1: Analyzing Bicycling Parking Locations in Toronto (15%)
Submit through Lab 1 and answer questions and submit file (.jpeg of your final map).
Objective: Analyze the spatial distribution of bike rack locations in Toronto using QGIS. Perform. proximity analysis, density analysis, buffers, and overlay analysis, and create a choropleth map with an inset map. Your final map will depict the density of bike-parking locations by Neighbourhoods.
Datasets:
Connect through CKAN in QGIS
1. Bike Parking Racks Toronto Data
Contains locations of bike rack locations in Toronto.
2. City of Toronto Open Data Portal
Provides points of interest on schools, parks, and libraries.
3. Geographic Boundary File of Neighbourhoods
Defines the geographic boundaries for Neighbourhoods in Toronto.
4. Statistics Canada Census Geographies: Provinces
For context for an inset map
Step 1: Installing QGIS
1. Download QGIS from the official website:
https://qgis.org/en/site/forusers/download.html.
2. Follow the installation instructions for your operating system (Windows, Mac, or Linux).
o For Windows, download the standalone installer and run it.
o For Mac, download the disk image (.dmg) and drag QGIS to your Applications folder.
o For Linux, follow the specific instructions for your distribution on the QGIS website.
3. Once installed, open QGIS and familiarize yourself with the interface by exploring the menus and toolbars.
Step 2: Setting Up QGIS
1. Open QGIS.
2. Create a new project by clicking Project > New.
3. Save the project by clicking Project > Save As... and name it "GGR273Lab1_Bike_Racks_Toronto_July2024.qgz".
4. Be sure to regularly save your work. Suggestion to back up to an external drive, USB key or cloud storage. You can use the UToronto 365 cloud storage.
Step 3: Importing Open Data
CKAN is the world’s leading open-source data portal platform. CKAN makes it easy to publish, share and work with data. It’s a data management system that provides a powerful platform. for cataloging, storing and accessing datasets with a rich front-end, full API, visualization tools and more. Ckan.org
1. Install the CKAN plugin – this connects the Toronto open data URL to QGIS
1. Go to Plugins > Manage and Install Plugins
2. Select CKAN Browser, install
2. Once the plugin is successfully installed it is ready for use. The plugin works
specifically for data that is stored in CKAN repositories. Prior to accessing data the plugin must be configured to link to a specific CKAN repository. This can be achieved by opening the CKAN Browser via Plugins — Open Data (CKAN)
Browser from and clicking on the Open Data (CKAN) Browser icon from within QGIS.
3. The first time the CKAN Browser plugin is opened a cache location needs to be identified. The cache stores temporary files that are required by the
plugin. Set the cache location to a temp folder.
Create a new folder on your computer for this
course. Label it GGR273 Summer 2024. Create a folder within that called Lab 1. And then another
folder called Temp (for temp workspace). Click
Save. This should make the CKAN Browser plugin available. This browser gives you access to API
instances – where datasets are listed to access.
• There are 200+ publicly available CKAN instances, however not all have the api-url identified, which is the method used to connect the CKAN
Browser plugin to an open dataset. Any CKAN api-url can be added into the CKAN API Endpoint, providing access to open data managed within CKAN.
4. To accessing a CKAN repository click Select CKAN Server button, a new window will open. This button is usually at the bottom left of the window box, under the
plugin version number.
5. From within the new window (CKAN Servers) enter the CKAN api-url to the City of Toronto open data portal:https://ckan0.cf.opendata.inter.prod-toronto.ca/api/3/)
1. You can use “test the connection” button to make sure it works. Make sure you are on the internet.
2. If it works – select the next button called
“Add CKAN server to list”
3. Name the server by typing into the box:
“City of Toronto Open Data Portal”
4. The City of Toronto
instance should load. Check the box next to it so it gets loaded
into your QGIS environment.
5. Once configured and connected to a CKAN repository all
available datasets are listed in the Search
Results section of the plugin. There are over
300 datasets in the City of Toronto repository. You can scroll through the list visually or use the search bar.
6. By selecting a dataset, clicking on and highlighting a dataset in the Search Result section, different information about the dataset becomes available, such as the description, file formats, and resource URL. Selecting a
dataset and checking the desired version/format the data is loaded into QGIS by clicking the Load Data button.
7. Load the Bicycle Parking Racks dataset as a SHP (Shapefile). You can try loading the other formats and see what they look like. Once you click the load button for the Bicycle Parking Racks shapefile (should be the first one on the list), the data should load into your QGIS project space.
The system will also open a text file of metadata. Metadata includes at data dictionary.
8. Locate and load the Neighbourhoods shapefile. Choose the file called SHP: Neighbourhoods – 4326.zip.
1. Currently Toronto has 158 neighbourhoods. The city used to use
140 neighbourhoods and some were split.
9. You can return to this plug in to load other files as needed through this lab. 10.Re-order the layers by clicking, holding your mouse click, and dragging to
reorder under the Layers section. This section of the QGIS environment is usually at the left-bottom window.
11.You should see the bike rack locations over top of the neighbourhood boundaries.
12.Open the attribute tables of both files to explore the non-spatial data.
Step 4: Choosing a Map Projection
Ensure spatial data is accurately represented on the earth for precise analysis and calculations. This map projection is specific to the geographic region and the known analysis functions in this lab. For this map, select NAD83 / UTM Zone 17N
(EPSG:26917). This map projection uses the NAD (north American datum created in 1983), and for UTM zone 17N. This will preserve area, which is important for our final map that focuses on density.
Set Project CRS:
1. Go to the Project menu.
2. Select Properties.
3. Click on the CRS (Coordinate Reference System) tab.
4. In the CRS tab, type "EPSG:26917" in the filter box.
o In the bottom box called Predefined Coordinate Reference Systems,
open the drop downs by clicking on the (very) small arrows. The nested
list will start withL Projected > Universal Transverse Mercator (UTM). If
you click through these, they will reveal the next layer/folder. The final one should have you able to select NAD83/UTM Zone 17N.
o Google the UTM grid and locate the zones for your own reference.
5. Select NAD83 / UTM zone 17N from the list.
6. Click OK.
Reproject Layers:
1. Right-click on the neighbourhood boundaries layer in the Layers panel.
2. Select Export > Save Features As....
3. In the CRS section, click on the CRS selector button.
4. In the Coordinate Reference System Selector, type "EPSG:26917" in the filter box.
5. Select NAD83 / UTM zone 17N.
6. Choose a location and filename to save the reprojected layer. Best to put it in the folder you made for this class. Remember - all shapefile sub-files need to stay
together as a team to work together!
7. Click OK to save.
8. Repeat these steps for the bike rack locations layer.
9. Go ahead and remove the layers that were originally loaded, that were of the
original map projection upon download. Now you should have two layers that are re-projected.
Verify CRS:
1. Right-click on each reprojected layer in the Layers panel.
2. Select Properties.
3. Click on the Information tab.
4. Ensure the CRS is set to "EPSG:26917".
Step 5: Buffer Analysis
Create zones around bike rack locations to analyze the coverage area and proximity to other features.
1. Select the bike rack locations layer in the Layers panel.
2. Open the Processing Toolbox by clicking Processing > Toolbox.
o Icon Description: The toolbox icon looks like a wrench and screwdriver crossed.
3. In the Processing Toolbox, search for Buffer and select Vector geometry > Buffer.
o Icon Description: The buffer tool icon looks like a concentric circle with a highlighted ring.
4. In the Buffer dialog, set the Input layer to the bike rack locations layer.
5. Set the Distance to 500 meters.
6. Choose a location to save the output file and name it "Bike_Sharing_Buffer.shp".
7. Click Run and then Close.
8. This is where the buffer tool is that you can use to answer the final questions for this lab.
Step 6: Proximity Analysis
Calculate the distance from bike rack locations to points of interest. Review the final questions for this lab and choose points of interest that will help you answer the final questions.
1. Add a new layer representing points of interest (e.g., schools, parks) from the City of Toronto Open Data Portal plugin CKAN browser.
2. In the Processing Toolbox, search for Distance to nearest hub and select Analysis > Distance to nearest hub.
o Icon Description: The tool icon resembles a map marker with arrows pointing to it from different directions.
3. In the Distance to Nearest Hub dialog, set the Input layer to the points of interest layer and the Hub layer to the bike rack locations layer.
4. Choose a location to save the output file and name it "Proximity_Analysis.shp".
5. Click Run and then Close.
6. This is where the buffer tool is that you can use to answer the final questions for this lab.
Step 7: Density Analysis
Calculate the density of bike rack locations within each dissemination area of the city. This data will be used to generate your final map.
1. Ensure you have the geographic boundary file of Neighbourhoods to QGIS by following the same steps in Step 3.
2. In the Processing Toolbox, search for Count points in polygon and select Vector analysis > Count points in polygon.
o Icon Description: The tool icon looks like a polygon with points inside.
3. In the Count Points in Polygon dialog, set the Input layer to the
Neighbourhoods layer and the Points layer to the bike rack locations layer.
4. Choose a location to save the output file and name it "GGR273_Lab1_Density_Analysis.shp".
5. Click Run and then Close.
6. This is the data you will use to make your final map.
More info about the Count Points in Polygon tool: Weight Field:
• This is optional and is used if you want to weight the points by some attribute. If your point layer (bike racks) has an attribute that you want to use as a weight
(e.g., the capacity of each bike rack), you can select that attribute field here.
• If you don't have a weighting attribute or don't need to weight the points, leave this field as "None."
Class Field:
• This is also optional. If you have a categorical attribute in your point data (e.g., type of bike rack), you can use this field to classify the counts by different
categories.
• If you don't need to classify the points, leave this field as "None." Count Field Name:
• Enter a name for the new field that will be added to the polygon layer. This field will contain the count of points within each polygon.
• For example, you could name this field "Bike_Rack_Count."
Step 8: Symbolization and Categorization
Visually differentiate and categorize the density data on a map. Also change the
symbology for the bike-parking locations, and any other geospatial data you want to use in your final map.
1. Update the symbology for the bike rack point data
2. Update the symbology for your bike rack density by neighbourhood polygon dat
1. Open the Layer Properties:
1. Right-click on your neighbourhood boundaries layer in the Layers panel.
2. Select Properties.
2. Go to Symbology: In the Layer Properties window, select the Symbology tab on the left.
3. Select Categorization Scheme: Change the Render type dropdown to Graduated. Select the newly created field for density of bike racks (e.g., "Bike_Rack_Count") in the Value dropdown.
4. Choose Classification Method:
1. Click on the Classify button to see the different categories.
2. Try different Mode options (e.g., Equal Interval, Quantile, Natural Breaks) and observe the distribution in the preview.
Hint: Use the Histogram to help determine which classification method best represents your data distribution. Look for methods that provide meaningful distinctions between neighbourhoods.
5. Choose a Color Ramp:
1. Click on the Color ramp dropdown and select a color gradient that represents the density well (e.g., from light to dark to show low to high density).
2. Adjust the color ramp if necessary by clicking on Color ramp and choosing Invert color ramp if it suits your needs.
6. Click Apply and then Ok to close the layer properties window.