bboxToVector.Rd
Accepts a variety of bbox formats, validates that they are
numerically sane and returns a vector of floats in c(lonLo, lonLo, latLo, latHi) order.
Input can be a vector of floats in c(lonLo, lonHi, latLo, latHi) order or
the return value from sp::bbox()
or raster::extent()
.
bboxToVector(bbox = NULL)
bbox | bounding box for region of interest. |
---|
a vector of floats in c(lonLo, lonHi, latLo, latHi) order.
#>library(MazamaSatelliteUtils) setSpatialDataDir("~/Data/Spatial") loadSpatialData("USCensusStates") setSatelliteDataDir("~/Data/Satellite") oregon <- subset(USCensusStates, stateCode == "OR") bbox <- sp::bbox(oregon) goesaodc_downloadAOD( satID = "G16", datetime = "201924918", timezone = "UTC", isJulian = TRUE) ncFile <- "OR_ABI-L2-AODC-M6_G16_s20192491826095_e20192491828468_c20192491835127.nc" nc <- goesaodc_openFile(ncFile) raster <- goesaodc_createRaster(nc, res = 0.1, dqfLevel = 2) extent <- raster::extent(raster) # Convert bbox bbox#> min max #> x -124.56624 -116.46350 #> y 41.99179 46.29203bboxToVector(bbox)#> [1] -124.56624 -116.46350 41.99179 46.29203# Convert extent extent#> class : Extent #> xmin : -125 #> xmax : -65 #> ymin : 24 #> ymax : 50bboxToVector(extent)#> [1] -125 -65 24 50#> [1] -124 -116 42 46# }