Description Usage Arguments Details Value Creation notes
View source: R/rasterWindowExtract.R
Raster package was missing a function to easily extract data
within a window. This is accomplished by using a radius instead of a true
window. These are wrappers for the windowExtract()
function that
does the heavy lifting.
1 2 3 | radiusExtractXY(lon, lat, ras, radius = 1)
radiusExtractData(cellID, rasData, radius = 1)
|
lon, lat |
Input locations that you are extracting from. |
ras |
raster* object that the data is being pulled from |
radius |
numeric. radius used to define extractWindow |
rasData |
data.frame object that contains the correct headers ('x', 'y', (valcolumns)). Will need to seperate out this function and create a class for it. |
radiusExtractXY()
extracts data directly from a raster using
lat long coordinates.
radiusExtractData()
is an optomized version that works better if the
raster you are extracting from never changes and you are using it for
multiple points. It uses an input data.frame of the raster values that you
can create once and then extracts data by cellID.
Returns a data.frame with the raster values extracted at the current radius.
First created on 2019-Mar-6 in the Lab4inR.R and
select.window.R scripts in my IBM class folder of the purdueResearch git.
They were developed using base code found at
http://rfunctions.blogspot.com/2017/08/extracting-data-from-rasters-using.html?view=classic.
It uses another function windowExtract()
to do the main work.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.