Operations With Vector Data I
Content for Monday, September 25, 2023
Now that we’ve spent some time getting used to the syntax of the sf
package and used it to assess some of the characteristics of vector objects (e.g., through predicates and measures), we’ll move into transformations. Transformations allow you to actually manipulate the geometries of a vector object (without necessarily changing the attributes themselves) and are a powerful tool for geting disparate data into some logical alignment. That said, transforming geometries can be complicated and often has some unanticipated consequences. That’s why we spent a little bit of time learning the mapping syntax as a means for you to be able to check yourself.
Readings
The introductory vignette for the
sf
package has a lot of useful info onsf
objects and conventions.Section 2.2 on Vector Data and Sections 5.1-5.3 on Geographic Operations in Lovelace et al. (Lovelace et al. 2019) - for more details about vectors and geometric operations on vectors.
Section 3.1 and 3.2 of Spatial Data Science, a
bookdown
project by Edzer Pebesma and Roger Bivand (of thesf
,sp
,rgeos
, andrgdal
packages).
Objectives
By the end of today, you should be able to:
Recognize the unary, binary, and n-ary transformers
Articulate common uses for unary and binary transformers
Use unary transformations to fix invalid geometries
Implement common binary transformers to align and combine data
Slides
The slides for today’s lesson are available online as an HTML file. Use the buttons below to open the slides either as an interactive website or as a static PDF (for printing or storing for later). You can also click in the slides below and navigate through them with your left and right arrow keys.