Function SpatialPointsTopography creates an object of class SpatialPointsTopography-class containing topographic variables for a set of points.

SpatialPointsTopography(points, elevation, slope = NULL, aspect = NULL,
                        proj4string = CRS(as.character(NA)))

Arguments

points

An object of class SpatialPoints-class.

elevation

Elevation values (in m) of the points.

slope

Slope values (in degrees) of the points.

aspect

Aspect values (in degrees from North) of the points.

proj4string

Object of class CRS in the first form only used when points does not inherit from Spatial.

Details

If either slope = NULL or aspect = NULL then when estimating weather on the object locations radiation will be calculated assuming a flat surface.

Value

Function SpatialPointsTopography returns an object 'SpatialPointsTopography-class'.

Author

Miquel De Cáceres Ainsa, CREAF

Examples

data(examplegridtopography)

#Creates spatial topography points from the grid
p = 1:2
points = as(examplegridtopography,"SpatialPoints")[p]
spt = SpatialPointsTopography(points, examplegridtopography$elevation[p],
                              examplegridtopography$slope[p],
                              examplegridtopography$aspect[p])
spt
#> Object of class SpatialPointsTopography
#>         coordinates elevation     slope   aspect
#> 1 (360000, 4640900)       548 0.7910155 275.1944
#> 2 (360100, 4640900)       554 3.1171090 238.1340

#Alternatively, use coercing and subsetting
spt = as(examplegridtopography, "SpatialPointsTopography")[p]
spt
#> Object of class SpatialPointsTopography
#>         coordinates elevation     slope   aspect
#> 1 (360000, 4640900)       548 0.7910155 275.1944
#> 2 (360100, 4640900)       554 3.1171090 238.1340