O'Reilly logo

GeoServer Cookbook by Stefano Iacovella

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and editing data stores with REST

Data stores connect GeoServer to your data. You can't use data that is not supported by GeoServer without a built-in connector or a plugin. Of course, the REST interface supports all operations on data stores. If you plan to automate GeoServer configurations, it is very important to understand how data stores can be created and edited.

The resource exposed is in the following form:

/workspaces/<ws>/datastores

Here, ws stands for the workspace on which the data store is linked.

How to do it…

  1. As usual, you can use the GET operation to retrieve information about which data stores are available in the configuration for a specific workspace. Let's retrieve information in Python:
    >>> myUrl = 'http://localhost:8080/geoserver/rest/workspaces/NaturalEarth/datastores' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required