Title: | Wrapper around rayshader package |
---|---|
Description: | The package rasterShade is just a wrapper around function in rayshader package. The rasterShade package allows using rayshader algorithm directly on spatial data in form of Raster. The package tries to set "reasonable" default values for parameters in rayshadering algorithm. These default values are based on real world shadows that can be seen in nature. |
Authors: | Jan Caha [aut, cre] |
Maintainer: | Jan Caha <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.6.0 |
Built: | 2024-11-01 11:16:48 UTC |
Source: | https://github.com/JanCaha/rasterShade |
The function is a wrapper around getSunlightPosition function. It performs several validy checks on inputs to ensure that they are logically valid. It also allows specification of time as and as an solar event.
get_sun_position( date = lubridate::ymd(Sys.Date()), time = "noon", tzone = "UTC", lat, lon )
get_sun_position( date = lubridate::ymd(Sys.Date()), time = "noon", tzone = "UTC", lat, lon )
date |
Date specified as |
time |
Either character representation of time (in format |
tzone |
a character string that specifies which time zone to parse the date with.
The string must be a time zone that is recognized by the user's OS. If no time zone is given the default
value |
lat |
latitude of the location. Numeric from range -90,90. Positive values are north of the Equator. |
lon |
longtitude of the location. Numeric from range -180,180. Positive values are east of the central meridian. |
data.frame with one row and two columns sun_azimuth and sun_elevation indicating sun position on the sky. Both values are in degrees. Sun azimuth value 0 is pointing towards North and in rises clockwise direction. Sun elevation 0 means that sun is exactly on the horizon, value 90 means that sun is exactly az zenith.
This function is just a wrapper around ambient_shade that supports directly using Raster in the function. The function also tries to set "reasonable" default values for parameters.
shade_ambient_date_time( surface_raster, date = as.character(Sys.Date()), time = "noon", tzone = "UTC", rays_number = 36, search_distance = 200, z_value = 1, verbose = FALSE ) shade_ambient_sun_position( surface_raster, sun_elevation = 45, rays_number = 36, search_distance = 200, z_value = 1, verbose = FALSE )
shade_ambient_date_time( surface_raster, date = as.character(Sys.Date()), time = "noon", tzone = "UTC", rays_number = 36, search_distance = 200, z_value = 1, verbose = FALSE ) shade_ambient_sun_position( surface_raster, sun_elevation = 45, rays_number = 36, search_distance = 200, z_value = 1, verbose = FALSE )
surface_raster |
Object of class Raster. |
date |
Date specified as |
time |
Either character representation of time (in format |
tzone |
a character string that specifies which time zone to parse the date with.
The string must be a time zone that is recognized by the user's OS. If no time zone is given the default
value |
rays_number |
Number of rays that are calculated around each pixel. Default value is 36, which means that one ray per 10 degrees of orientation. |
search_distance |
Distance in which sun blocking objects are searched for, specified in map
units. Default value is |
z_value |
numeric value indicating the scale between xy and z. Typical use is if the distance
is measured in meters and elevation in foots, in such case the z value needs to be recalculated
to meters. Default value is |
verbose |
Should informative message be printed? Default |
sun_elevation |
Numeric value, from range 0 - 90, with 0 being sun elevation directly on horizon while 90 means that sun is directly above the surface. |
Object of class Raster.
This function is just a wrapper around ray_shade that supports directly using Raster in the function. The function also tries to set "reasonable" default values for parameters.
shade_global_date_time( surface_raster, date = as.character(Sys.Date()), time = "noon", tzone = "UTC", search_distance = 200, z_value = 1, verbose = FALSE ) shade_global_sun_position( surface_raster, sun_elevation = 45, sun_azimuth = 180, search_distance = 200, z_value = 1, verbose = FALSE )
shade_global_date_time( surface_raster, date = as.character(Sys.Date()), time = "noon", tzone = "UTC", search_distance = 200, z_value = 1, verbose = FALSE ) shade_global_sun_position( surface_raster, sun_elevation = 45, sun_azimuth = 180, search_distance = 200, z_value = 1, verbose = FALSE )
surface_raster |
Object of class RasterLayer. |
date |
Date specified as |
time |
Either character representation of time (in format |
tzone |
a character string that specifies which time zone to parse the date with.
The string must be a time zone that is recognized by the user's OS. If no time zone is given the default
value |
search_distance |
Distance in which sun blocking objects are searched for, specified in map
units. Default value is |
z_value |
numeric value indicating the scale between xy and z. Typical use is if the distance
is measured in meters and elevation in foots, in such case the z value needs to be recalculated
to meters. Default value is |
verbose |
Should informative message be printed? Default |
sun_elevation |
Numeric value, from range 0 - 90, with 0 being sun elevation directly
on horizon while 90 means that sun is directly above the surface. Default value is |
sun_azimuth |
Numeric value that specifies azimuth from which the sun is shining on the
surface. Value has to be from the range 0 - 360. Default value is |
Object of class Raster.
This function is just a wrapper around lamb_shade that supports directly using Raster in the function. The function also tries to set "reasonable" default values for parameters.
shade_lambert_date_time( surface_raster, date = as.character(Sys.Date()), time = "noon", tzone = "UTC", only_facing_sun = FALSE, z_value = 1, verbose = FALSE ) shade_lambert_sun_position( surface_raster, sun_elevation = 45, sun_azimuth = 180, only_facing_sun = FALSE, z_value = 1, verbose = FALSE )
shade_lambert_date_time( surface_raster, date = as.character(Sys.Date()), time = "noon", tzone = "UTC", only_facing_sun = FALSE, z_value = 1, verbose = FALSE ) shade_lambert_sun_position( surface_raster, sun_elevation = 45, sun_azimuth = 180, only_facing_sun = FALSE, z_value = 1, verbose = FALSE )
surface_raster |
Object of class Raster. |
date |
Date specified as |
time |
Either character representation of time (in format |
tzone |
a character string that specifies which time zone to parse the date with.
The string must be a time zone that is recognized by the user's OS. If no time zone is given the default
value |
only_facing_sun |
Boolean value specifing if the value should be determined for all parts of the surface or only for parts oriented towards sun. Default value is FALSE, which means that it is calculated for all parts of the surface. |
z_value |
numeric value indicating the scale between xy and z. Typical use is if the distance
is measured in meters and elevation in foots, in such case the z value needs to be recalculated
to meters. Default value is |
verbose |
Should informative message be printed? Default |
sun_elevation |
Numeric value, from range 0 - 90, with 0 being sun elevation directly
on horizon while 90 means that sun is directly above the surface. Default value is |
sun_azimuth |
Numeric value that specifies azimuth from which the sun is shining on the
surface. Value has to be from the range 0 - 360. Default value is |
Object of class Raster.