Graph here, graph there

It is time to work with spatial weights matrices by yourself.

Zones of suburbanisation

You are familiar with Prague from the last section, so let’s zoom out to zones of suburbanisation around Prague and other Czech cities. Head over to the DataHub of the Faculty of Science and download the dataset called “Zóny rezidenční suburbanizace 2008-2016” containing the zones of residential suburbanisation outlined by Ouřednı́ček, Klsák, and Špačková (2019). Download the dataset and open it with geopandas. Use "OBJECTID" column as an index (other feasible columns are not unique - they contain duplicated entries).

If the link does not work, please report it and use the backup.

Interaction with Graphs

  1. Create a contiguity matrix using the Queen criterion
  2. Let’s focus on Prague (ID 891 in the table). How many neighbours does it have?
  3. Reproduce the previous section’s zoom plot with Prague and its neighbours. Can you make that plot as both static and interactive maps?
  4. Create a block spatial weights matrix where every geometry is connected to other geometries in the NUTS2 region. For that, use the NUTS2_kod column of the table.
  5. Create KNN weights with 5 neighbours. Remember that KNN expects point geometry.
  6. Compare the number of neighbours by geometry for the three weights matrices. Which one has more? Why?

Spatial lag

Let’s have a look at spatial lag. Before proceeding, you will probably need to pre-process the column with the population ("obyv_31122") since it comes as string. Assuming the GeoDataFrame is called suburbanisation, you can do the following to cast it to float.

suburbanisation["obyv_31122"] = (
    suburbanisation["obyv_31122"].replace("?", None).astype(float)
)
  1. Measure spatial lag (as mean, so don’t forget to standardise your weights) of the "obyv_31122" column using all weights matrices you have created.
  2. What is the difference in results for Prague? Do you know why?

References

Ouřednı́ček, Martin, Adam Klsák, and Petra Špačková. 2019. “In Between City and Village: The Development of Spatial Patterns of Czech Suburbanisation 1997–2016.” Demografie 61 (4): 299–308.