How to setup deegree 3 WPVS
This is a practical oriented HowTo for the setup of a deegree 3 WPVS. It goes step by step with the use of provided sample data. All sources of the sample data are given, so you can follow the HowTo completely on your own.
All the config files are prepared in a git repository on github. They are available from here: https://github.com/cwillmes/wpvs-tutorial
At the moment this tutorial will work precisely only on unix operating systems. Windows users can use this tutorial also but should be aware, every time file/programm pathes and shell scripts are given. The CityGMLConverter tool also works at the moment only on unix systems (because of hardcoded internal pathes, this will be changed with the beta release of the software).
More precise information about the different parameters of the deegree 3 tools etc. used for the setup will be explained in the official deegree 3 documetation or in other resources, for example in the deegree wiki.
1. Checkout from SVN and build deegree 3
Please checkout the deegree3 source from svn and build it, to proceed further. You can refer to the BuildingDeegree3 manual in this wiki for this task.
2. Preparing the Data
For this tutorial, we will prepare a test dataset of the the area of Barcelona (Spain). Barcelona has some nice terrain (good altitude variance of the area - it is quite "hilly"), a good OpenStreetMap coverage and some nice building models on the Google 3D Warehouse, which we will use for this tutorial.
It is necessary for the WPVS, that all geographic data is projected into a metric coordiante system, because our area of interest is within the borders of UTM zone 30N we us the EPSG:23030 for all our input data.
2.1. Coverage
We will use a rendered OpenStreetMap Map as the DEMTextureDataset (Coverage) for the WPVS in this tutorial.
You can download the sample Dataset from here. Or you can create a map like this yourself, it is explained in detail in this tutorial.
To get the data into the deegree 3 WPVS backend, we use the RTBClient tool of the d3toolbox. The following script "prepare-coverage.sh" (which is available from the wpvs-tutorial git repository) shows how the RTBClient is used to do that:
# only adapt the following two lines export D3_TOOLBOX=~/dev/d3/deegree-tools/target/appassembler/bin/d3toolbox export COVERAGE_SRC=~/dev/wpvs-tutorial/SampleData/Coverage/barcelona-osm-map.png # create raster pyramid in 'src/main/webapp/WEB-INF/data/coverage' export TARGET_DIR=src/main/webapp/WEB-INF/data/coverage/osm rm -Rf $TARGET_DIR mkdir -p $TARGET_DIR $D3_TOOLBOX RTBClient -it png -num_levels 4 -ot bin -rl $COVERAGE_SRC -rol $TARGET_DIR -interpolation bl -v -s_srs EPSG:4326 -t_srs EPSG:23030
Note: adjust your pathes D3_TOOLBOX and COVERAGE_SRC according to your computer environment. Be patient, this RTBClient run will take some time, maybe it is time to get a cup of tea or coffee.
2.2. DEM
We will use the freely available SRTM dataset as the DEM of our tutorial dataset.
Download the file srtm_37_04.zip from http://srtm.csi.cgiar.org/, and clip it to the area of the barcelona OSM map, we will use for the coverage. You can find a HowTo describing this task in detail here.
But you can also download directly the already clipped DEM from here.
Run the DEMDatasetGenerator tool on the data (using the script from the wpvs-tutorial git repo):
# only adapt the following two lines export D3_TOOLBOX=~/dev/d3/deegree-tools/target/appassembler/bin/d3toolbox export DEM_SRC=~/dev/wpvs-tutorial/Data_23030/DEM/barcelona_23030_dem.tif # create Multiresolution DEM in 'src/main/webapp/WEB-INF/data/batchedmt' export TARGET_DIR=src/main/webapp/WEB-INF/data/batchedmt rm -Rf $TARGET_DIR mkdir -p $TARGET_DIR $D3_TOOLBOX DEMDatasetGenerator -rl $DEM_SRC -it tif -s_srs EPSG:23030 -o $TARGET_DIR -ol 10 -or 64 -mh 150 -v
Note: adjust your pathes D3_TOOLBOX and DEM_SRC according to your computer environment.
2.3. Buildings
The deegree 3 DataManager tool lets you import CityGML or VRML 3D models into the WPVS backend.
You can consult a tutorial on how to create CityGML models suitable for import with the deegree 3 DataManager tool from here.
The CityGMLConverter tool already imports the CityGML models into the deegree 3 WPVS backend, by using the deegree 3 DataManager tool.
But you can also download the three already converted building CityGML's from here.
If you did not used the CityGMLConverter, you can run the following script (also available from the wpvs-tutorial repo):
# only adapt the following two lines D3_TOOLBOX=~/dev/d3/deegree-tools/target/appassembler/bin/d3toolbox BUILDING_DIR=~/dev/wpvs-tutorial/Data_23030/Buildings TARGET_DIR=src/main/webapp/WEB-INF/data/renderable/buildings rm -Rf $TARGET_DIR mkdir -p $TARGET_DIR INPUT_FILES="$BUILDING_DIR/*.gml" for f in $INPUT_FILES do echo "Processing $f..." $D3_TOOLBOX DataManager -a import -f $f -host org.deegree.services.wpvs.io.file.FileBackend -fbd $TARGET_DIR -t building -ql 2 -mtd 1024x1024 -tt "-925892.424,-4589021.314" -v done
Note: adjust the BUILDING_DIR to the location where you uncompressed the Buildings.zip into, or where your CityGML's may be. Also note, that the building files should have the ".gml" suffix, otherwise adjust the script accordingly.
3. Configuration of the Service
If you used the wpvs-tutorial github repository to go through this tutorial, your service is already properly configured. But in case you made a custom WPVS or if you might want to understand the d3 WPVS configuration, this section will describe how.
3.1. Folder structure of a deegree3 WPVS service
ToDo...
3.2. Configuration Documents
ToDo...
4. Testrun with InteractiveWPVS
Now everything should be ready for a testrun with the InteractiveWPVS tool.
Just run the start.sh script (also available from the wpvs-tutorial repo):
# only adapt the following two lines export LD_LIBRARY_PATH=/home/christian/dev/d3/libs/jogl-1.1.1-linux-amd64/lib export D3_TOOLBOX=~/dev/d3/deegree-tools/target/appassembler/bin/d3toolbox $D3_TOOLBOX InteractiveWPVS -wpvsconfig src/main/webapp/WEB-INF/conf
Note: adjust the pathes to your local JOGL instance.
5. Running the WPVS as a service in Tomcat
ToDo...
hint:
mvn package
For any questions on this tutorial please, contact the author ChristianWillmes, or write to the deegree-users mailinglist.