Book Image

GeoServer Cookbook

By : Stefano Iacovella
Book Image

GeoServer Cookbook

By: Stefano Iacovella

Overview of this book

Table of Contents (17 chapters)
GeoServer Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Uploading and updating styles with REST


In Chapter 3, Advanced Styling, you learned a lot about styles and SLD. You used a very powerful extension, the CSS module, to create styles avoiding the complexity of SLD syntax. There are many options to create SLD, and some users prefer using external tools to manage them.

Whatever you prefer to use to create and edit your styles in order to configure a proper visualization, you should upload them on GeoServer and publish them.

REST offers you two resources to manage styles:

  • /styles

  • /workspaces/<ws>/styles

The former points to styles not associated to a workspace while the latter contains the workspaces with associated styles.

Adding a new style is a routine task if you are going to publish data with REST. We will retrieve an existing style from GeoServer, update it, and then upload it to GeoServer as a new one.

How to do it…

  1. We will use the Capitals style as the template for our new style. Send a request to GeoServer to retrieve it and save...