Session Ready
Exercise

Buffer layers

Computing buffers is a key spatial analysis skill and the resulting buffers have a wide range of uses like, for example, identifying the number of roads within one kilometer of a school or computing the number of hazardous waste sites near sensitive natural areas.

Although, technically you can buffer data with unprojected coodinate reference systems, the buffer distance will be more meaningful with a projected CRS so it is highly recommended that you transform unprojected data to a projected CRS before buffering.

Instructions
100 XP

The packages sf and raster along with the objects df and manhattan are available in your workspace.

  • Use st_as_sf() to convert this data frame to an sf object, use 4326 for the crs argument because these points are latitude/longitude -- an unprojected CRS.
  • Use st_transform() to transform the points' CRS to match the manhattan image so we can plot them together. You will need the crs() function to get the CRS of the manhattan image.
  • Buffer your points by 1000 meters (no need to specify "meters", since this is the projection unit, this will be the default). The radius argument is dist.
  • Plot the manhattan image, and the geometries of buffers and points together. This will require running plotRGB(), plot(), and plot() again, all together.