Lecture on Geo-processing using WPS - Additional material


Introduction

Hands-on material for Geo-processing using WPS.

Preparations

The tasks that are described in this turorial can best be performed using the OSGeoLive DVD 9.5.

The minimum software requirements for this turorial are:
  • A servlet container, e.g. Tomcat
  • A 52°North WPS (Download)
  • A GeoServer (Download)
  • Additional data and software (Download)
Just set up the servlet container and deploy the services. For this tutorial, you can leave the default settings (e.g. admin-accounts). Now you are ready to perform the basic task described in this tutorial.

For the other tasks, additional software is required (see above). If you are using the OSGeoLive DVD, download the data and execute the command sh commands.sh

Save process result in GeoServer instance

This is described in the OSGeo Live DVD Quickstart:

http://live.osgeo.org/en/quickstart/52nWPS_quickstart.html

Upload Java prozess

Open the WPS Admin Console: http://localhost:8080/52nWPS/webAdmin/index.jsp

Username: wps
Password: wps

Click on the button Upload Process

Paste the following text in the upper textfield:

org.n52.wps.server.algorithm.jts.JTSBufferAlgorithm

Upload_process2.png

Click on Browse and open the JTSBufferAlgorithm.java file (TODO, beschreiben, wo es liegt):

Upload_process3.png

Click on Submit Query, the process will now be uploaded and compiled. Open in the Admin Console the tab Algorithm Repositories and scroll to LocalAlgorithmRepository.

2015-03-11-045505_800x600_scrot.png

Add the new process add.png.

2015-03-11-045522_800x600_scrot.png

Click the save button save.png. Now Click on Save and Activate Configuration at the top of the Admin Console.The process now will be activated.

Test uploaded process

Now you can test the new process. Open the OpenLayers-Example:

http://localhost:8080/openlayers-example/wps.html

2015-03-11-045651_800x600_scrot.png

The JTSBufferAlgorithm should appear in the process-list. Choose it.

2015-03-11-045800_800x600_scrot.png

Now create a geometry in the OpenLayers-map.

2015-03-11-045837_800x600_scrot.png

Select the geometry (Click on the pencil-symbol on the right and then on the geometry).

Click in the data-textbox. The geometry should appear there in the WKT-format. Fill in the other inputs, endCapStyle and distance (in meters) are mandatory.

2015-03-11-045900_800x600_scrot.png

After a click on Execute the buffered geometry should appear on the map.

2015-03-11-045909_800x600_scrot.png

Setup R backend

Open the console: LXTerminal.png Execute the following commands:
sudo R

Password: user

install.packages("Rserve")

Choose a mirror

InstallRserve.png

install.packages("sos4R")

install.packages("xts")

library(Rserve)

Rserve()

Open the WPS Admin Console: http://localhost:8080/52nWPS/webAdmin/index.jsp

Nutzername: wps
Passwort: wps

Expand the Algorithm Repositories tab and scroll to!LocalRAlgorithmRepository.

RRepo.png

Check Active. After a click on Save and Activate Configuration the WPS will be restarted. Now the WPS4R processes are available.

Request the capabilities of the WPS, the R processes should be shown:

http://localhost:8080/52nWPS/WebProcessingService?Request=GetCapabilities&Service=WPS

You can have a closer look at e.g. the process org.n52.wps.server.r.demo.timeseriesPlot:

http://localhost:8080/52nWPS/WebProcessingService?request=DescribeProcess&service=WPS&version=1.0.0&identifier=org.n52.wps.server.r.demo.timeseriesPlot

The underlying R script can be viewed here:

http://localhost:8080/52nWPS/R/scripts/demo_timeseries-plot.R

Open the R timeseries demo:

http://localhost:8080/52nWPS/R/demo/ImageRendering.html

A click on "create time series plot" requests the PegelOnline SOS and creates a diagram that shows the waterlevel and a fitted regression line.

2015-03-11-052209_800x600_scrot.png

Setup GRASS 7 backend

Open the WPS Admin Console: http://localhost:8080/52nWPS/webAdmin/index.jsp

Nutzername: wps
Passwort: wps

Expand the tab Algorithm Repositories and scroll t GrassRepository. Check Active and modify the properties of the repository as follows:

  • Property "GISRC_Dir" = /home/user/grassdata/.grassrc70
  • Property "Grass_Home" = /usr/lib/grass70
  • Property "ModuleStarter_Home" = /home/user/wps-grass-bridge-patched/gms
  • Property "Python_Home" = /usr/bin
  • Property "Python_Path" = /usr/lib/python2.7
  • Property "TMP_Dir" = /tmp/grass_tmp
GrasRepo.png

After a click on Save and Activate Configuration the WPS will be restarted. Now the GRASS 7 processes are available.

Execute GRASS 7 WPS process with QGIS

Start QGIS and open the file elev_srtm_30m.tif that you can find in the downloaded zip-file.

2015-03-11-052954_800x600_scrot.png

Click the menu item Plugins -> Manage and Install Plugins...

QGIS8.png

Install the WPS Client Plugin

QGIS2.png

The WPS Client Plugin should appear left in QGIS. If not, click the menu item Web -> WPS-Client -> WPS-Client.

QGIS3.png

Click on connect. Then click on New to add a WPS Server.

Name e.g.: 52nWPS

URL: http://localhost:8080/52nWPS/WebProcessingService

2015-03-11-053045_800x600_scrot.png

Click Ok and then Connect. The processes of the WPS should be shown.

QGIS7.png

Choose the r.watershed process, A double-click will open the following dialog:

2015-03-11-053359_800x600_scrot.png

Use elev_srtm_30m as input for elevation. Set the other raster inputs (depression, flow, disturbed_land, blocking) to <None>. Use e.g. 1000 for the threshold. Set all process outputs exept basin to <None>.

A click on Run starts the WPS process.

2015-03-11-053432_800x600_scrot.png

This topic: Geoprocessing > WebHome > GeoprocessingUsingWPSMaterial
Topic revision: 11 Apr 2016, BenjaminPross
Legal Notice | Privacy Statement


This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Wiki? Send feedback