Is there a way to obtain a netcdf file of the Koeppen-Geiger Climatic Zones?
-
Does it have to be NetCDF, or could some other open format work, that you could easily convert to NetCDF yourself? – gerrit Oct 06 '23 at 09:39
-
thanks. the final file needs to be netcdf. how I get there is not of importance.. – aaaaa Oct 06 '23 at 13:26
1 Answers
The Köppen-Geiger climate classification at a high 1‑km resolution for historical and future climate conditions (1901–2099) presented in Beck et al. (2018) can be downloaded in GTIFF format from the following URL: https://www.gloh2o.org/koppen/
Choosing your favourite framework, you can now easily convert this into netCDF format. Using e.g. the {terra} package (wrapping GDAL) in R, it's as easy as that:
library(terra)
#> terra 1.7.71
read as SpatRaster object
r <- rast("koppen_geiger_0p00833333.tif")
r
#> class : SpatRaster
#> dimensions : 21600, 43200, 1 (nrow, ncol, nlyr)
#> resolution : 0.008333333, 0.008333333 (x, y)
#> extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax)
#> coord. ref. : lon/lat WGS 84 (EPSG:4326)
#> source : koppen_geiger_0p00833333.tif
#> color table : 1
#> name : koppen_geiger_0p00833333
dump to disk in netCDF format
writeRaster(r, "koppen_geiger_0p00833333.nc", wopt = list(datatype="INT1U"))
Or you can use GDAL directly if you like:
gdal_translate -of netCDF koppen_geiger_0p00833333.tif koppen_geiger_0p00833333.nc
- 138
- 3