Skip to content

r.colors.out_sld

Exports the color table associated with a raster map layer in SLD format.

r.colors.out_sld [-n] map=name [style_name=string] [output=name] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.colors.out_sld map=name

grass.script.run_command("r.colors.out_sld", map, style_name="GRASS GIS color table", output="-", flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.colors.out_sld", map="name")

Parameters

map=name [required]
    Name of raster map
style_name=string
    Name for style
    A name for the style which might be displayed on the server
    Default: GRASS GIS color table
output=name
    Name for output SLD rules file
    "-" to write to stdout
    Default: -
-n
    Propagate NULLs
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

map : str, required
    Name of raster map
    Used as: input, raster, name
style_name : str, optional
    Name for style
    A name for the style which might be displayed on the server
    Default: GRASS GIS color table
output : str, optional
    Name for output SLD rules file
    "-" to write to stdout
    Used as: output, file, name
    Default: -
flags : str, optional
    Allowed values: n
    n
        Propagate NULLs
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

The module r.colors.out_sld exports the colors of a raster map into the Styled Layer Description (SLD) format according to OGC standard.

For raster maps of type CELL also labels are exported. The export of labels requires that the input map is entirely read and may thus take a bit longer than the export of continuous color rules (ramp).

Only if the flag n is given, the NaN values are written into the generated SLD file which leads e.g. in GeoServer to an error when using such SLD.

Currently only SLD v1.0.0 is implemented.

EXAMPLES

# Exporting a color ramp
r.colors.out_sld map=testmap style_name=Celsius

SEE ALSO

r.colors.out

REFERENCES

https://www.ogc.org/standard/sld

AUTHORS

Hamish Bowman
Stefan Blumentrath, Norwegian Institute for Nature Research, Oslo, Norway

SOURCE CODE

Available at: r.colors.out_sld source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819