Let’s get started with some hands-on exercises and exploring some data! This exercise focuses on importing different vector data geometries from various data sources and getting used to simple feature data tables.

In the folder ./data, you can find the data files prepped for all the exercises which rely on preexisting data sets. However, if you like to play around with your own data, feel free to do so! .

1

Load the administrative borders of Germany. Therefore, import the shapefile VG250_STA.shp from the respective folder and assign it to an object named “germany”.

Plot the newly created object.
Don’t forget to load the packages sf and set your working directory before starting this exercise.

The output in the console of `R gives you already some information on the data you just loaded. You also see that the object “germany” appeared in your environment. Though, we will explore the data set a little bit closer.

2

Explore the data and answer the following questions:

  • What is the geometry type?
  • What is the id of the coordinate reference system?
  • Which kind of class is the object?
  • What is the name of the column containing the information on geometries?
  • Which attributes are assigned to the geometries?

3

Do you have an idea why there are 11 observations instead of only 1, even though we expected a shapefile with the polygon of Germany? Create a new object that contains only one observation filtered by the variable GF == 4.