I am calculating shadow cast using Shadow Package in R studio. I have successfully generated shadow cast by the three objects with specific heights for one whole day for every hour. The output I get is a separate shadow for every hour in a separate frame. I wanted to get all shadows in one frame along with the time stamp.
time_seq = seq(from = as.POSIXct("2021-07-19 05:15:00", tz = "Europe/Berlin"), to = as.POSIXct("2021-07-19 21:20:00", tz = "Europe/Berlin"), by = "1 hour")
time_seq
#
solar_pos_seq = solarpos2(location = location_geo, time = time_seq)
solar_pos_seq
#
#
shadow_props = rep(NA, nrow(solar_pos_seq))
shadow_props
#
for(i in 1:nrow(solar_pos_seq)){
if(solar_pos_seq[i, 2] < 0) shadow_props[i] = 1 else {
footprint = shadowFootprint(obstacles = shapefile, obstacles_height_field = "Height", solar_pos = solar_pos_seq[i, , drop = FALSE])
#plot(footprint)
footprint
combine_footprint = union(footprint, shapefile)
complete = union(combine_footprint,settlements)
plot(complete)