# NOT RUN {
# generate missing metadata
data(eberg_grid)
library(sp)
coordinates(eberg_grid) <- ~x+y
gridded(eberg_grid) <- TRUE
proj4string(eberg_grid) <- CRS("+init=epsg:31467")
# with localy prepared metadata file:
eberg_TWI <- as(eberg_grid["TWISRT6"], "SpatialPixelsDataFrame")
eberg.md <- spMetadata(eberg_TWI, Target_variable="TWISRT6")
# export to SLD format:
metadata2SLD(eberg.md, "eberg_TWI.sld")
# }
Run the code above in your browser using DataLab