MagicForrest / DGVMTools

R package for processing, analysing and visualising ouput from Dynamic Global Vegetation Models (DGVMs)
GNU General Public License v3.0
27 stars 22 forks source link

exporting the maps into raster format #20

Closed sedrickel closed 5 years ago

sedrickel commented 5 years ago

Hi Matthew,

Is there a way at the moment to export rasters from the biome classifications (or from other plotSpatial outputs) that DGVM Tools creates?

(I created a separate thread as this is a different issue...)

Thanks! :)

MagicForrest commented 5 years ago

Yes, different thread different issue is good!

There is functionality to do this, but you export Fields not plots (so ecport the objects you get from geField() or getBiomes(), not from plotSpatial()). Do something like:

biome.as.raster <- as.Raster(model.biomes)

This converts them to an R raster object. See also ?DGVMTools::as.Raster for more details.

Is this what you wanted? Or did you want to write the files to disk as a netCDF or GeoTiff or something?

sedrickel commented 5 years ago

That solved it. Thanks!