Checking maximal overlap of Sentinel Scenes to get biggest possible area and reprojecting to wgs extent object

inpath_sen <- "C:/Users/Alice/Uni/Projekte/GEDI/data/Sentinel"
overlap <- sen_max_overlap(inpath_sen = inpath_sen)

#####
### reproject utm overlap to wgs
#####
mat <- matrix(c(overlap["xmax"], overlap["ymax"],
                overlap["xmin"], overlap["ymax"],
                overlap["xmin"], overlap["ymin"],
                overlap["xmax"], overlap["ymin"],
                overlap["xmax"], overlap["ymax"])  ## need to close the polygon
              , ncol =2, byrow = T
  )
  ## create polygon objects
  pol <- st_polygon(list(mat))
  ## create sf object
  area_utm <- st_sf(overlap, st_sfc(pol), crs = "+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs")
  ## transofrm sf object
  area_wgs <- st_transform(area_utm, crs = "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")
  extent(area_wgs)


envima/GEDItools documentation built on July 25, 2020, 5:13 p.m.