tests/testthat/test_shadowFootprint.R

library(shadow)

context("shadowFootprint")

test_that("Shade footprint calculation is correct", {
  expect_equal({
    data(build)
    location = rgeos::gCentroid(build)
    time = as.POSIXct("2004-12-24 13:30:00", tz = "Asia/Jerusalem")
    solar_pos = maptools::solarpos(
      matrix(c(34.7767978098526, 31.9665936050395), ncol = 2),
      time
      )
    footprint = shadowFootprint(
      obstacles = build,
      obstacles_height_field = "BLDG_HT",
      solar_pos = solar_pos
      )
    rgeos::gArea(footprint)
  },
  6513.44739346873
  )
  }
)

Try the shadow package in your browser

Any scripts or data that you put into this service are public.

shadow documentation built on March 15, 2021, 1:07 a.m.