Working with GeoServer : Creating Workspaces, Stores & Publishing Layers

GeoServer Workflow



Source of image:

The process shown in the figure above has been explained in the next section.

Creating workspace

A workspace is a container that holds similar layers together. For instance, if one wants to create a University web map, then all the spatial data such as buildings and footpaths ideally should be in one workspace. If the same user wants to create a County web map, then it is advisable to create a new workspace. The name of the workspace must always start with a letter and not contain spaces.

To create a new workspace, follow the following steps:

  1. Click on create workspace

2. Enter the name of workspace and the namespace URI and click Submit.

Creating a store

As the name suggests, a store is used for storing the linkage between the datasets and GeoServer. The datasets can either be in a database such as PostGIS or in a file within the computer. To add a new store, click on Add new store. To remove one or more stores, select the checkbox next to it and click on Remove selected stores.

In this manual we are choosing PostGIS as our data source. Explore other options depending on the location and type of data.

Input the details of the workspace name, the data source name and the connection parameters. Fill in the connection parameters appropriately and click Ok.

Publishing the layer

The next step is publishing the layer so that it can be available through a HTTP request either through WMS/WFS. Click on publish.

Click on find to enter the EPSG code for your coordinate reference system. For WGS 84, the code is 4326

Click on compute from data & Compute from native bounds to compute the bounding box based on your data.

Choose a style for you published data in the Default Style drop-down. I the next section, this manual will guide on how to create a custom style. Click save.

The layer has now been published and ready for preview.

To preview the layer, click on Layer Preview on the left panel.

Choose either of the three platforms for preview. In this manual, we will choose OpenLayers which is a front-end mapping JavaScript mapping library which has been covered in chapter three.

The preview is as shown below.

The next step after publishing your layers is to build a client side platform that will enable users to view the layers. There two JavaScript libraries that are commonly used to achieve this i.e. leaflet and JavaScript. In a later tutorial, i will show how to display layers from GeoServer in OpenLayers

Source of featured image:


Leave A Comment

Your email address will not be published. Required fields are marked *