Learn R Programming

shadow (version 0.1.3)

SVF: Sky View Factor (SVF) calculation

Description

Calculates the Sky View Factor (SVF) at a given location, given extruded obstacles (usually a buildings layer).

Usage

SVF(location, build, height_field, res = 5, b = 0.01)

Arguments

location
A SpatialPoints* object specifying the location for which to calculate shade height
build
A SpatialPolygonsDataFrame object specifying the buildings outline.
height_field
The name of the column with building height in build
res
Circular sampling resolution, in decimal degrees. Default is 5 degrees, i.e. 0, 5, 10... 355.
b
Buffer size when joining intersection points with building outlines, to determine intersection height.

Value

A numeric value between 0 (sky completely obstructed) and 1 (sky completely visible).

Examples

Run this code
data(build)
location0 = rgeos::gCentroid(build)
svf = SVF(location0, build, "BLDG_HT")
location1 = raster::shift(location0, 0, -15)
svf1 =  SVF(location1, build, "BLDG_HT")
location2 = raster::shift(location0, -10, 20)
svf2 =  SVF(location2, build, "BLDG_HT")

plot(build)
plot(location0, add = TRUE)
plot(location1, add = TRUE)
plot(location2, add = TRUE)
raster::text(location0, round(svf, 2), pos = 3)
raster::text(location1, round(svf1, 2), pos = 4)
raster::text(location2, round(svf2, 2), pos = 3)

Run the code above in your browser using DataLab