User Tools

Site Tools


W05-2: Training sites

This worksheet covers the second kind of information required to predict the actual land-cover. So far, a comprehensive set of remote sensing observations is available. What is missing, is a set of ground truth or training site observations, which provide spatial explicit information on the actual land cover.

After completing this worksheet you should be able to digitize training sites (or any other visually identified objects) based on high-resolution remotely sensed observations.

Things you need for this worksheet

  • GIS — most commercial or open source GIS systems will be fine. For open source software running on Ubuntu Linux, the Ubuntu GIS package is a good choice. For Windows, it will be a good choice installing everything via the OSGeo4W environment and not individually. Actually both repositories make available a comprehensive bundle of GI -tools and software packages. We will focus on GRASS, QGIS and SAGA. On the commercial side, ArcGIS is one of the powerful options.

  • the comprehensive data set compiled as part of W05-1 covering Marburg University forest available from

    GeoMOC - a data repository holding various data sets for visualization and download.

Learning log assignments

8-) As always, please add these entries to your today's learning log in the beginning of your Rmd file you will use to push to your GitHub classroom.

  • Favorite aspect of the session (if any)
  • Superfluous aspect of the session (if any)
  • Eureka effect (if any)
  • Links to what I've learned so far (if any)
  • Questions (if any)

As today's special, please complete the following assignment:

For the land-cover classification, we decided to predict the following classes:

  1. n forest classes
  2. n field classes
  3. n settlement classes
  4. n other classes

:-\ Please digitize a set of training areas for two of the above classes as vector polygons. If your class is quite heterogeneous, feel free to add sub-classes. Each class should encompass at least 50 training sites.

:-\ Please upload your digitized training sites to GeoMOC.


# rs-ws-05-2
# MOC - Remote Sensing (T. Nauss, C. Reudenbach)
#' Combine multiple shape files with ground truth data and adjust ids
#' @description
#' Combine shape files with ground truth data, adjust ids (column "ID") and 
#' write the resulting data set into a new shape file.
#' @param shp_names A list of filenames that should be combined
#' @param outfile Name of the output file (with extension shp)
#' @return Nothing.
shps_cmb <- function(shp_names, outfile){
  shift <- 0
  shps <- list()
  for(s in seq(length(shp_names))){
    act_shps <- readOGR(shp_names[s], ogrListLayers(shp_names[s]))
    shps[[s]] <- spChFIDs(act_shps, as.character(seq(nrow(act_shps)) + shift))
    shift <- shift + nrow(act_shps)
  # rownames(as(shps[[1]], "data.frame"))
  # Combine shapes
  shps_cmb <-"rbind", shps)
  # Recode values
  ids_old <- unique(shps_cmb@data$ID)
  ids_new <- seq(length(ids_old))
  ids_repl <- paste(ids_old, ids_new, sep = "=", collapse = ";")
  shps_cmb@data$ID <- recode(shps_cmb@data$ID, ids_repl)
  # Write shape file
  writeOGR(shps_cmb, outfile, file_path_sans_ext(basename(outfile)),
           driver = "ESRI Shapefile", overwrite = TRUE)
courses/msc/msc-phygeo-remote-sensing/worksheets/rs-ws-05-2.txt · Last modified: 2016/12/09 10:01 by tnauss