Description Usage Arguments Value Examples
View source: R/raster_subsetByDistance.R
This function subsets a raster object just like a round cookie
cutter. All cells (up to count
) within radius
km of
the target location are returned.
1 2 3 4 5 6 7 | raster_subsetByDistance(
raster = NULL,
longitude = NULL,
latitude = NULL,
radius = 50,
count = NULL
)
|
raster |
A Raster* object. |
longitude |
Target longitude from which the radius will be calculated. |
latitude |
Target latitude from which the radius will be calculated. |
radius |
Distance (km) of radius from target location. |
count |
Number of grid cells within radius to return. |
A Raster* object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(AirFireModeling)
setModelDataDir('~/Data/BlueSky')
# Load model data
rasterList <- raster_load(
modelName = "PNW-4km",
modelRun = c(2020091300, 2020091400, 2020091500, 2020091600),
xlim = c(-125, -115),
ylim = c(42, 50)
)
Portland_area <- raster_subsetByDistance(
rasterList,
longitude = -122.68,
latitude = 45.52,
radius = 100
)
raster_ggmap(Portland_area)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.