How to set up a deegree 3 WMS with Eclipse
1. Installation
First of all, download the deegree Web Map Service (WMS). Now you have to copy the wms folder to your workspace (e.g. $/home/your-account/workspace/your-wms$).
The folder contents should be:
directory |
Content |
./WEB-INF |
Required by Tomcat, containing all libraries, |
./WEB-INF/classes |
WMS configuration files |
./WEB-INF/conf |
WMS configuration files |
./WEB-INF/data |
Example datasets |
./WEB-INF/libs |
Librarys |
./WEB-INF/web.xml |
|
./index.html |
|
2. Configure Tomcat
Now go to $.../your-tomcat-directory/conf/Catalina/localhost$ and create a new XML-file and write the following in it:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiResourceLocking="false" docBase="/home/your-account/workspace/your-wms/" />
Now you can start your Tomcat.
3. Starting Eclipse
To work on your Projekt in Eclipse, you first have to open Eclipse ;-).
==> "File" ==> "New" ==> "Project..."
A wizard opens. Select
==> "General" ==> "Project" ==> "Next"
In the new window deselect "default location" and enter the path of your wms (e.g. $/home/your-account/workspace/your-wms$).
Hit "Finish" and you're done!
The folder should now be displayed in your "Package Explorer".
4. Configure the WMS
A more detailed explanation of deegree3 WMS configuration is available in the deegree3/WMSConfiguration.
4.1. Import Data
To get your data into the WMS, copy the files into $/WEB-INF/data$.
There are two types of implementing your data, the "Dynamic Layer" and the "Static Layer".
To configure this open up the "wms_configuration.xml" stored in $/WEB-INF/conf/wms$.
4.1.1. Dynamic Layer
The Dynamic Layer automatically loads the data you put in the $/data$ directory.
<wms:UnrequestableLayer>
<wms:Title>Root Layer</wms:Title>
<wms:CRS>EPSG:"your-EPSG"</wms:CRS>
<wms:DynamicLayer>
<wms:ShapefileDirectory>../../data</wms:ShapefileDirectory>
</wms:DynamicLayer>
</wms:UnrequestableLayer>
</wms:ServiceConfiguration>
4.1.2. Static Layer
With the Static Layer you have to specify every single layer in your "wms_configuration.xml".
<wms:UnrequestableLayer>
<wms:Title>Root Layer</wms:Title>
<wms:CRS>EPSG:"your-EPSG"</wms:CRS>
<!-- Shapefile -->
<RequestableLayer>
<Name>datasource-filename</Name>
<Title>your-layer-title</Title>
<ds:ShapefileDataSource>
<ds:File>../../data/your-data.shp</ds:File>
</ds:ShapefileDataSource>
<DirectStyle>
<File>../../data/your-style.xml</File>
</DirectStyle>
</RequestableLayer>
<!-- Shapefile with Dimension (Time, Elevation) -->
<RequestableLayer>
<Name>datasource-filename</Name>
<Title>your-layer-title</Title>
<Dimension isTime="true">
<Property>TIME</Property>
<DefaultValue>2000-01-01T00:00:00Z</DefaultValue>
<MultipleValues>true</MultipleValues>
<NearestValue>true</NearestValue>
<Current>true</Current>
<Extent>2000-01-01T00:00:00Z/2000-01-01T00:01:00Z/PT5S</Extent>
</Dimension>
<ds:ShapefileDataSource>
<ds:File>../../data/your-dimension-file.shp</ds:File>
</ds:ShapefileDataSource>
<DirectStyle>
<File>../../data/your-style.xml</File>
</DirectStyle>
</RequestableLayer>
<!-- Rasterdata -->
<RequestableLayer>
<Name>datasource-filename</Name>
<Title>your-layer-title</Title>
<ds:RasterDataSource crs="EPSG:"your-EPSG"">
<ds:RasterFile fileType="tif">../../data/your-raster.tif</ds:RasterFile>
</ds:RasterDataSource>
<DirectStyle>
<File>../../data/your-style.xml</File>
</DirectStyle>
</RequestableLayer>
</wms:UnrequestableLayer>
</wms:ServiceConfiguration>