extractPoints: Extracts the raster data corresponding to each point in the...

Description Usage Arguments Value See Also Examples

Description

This function looks up each point in a raster (point) dataset and returns the corresponding data from a raster.* object using sp::SpatialPoints. It is used to build combined remote-sensed and field data that can be input into a classification model.

Usage

1
extractPoints(rData, vData, locs, na.omit = TRUE)

Arguments

rData

the raster data as a raster.* object; can be read in using readTile

vData

the point data as a data frame or a SpatialPointsDataFrame, i.e. read in with readShapePoints

locs

the columns which contain the locations... c(easting, northing)

na.omit

(optional) remove NA points from the dataset? defaults to TRUE

Value

a data frame with the combined data: the original vector data with the extracted raster data columns appended

See Also

readTile for reading in a collection of geoTiff's, egTile for more information on the raster format and some examples on generating derived raster layers, and siteData for an example of the output of this function. See also readShapePoints for more on reading-in vector data from a shapefile.

Examples

1
2
3
4
5
egTile <- readTile(file.path(system.file("extdata", "egTile", package = "NPEL.Classification"),''),
                   layers=c('base','grnns','wetns','brtns','dem','slp','asp','hsd'))
vData <- maptools::readShapePoints(system.file("extdata/Plots", "Plots.shp", package = "NPEL.Classification"))
siteData <- extractPoints(egTile,vData,c('EASTING','NORTHING'))
detach ('package:maptools',unload=TRUE)

henkelstone/NPEL.Classification documentation built on May 17, 2019, 3:42 p.m.