At-Home Activity 4: Joining Spatial Data using QGIS
It is sometimes necessary to combine data from different tables into one, for mapping, analysis or querying. In standard databases, this is called a join, and involves specifying a column in a table that the two tables to be joined have in common. In this activity, you will use QGIS to do attribute joins as for a standard database, and you will also do spatial joins.
1. Download the OpenStreetMap data for New Zealand in shape file format (shp.zip) here and load the data into QGIS. You should have a number of different layers showing streets, points of interest, transport and waterways.
2. From Koordinates, download and add to QGIS the following shape files:
a. population data for each census meshblock (the smallest unit for which population data is available) (e.g. 2018 Census electoral population (Meshblock 2020)
b. the LUCAS NZ land use map.
3. From the New Zealand Geographic Board NZGB, download the place names data (also known as gazetteer) in csv form and load into QGIS.
4. Use the Join Attributes by Field Value function in QGIS to perform two different attribute joins between any pair of tables from those downloaded in the previous steps. For example, you could join place names from osm_places_a_free from OpenStreetMap with those from the NZGB by place name so that you can connect the place name attributes from the NZGB data to the polygon data from OSM. Try to find meaningful connections.
5. Use Join Attributes by Location to:
a. Create a table/layer that shows the population for all meshblocks along railway lines.
b. Perform two other join attribute by location operations between pairs of tables.
6. Use Join Attributes by Location (Summary) to answer the following questions:
a. What is the total population of all retail areas across New Zealand?
b. Which land use has the greatest number of place names in New Zealand?
c. What is the total area of buildings that are within 2km of a vineyard in New Zealand?
What to submit:
1. Screen dumps showing the results of each of the 8 joins required in Steps 4-6 above.
2. For Step 4, for each join briefly explain the query you performed (which attributes you queried on).
3. For Step 5, for each join, explain which spatial geometric predicate you used and why (up to 50 words).
4. For Step 6, give your answer and explain how you arrived at it.
Notes:
· To answer some of these questions you may need to create a new layer that contains a subset of objects in one of the layers you downloaded using Select by Attribute.
· Some of these queries may take a long time, and you may need to create spatial indices. For extra credit, explain in your report what strategies you used to address this issue.