GRASS logo

NAME

r.geoserver.style - Publishes a map style based on GRASS GIS map and attaches it to a layer in GeoServer.

KEYWORDS

geoserver-grass-datastore, raster, temporal, geoserver

SYNOPSIS

r.geoserver.style
r.geoserver.style --help
r.geoserver.style [-n] host=string port=string user=string password=string workspace=string layername=string [grassmap=string] [type=string] [--help] [--verbose] [--quiet] [--ui]

Flags:

-n
Prevent to set 0 as nodata value in SLD
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

host=string [required]
GeoServer host including URI scheme
port=string [required]
GeoServer port
user=string [required]
GeoServer user
password=string [required]
GeoServer password
workspace=string [required]
GeoServer workspace
layername=string [required]
Layername
grassmap=string
GRASS map to use style from (only required if grass gis raster datastore plugin is not used)
type=string
Data set type of input
Options: raster, strds, auto
Default: auto

Table of contents

DESCRIPTION

r.geoserver.style is a GRASS GIS addon Python script to publish a style based on GRASS GIS map and attach to layer with geoserver-grass-datastore store. The module uses the GeoServer REST API.

For space time raster data sets the first map is taken to set the style for all raster maps in the space time raster data set.

EXAMPLES

Publish raster map to GeoServer

Publish elevation map to GeoServer and set the style:
# publish layer
r.geoserver.publish input=elevation \
  host=http://geoserver port=8080 user=admin password=geoserver \
  workspace=spieltag coveragestore=elevation layername=elevation \
  gs_file_path=/grassdb/nc_spm_08/PERMANENT
# set style (applies current map color table)
r.geoserver.style host=http://geoserver port=8080 user=admin password=geoserver \
  workspace=spieltag layername=elevation

Publish space time raster data set to GeoServer

Publish MODIS LST space time raster data to GeoServer and set style (a mapset with the example mapset of the MODIS data is available here: nc_spm_mapset_modis2015_2016_lst.zip):
# publish layer
r.geoserver.publish input=LST_Day_monthly \
  host=http://geoserver port=8080 user=admin password=geoserver \
  workspace=spieltag coveragestore=modis_lst_strds layername=LST_Day_monthly \
  gs_file_path=/grassdb/nc_spm_08_grass7/modis_lst
# set style (applies color table of first map)
r.colors MOD11B3.A2015001.h11v05.single_LST_Day_6km color=bcyr
r.geoserver.style host=http://geoserver port=8080 user=admin password=geoserver \
  workspace=spieltag layername=LST_Day_monthly

Publish raster map to GeoServer without geoserver-grass-datastore

It is also possible to publish and style a raster map to a GeoSever without geoserver-grass-datastore. In this case, a GeoTIFF raster is exported by r.out.geoserver and used to create a new GeoServer coveragestore. The grassmap parameter is then required in r.geoserver.style to export the style from a given map in the current GRASS GIS session.
# publish layer
r.out.geoserver input=elevation \
  host=http://geoserver port=8080 user=admin password=geoserver \
  workspace=spieltag layername=elevation title=some_title \
  outputfolder=/mnt/geoserverdata geoserver_path=/opt/geoserver_data
  gs_file_path=/grassdb/nc_spm_08/PERMANENT

# set style (applies current map color table)
r.geoserver.style host=http://geoserver port=8080 user=admin password=geoserver \
  workspace=spieltag layername=elevation grassmap=elevation

SEE ALSO

r.out.gdal, r.out.geoserver, r.geoserver.publish, r.out.geoserver

AUTHORS

Anika Weinmann and Carmen Tawalika, mundialis

SOURCE CODE

Available at: r.geoserver.style source code (history)

Accessed: Monday Jul 27 12:29:22 2026


Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2026 GRASS Development Team, GRASS 8.5.1dev Reference Manual