View source: R/overlap_fraction.R
overlap_fraction | R Documentation |
overlap_fraction
overlap_fraction(shp, cellsize = 0.1, range = NULL, outfile = NULL, ...)
I
: the order of base
, [lon, lat]
, image
works directly on it.
cell
: the order of gdal
, [lon, rev(lat)]
, returned by values(r)
,
## Not run:
library(nctools)
f = "//kong-nas/CMIP6/DATA/China/CN0.5.1_ChinaDaily_025x025/yearly/CN05.1_Tmax_1961_2021_yearly_025x025.nc"
data = ncread(f, "tmax")
image(data[, , 1]) # should works
r = rast(f)
range = as.vector(ext(r))
cellsize = res(r)
## End(Not run)
# shp = basin_Baihe
shp = bou1_4p
cellsize <- 0.5
range <- st_range(shp, cellsize)
dat = overlap_fraction(shp, cellsize = cellsize, range, outfile = NULL)
print(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.