ExtractByPoly {ExtractTrainData} | R Documentation |
Add a Polygon shapefile and raster image.
Description
Add a Polygon shapefile and raster image.
Usage
ExtractByPoly(img, poly.shp, In.colName, Out.colName)
Arguments
img |
Raster image |
poly.shp |
Polygon shapefile with class info |
In.colName |
Name of the column contain polygon id's |
Out.colName |
Name of the output column contain polygon id's |
Author(s)
Subhadip Datta
Examples
library(raster)
library(ExtractTrainData)
img<-brick(system.file("extdata","ras.tif",package = "ExtractTrainData"))
poly.shp<-shapefile(system.file("extdata","poly_shp.shp",package = "ExtractTrainData"))
Out.colName<-In.colName<-"Id"
ExtractByPoly(img,poly.shp,In.colName,Out.colName)
[Package ExtractTrainData version 9.1.6 Index]