Exercise: Proximity and Sampling

Test your understanding of proximity analysis and sampling points.

We'll cover the following

Overview

In this exercise, let's suppose you need to retrieve the total rainfall that occurred in 2022 near the most populated cities of the South American continent (we can consider a limit of ten cities in the study). However, due to external reasons (e.g., comparison, model calibration, and others), you need to retrieve not only the rainfall at the city but also the exact location of the ozone station that is nearest to the city. In this case, both values city_rain and station_rain should be provided for each row (i.e., each city) on the resulting dataset.

To complete the exercise, the following datasets are available and already loaded in the code widget:

  • Countries

  • Populated places (i.e., cities)

  • South America's rain raster

  • Ozone stations

Here are some general guidelines for completing the challenge:

  • The ozone stations dataset comes as a .csv file and needs to be spatialized. Its coordinates are informed as WGS-84 CRS (i.e., EPSG=4326).

  • To locate the cities in the South American continent, it is necessary to clip the cities dataset with the South American boundaries. There is a continent column in the countries dataset that can be used for filtering or dissolving.

  • The biggest cities can be filtered through the pop_max column in the cities dataset.

Write your code after the comment.

Get hands-on with 1200+ tech skills courses.