Description Usage Arguments Value See Also Examples
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.
1 | extractPoints(rData, vData, locs, na.omit = TRUE)
|
rData |
the raster data as a raster.* object; can be read in using |
vData |
the point data as a data frame or a SpatialPointsDataFrame, i.e. read in with |
locs |
the columns which contain the locations... c(easting, northing) |
na.omit |
(optional) remove NA points from the dataset? defaults to TRUE |
a data frame with the combined data: the original vector data with the extracted raster data columns appended
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.