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.
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
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.