GEOSS Banner

Section 4.3.2 Offering data with geoserver

We are going to illustrate in detail and step by step two cases: How to publish a single GeoTIFF image on your GeoServer and How to publish a GeoTIFF mosaic scene on your GeoServer.

GeoServer can be downloaded from IN this example we are going to use the version 2.1.1.

Before starting, if you do not have the GeoServer set up as a service you need to start it manually. To do so, go to the Start>Programs> GeoServer2.1.1>Start GeoServer. A DOS window will open (and should be kept open) indicating that GeoServer has started and it is running.

Go to the GeoServer Administration link in the Start Menu (GeoServer Web Admin Page) or point your web browser to http://localhost:8080/geoserver. This page is the Web administration interface, which is used to configure all aspects of the GeoServer, and add data to tweaking services settings.

This documentation is directly coming from the GeoServer website ( Case 1: How to setup GeoServer

Step 1: GeoServer Installation

Related documentation (for installation on Linux, Mac, or using WAR file):

System requirements

GeoServer can run either on MS Windows, Linux or Mac OS X.

Some general system requirements for the software to run without problems are listed: Processor: 2 GHz or higher Memory (RAM): 1 GB or higher

Disk Space: 200 MB minimum. However, it is suggested to have a minimum of 1 GB of free disk space. Additional space is required depending on the amount of spatial data that you expect to upload.

Other Software requirements: A Java Runtime Environment (JRE 1.5.0). For server installations, Apache Tomcat can be used instead of Jetty and McKoiDB respectively.

1. Installation

In order to install de GeoServer, firstly the Installation of Java Developement Kit has to be done

Latest version can be found at:


1. Select Download Java Platform (JDK) 7


Here you need to select your file description, that is to say which java you need according to your system (windows x86,…). When the option to download is selected, a new http page will open for you to register:


2. Run the executable file you downloaded.

3. Accept the license agreement and click “Next”

4. A “Custom Setup” screen will open, and then all optional features can be selected. 5. Click “Next”.

6. Once the Disable the Public Java Runtime Environment (JRE)


When your installation is completed click “Finish”.

Registration of your program can be done at:



Download GeoServer

1. Now we are ready to download GeoServer

Go to the download page and get the latest Stable release:


And download the format that best fits you. In our case this will be Windows Installer. It can take some time for the Download to start transferring the geoserver executable


In our case, download the “Windows Installer”.

2. Run the Installer
1. To run the installer, double click the geoserver executable that has just been downloaded.



Click into the “Next” button.



Read the GPL license and click I Agree

Choose your install location and click Next, you can leave it in the default directory or change it into another one you prefer.



3. Choose the name of the Start Menu Folder and click “Next”. Usually this is left to its default value.



4. Define the path to your JDK install directory by browsing, and click “Next”.



5. The next window asks where your GeoServer Data Directory is. If this is your first time installing GeoServer, just leave it as Default and click “Next”. If you have a previous version of the GeoServer installed, and you want to use your existing data directory, enter the path to the existing Data Directory. Click “Next”.





6. Define user name and Password for an administrator account. You can leave the default values (username: admin, password: geoserver)


7. The next window allows you to select the port number on which GeoServer will run. You can leave it as it is (port: 8080).



8. The following window request us which kind of installation are we going to do. In our case we are going to Run it Manually



9. Finally, a window Ready to Install opens for you to install the GeoServer



10. When the installation of GeoServer is completed the following window appears:



At this point you must have Java DK installed and GeoServer Installed. The Geoserver should be seen as a short cut in your Start Menu.

Step 2. Starting GeoServer

1. Before starting GeoServer, the following environment variables have to be defined: JAVA_HOME and GEOSERVER_HOME. These are the paths to the JDK and GeoServer install directories.

2. You have to go to Start/Settings/Control panel/System, and click the “Advanced” tab. Then click on the “ Environment vaiables” button.



3. Under “User Variables”, click on New and define your JAVA_HOME variable and then your GEOSERVER_HOME.



4. Go to Start/Programs/GeoServer 2.1.1/Start GeoServer. A DOS window will open (and stay open) indicating that GeoServer has started.


5. After starting up the program, the administrator interface should be available through the GeoServer Administration link in the Start Menu or by pointing your web browser to http://localhost:8080/geoserver/web/

For insights on the Web Administration Interface, please refer to: Case 2: Offering a shapefile with geoserver WFS

Step 1: Setup a Shapefile

We are going to publish a coverage that is related to the Arctic layers that we previously used in the definition of the data model section.

First, you have to create a new namespace:


We will name it "arctic"


Now, we are going to create a data store to include the arctic shape files that we have previously downloaded from the atlas of the cryosphere.

In our case, the idea is to publish the following data:



Before completing the following form, we have to copy the Shapefiles to the right folder. In our case, the default installation folder is called: C:\Program Files\GeoServer 2.0.1\data_dir\data\shapefiles. Remember that you have to copy at least the *.shp. *.dbf, *.shx, and also the *.prj, when available. In our case, these are the files we copied:



Now, we are able to fill the remaining fields of the form. In the Connection Parameters URL we introduced the full path and name of the file with .shp extension. After completing the form, we can click on “Save”



The following screen will appear:



Press publish and another form will appear to enter the CRS and the bounding boxes.



Once you press “Save”, you will see:



In theory, your data is ready to be seen in your WFS service.

Step 2: Test your data

Testing the layer in GeoServer is very simple, because it incorporates tools to do that. In the Layer preview section, it is possible to test the WFS service by selecting the right layer and choosing the right service and format:


This way GeoServer generates a WFS request that automatically retrieves the dataset in GML3 format. In our case, it has generated http://localhost:8080/geoserver/ows?...ormat=text/xml; subtype=gml/3.1.1

and we have got the whole polygon dataset as an XML file.

Also, in the Gaia v.3 application we can choose tools|add layer and then select the button with a "plus" symbol. Now we must indicate the name of the service (you can provide any name) and the URL of the GeoServer (by default: http://localhost:8080/geoserver/ows).



After pressing ok, you will be able to select the cryosphere layer and the version of GML to use.



and this is the result:


image81.png Case 3: Offering a PostGIS table with geoserver WFS

Step 1: Setup a PostGIS data

Create a new data store

The first step is to create a data store for the PostGIS database “nyc”. The data store tells GeoServer how to connect to the database.

1. In a web browser navigate to http://localhost:8080/geoserver.

2. Navigate to Data Stores.



Adding a New Data Source

3. Create a new data store by clicking the PostGIS link.

4. Keeping the default Workspace enter Basic Store Info of Name and Description.



Basic Store Info

5. Specify the PostGIS database Connection Parameters




Name of the workspace to contain the database. This will also be the prefix of any layer names created from tables in the database.

Data Source Name

Name of the database. This can be different from the name as known to PostgreSQL/PostGIS.


Description of the database/store.


Enables the store. If disabled, no data in the database will be served.


Type of database. Leave this value as the default.


Host name where the database exists.


Port number to connect to the above host.


Name of the database as known on the host.


Schema in the above database.


User name to connect to the database.


Password associated with the above user.


Namespace to be associated with the database. This field is altered by changing the workspace name.

max connections

Maximum amount of open connections to the database.

min connections

Minimum number of pooled connections.

fetch size

Number of records read with each interaction with the database.

Connection timeout

Time (in seconds) the connection pool will wait before timing out.

validate connections

Checks the connection is alive before using it.

Loose bbox

Performs only the primary filter on the bounding box. See the section on Using loose bounding box for details.


Enables prepared statements.

6. Note The username and password parameters specific to the user who created the postgis database. Depending on how PostgreSQL is configured the password parameter may be unnecessary.



Connection Parameters

7. Click the Save button

Layer Configuration

1. Navigate to Data‣Layers.

2. Select Add a new resource button.

3. From the New Layer chooser drop down menu, select cite:nyc_buidings.



New Layer drop down selection

On the resulting layer row, select the Layer name nyc_buildings.



New Layer row

4. The following configurations define the data and publishing parameters for a layer. Enter the Basic Resource Info for nyc_buildings. 



Basic Resource Info

5. Generate the database bounds by clicking the Compute from data and then Compute from Native bounds. 



Generate Bounding Box

6. Set the layer’s style by first moving over to the Publishing tab.

7. Then select polygon from the Default Style drop down list.



Select Default Style

8. Finalize your data and publishing configuration by scrolling to the bottom and clicking Save.

Preview the Layer

9. In order to verify that the nyc_building is published we will preview the layer. Navigate to the Map Preview and search for the cite:nyc_buildings



Layer Preview

10. Click on the OpenLayers link under the Common Formats column.

Success! An OpenLayers map should load with the default polygon style.



OpenLayers map of nyc_buildings

Step 2: Test your WFS Service in clients

You can test WFS service in various clients. In our case we will show how to access a WFS Service in uDig (

We asume that uDig is installed on the computer.

Getting started

1. After completing the installation, run the uDig application from the Windows Start > Programs menu.



2. Initially you are presented with the welcome screen.

3. The welcome screen contains a link to the Getting Started tutorial from the online documentation and a link to the Official Website.



4. To continue click on the Workbench arrow in the top right corner of the uDig welcome screen.

5. You are now ready to start to work with uDig.



Start uDig, under the File menu select New > New Map to create a new map.

Make sure your local GeoServer is started and ready to go.

Select Layer > Add
This will bring up a Wizard allowing you to choose which Data source you want to use.Select Web Feature Server.



This open a window where you have to insert the URL of a web feature server you want to access. In our case type: http://localhost:8080/geoserver/wfs? and click Next.


You have now access to all WFS layers available on our GeoServer. Select Manhattan (NY) landmarks and the press the Finish button. The layer will be drawn on your map.



Accessing the service

7. Start uDig, under the File menu select New > New Map to create a new map.

8. Make sure your local GeoServer is started and ready to go.

9. Select Layer > Add

10. This will bring up a Wizard allowing you to choose which Data source you want to use.Select Web Feature Server.



11. This open a window where you have to insert the URL of a web feature server you want to access. In our case type: http://localhost:8080/geoserver/wfs? and click Next.



12. You have now access to all WFS layers available on our GeoServer. Select Manhattan (NY) landmarks and the press the Finish button. The layer will be drawn on your map.


image99_2.PNG Step 6: Updating data

In Step 3 we have accessed a WFS layer. Now we can show the editing (transactional) capabilities of a WFS service.

1. Select Navigation > Show All from the menu bar.

11. Zoom to a specific buffer

12. Select Manhattan (NY) landmarks in the Layers view.

13. Choose to the Edit Geometry tool from the tool bar


14. Use the Edit Geometry tool to select a buffer. The buffer will change color and develop “vertex handles”.

15. Move the vertex handles as you want.

16. Once finished, press the Commit Changes button in the tool bar to send your changes off to the Web Feature Server.


Your changes have been registered. Step 7: Optimizing the service performance and maintenance

To optimize service performance various considerations must be taken into account.

An interesting paper discuss these issues:

Java consideration

Container consideration

Configuration consideration

Data considerations

Other Step 8: Service errors and troubleshooting

Please refer to: Step 9: Register the service with GEOSS

This step is related to the CSR tutorial -> make a link to it.

<<Prev T.O.C.  Next>>

Files (0)

You must login to post a comment.