Learn R Programming

plotKML (version 0.8-3)

metadata2SLD.SpatialPixels: Writes a Styled Layer Description (SLD) file

Description

Writes a Styled Layer Description (SLD) file, that can be attached to a spatial layer contributed to GeoServer.

Usage

metadata2SLD.SpatialPixels(obj, 
    Format_Information_Content = xmlValue(obj@xml[["//formcont"]]),
    obj.name = normalizeFilename(deparse(substitute(obj))), 
    sld.file = .set.file.extension(obj.name, ".sld"),
    Citation_title = xmlValue(obj@xml[["//title"]]), 
    ColorMap_type = "intervals", opacity = 1, 
    brw.trg = 'Greys', target.var, …)

Arguments

obj

object of class "SpatialMetadata"

Format_Information_Content

character; class of the object to be written to SLD file

obj.name

character; name of the layer

sld.file

character; name of the output file

Citation_title

character; title of the layer

ColorMap_type

character; type of the colorMap see https://docs.geoserver.org

opacity

logical; specifies the opacity

brw.trg

character; color scheme according to www.colorbrewer2.org; default to 'Greys'

target.var

character; target variable used to calculate the class-intervals

additional arguments

See Also

spMetadata

Examples

Run this code
# 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