Web App Development

Setting the default style of a GeoServer layer with gsConfig

The gsconfig layer classes have a _set_default_style method, after that Catalog.save commits the change:
# The last two arguments are the geoserver username and password
cat = Catalog("http://localhost:8080/geoserver/rest", "admin", "geoserver")
layer = cat.get_layer("layer_name")
layer._set_default_style("style_name")
cat.save(layer)

Comments


Follow me on Twitter