2. Get deegree WMS up and running

2.1. Download and Archive Extraction

Visit http://deegree.sourceforge.net and download the Web Map Server package appropriate to your platform.

Extract the zip archive (using WinZip or something similar) to your hard disk, e.g.:

Table 1. 

LINUX:/home/deegree or /opt/deegree or /usr/local/deegree
Windows:/program files/deegree

In the remainder of this document, the directory you extracted the zip archive to is referred to as $root_directory.

2.2. Tomcat integration

(Download and install a current release of Tomcat, you also need a JDK 1.4.x installed for this).

The location of deegree's libraries and the central deegree configuration file sample_wms_capabilities.xml must be communicated to the Web Server (in this case Apache Tomcat 4.1.x ). The Tomcat offers several possibilities. An example based on one of these possibilities is following.

First Tomcat needs information about the main directory of the WMS. This has to be realized by adding an additional <Context> tag under the already existing <Host> tag in the server.xml, situated in the conf directory of the Tomcat installation.

<Service>
	<Engine>
		<Host>
			<Context path="/deegreewms"
				docBase="$root_directory/webspace"
				crossContext="false"
				debug="0"
				reloadable="false"/>
			</Host>
	</Engine>
</Service>

The path attribute describes the virtual location of the WMS main directory. Here the WMS is accessible at http://my.server.domain/deegreewms/. The docbase attribute reflects the physical location of the deegree WMS. The other attributes and their values are essential for performance. For further information have a look at the Tomcat documentation included with the installation.

The name of the main directory is arbitrary whereas Tomcat definitely looks for a subdirectory in the root directory named WEB-INF (in capital letters – even on a Windows system). This directory was automatically created after unpacking the zip archive. Here the Deployment-Descriptor (web.xml) is located, that is analysed by the Tomcat to identify the servlets that belong to the application, their names, the parameters that are delivered to the servlets and information about the existing access restrictions.

Before starting the deegree WMS the following data set entry in web.xml is essential:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>

	<servlet>
		<servlet-name>deegreewms</servlet-name>
		<servlet-class>org.deegree_impl.enterprise.WMSServlet</servlet-class>
		<init-param>
			<param-name>capabilities</param-name>
			<param-value>file:///$root_directory/deegreewms/WEB-INF/xml/sample_wms_capabilities.xml</param-value>
		</init-param>
		<init-param>
			<param-name>debug</param-name>
			<param-value>ERRORS_AND_COMMENTS</param-value>
		</init-param>
		<load-on-startup>
                  1
		</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>deegreewms</servlet-name>
		<url-pattern>/wms</url-pattern>
	</servlet-mapping>
</web-app>

In the example web.xml file this entry is already included. You just have to replace $root_directory with the actual directory where deegree is installed on your system

The name of the servlet and java-class, representing the servlet should be indicated in the <servlet> tags. The name is freely selectable. The servlet is located in the library deegree.jar.

The tag <init-param> transfers a parameter that is analysed by the servlet, while initialising. The transferred parameter is the position of the central configuration file. The name of the parameter “capabilities“ is obligatory, name and position of the central configuration file is freely selectable.

The tag <servlet-mapping> defines the alias name for the servlet. In opposition to the shown example it is not necessary that <servlet-name> and <url-pattern> are the same. <url-pattern> is the name for the parameter the servlet will be called through an URL. Combined with the server.xml settings you should be able to point to your WMS via the following URL: http://my.server.domain/deegree/wms?

2.3. Adapting the configuration files

The following figure shows the relationships between the different configuration files that have to be adapted:

Figure 1. deegree configuration files

deegree configuration files

Besides these files, two additional files have to be adapted. These two files are responsible for configuring the local WFS and WCS and are needed for using the example datasets.

In these configuration files, the root directory has to be adjusted to your local installation. The files are:

In $root_directory/WEB-INF/xml:

  • sample_wms_capabilities.xml

  • LOCALWFS_capabilities.xml

  • LOCALWCS_capabilities.xml

  • demo_config.xml

and in $root_directory/deegreewms/WEB-INF/data/raster:

  • gvDesc.xml

2.4. Using the sample data sets

deegree WMS comes with three sample data sets:

  1. the ‘blue lake’ dataset that is used by OGC for testing WMS compliance

  2. the ‘Europe’ dataset comprising a digital elevation model and major cities

  3. ‘Osnabrück’ data set, a free data set of the German city Osnabrück

All of this data is automatically extracted and installed when unpacking deegree WMS.

2.5. Testing the installation

If everything went fine by now, deegree WMS should be running by now with the sample data sets. Try the following request in your web browser:

http://127.0.0.1:8080/deegreewms/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities

This should provide a valid XML Capabilities file (if your browser asks for an application to open the file, try your browser again or any text editor). If this worked fine try a map request:

blue lake

http://127.0.0.1:8080/deegreewms/wms?SERVICE=WMS&Request=GetMap&LAYERS=cite:DividedRoutes,cite:Forests,cite:Buildings,cite:MapNeatline&format=image/png&bbox=-0.005,-0.005,0.005,0.005&styles=default&VERSION=1.1.1&Height=300&Width=400&SRS=EPSG:4326

This request should deliver the following picture:

Figure 2. blue lake map

blue lake map

Europe

http://127.0.0.1:8080/deegreewms/wms?SERVICE=WMS&Request=GetMap&LAYERS=europe:physical,europe:country&format=image/png&bbox=-20.0,35.0,20.0,90.0&styles=default&VERSION=1.1.1&Height=300&Width=400&SRS=EPSG:4326

produces

Figure 3. Europe map

Europe map

Osnabrück

http://127.0.0.1:8080/deegreewms/wms?SERVICE=WMS&Request=GetMap&LAYERS=osnabrueck:strassen,osnabrueck:gewaessepoly,osnabrueck:gewaesserlinien,osnabrueck:gruenpolyl,osnabrueck:sights&format=image/png&bbox=7.93,52.22,8.19,52.34&styles=default&VERSION=1.1.1&Height=300&Width=400&SRS=EPSG:4326

Figure 4. Osnabrück map

Osnabrück map

If all of this worked fine, your deegree WMS is running and you can now add your own data. But let’s first have a brief look at the architecture of deegree WMS.