WPS Client for OpenLayers

Introduction

OpenLayers is an Open Source map viewing library. The library has been written in pure JavaScript. OpenLayers makes it easy to incorporate maps from a variety of sources (i.e. OGC's WMS, WFS,...) into a Web page or application.

The WPS client for OpenLayers is written in JavaScript.

The client can be used inside a local domain or by using a proxy the WPS services can be located outside the HTTP servers domain. The project includes a proxy, which can be run in an servlet container (i.e. Apache Tomcat). An alternative is to use the proxy located in the OpenLayers repository (cqi-bin). The proxy has to be run in the same domain, which provides the Web page or application using the client.

Features

  • The client has been implemented using pure JavaScript.
  • WPS 1.0.0 specification compliant for the implemented parts.
  • The client can access remote domains using a proxy.
  • Possibility to use (switch between) multiple WPS services. However, only one service can be used at a time for the same process call (No gridding wink ).
  • Process calls can run simultaneously (as they are asynchronous). Although, there is currently no reason for this, as only the latest arrived process result will be shown to the user!
  • Processed feature data can be reprocessed.
    • The client includes a new OpenLayers layer, which stores the GML data resulting from a process. The layer extends OpenLayers.Layer.Vector.
    • The previous process has to return the data directly. Reprocessing of referenced data is still unimplemented.
  • Supports GML2 and GML3 as far as OpenLayers does (Simple features with some restrictions).

Functionality

The Execute-operation

  • Implemented using the POST method (XML-encoding).
  • WMS and WFS data is given as a reference to the original source.
    • The area of the map is used to filter the WMS and WFS queries.
    • The CRS of the source layer is attached to the WMS and WFS queries.
    • If the process supports GML2 then by default GML2 data is queried from the WFS.
  • In case of reprocessing, the GML data is given directly to the process.
    • The area of the map is not used -> The result might not show on the map!
  • Supports status.
    • By default the status report is wanted from the process.
    • A new status report is queried every 5 seconds.
    • Automatic termination of status queries based on a static maximum time. Currently the maximum time is 2 minutes from the last update of the status report.
  • The GML data of the process response is converted/transformed to the same CRS as the map layer.
    • To determine the external CRS the first encountered srsName is searched.
  • The results of processes are always shown in the same layer.
    • This could be changed by adding for each process result a new layer, but then the HTML page should include the possibility of removing layers!
  • GML2 schema is the default in the process output format.

The GetCapabilities- and DescribeProcess-operations

  • Implemented using the GET method (KVP-encoding).

Utilities

  • The WPS Execution-operation's request and response texts can be attached to an external HTML text area. This is done via the initialization options of the client. The text areas can be used for demonstration and debugging.

Building

Client

The project needs few JavaScript libraries
Library nameSorted ascending Usage Version License alternatives
OpenLayers The frame of the client 2.6 (Stable) BSD-style lisence
Proj4js Referencing. JavaScript port to the Proj.4 2007-07-09 LGPL
Sarissa XML related operations 0.9.9.4 GNU GPL version 2 or higher, GNU LGPL version 2.1 or higher and Apache Software License 2.0 or higher

Download OpenLayers sources, Sarissa and Proj4.js. Add to the OpenLayers\lib folder sarissa.js and proj4.js (or for instance proj4js-compressed.js).

Download the client from the 52North's SVN. Add from the client's lib folder all files to OpenLayers\lib (Do not change the folder hierarchy). Now build OpenLayers by running OpenLayers\build\build.py.

Add the created OpenLayers.js to a location, which you can refer to from the Web page and include the OpenLayers.js in the Web page's header section. Add the necessary code to initialize OpenLayers and in addition to those controls that you want to use add OpenLayers.Control.WPSClient.

Proxy

To use a proxy define the proxy in the JavaScript code of the Web page. For example like: OpenLayers.ProxyHost = "http://217.152.180.25/wps_proxy?url=";

If you can't or do not want to use the cqi-bin script located in the OpenLayers repository you can use the WPS-Proxy servlet located in the client sources. Building the proxy and using it with Apache Tomcat can done by
  1. Use Maven to compile and install the WPS-Proxy.
  2. Configure the properties file.
    • If necessary change the list of allowed host addresses and ports.
    • The ports are allowed for each host!
    • The default ports include 80 and 8080.
  3. Add the wps_proxy.war to the webapps folder of Apache Tomcat and start Apache Tomcat.

Contributor Guidelines

The sources for the plug-in are hosted on the 52North's SVN server. The sources can be downloaded from here.

Structure

The OpenLayers WPS client is composed of 4 files. These are
  • OpenLayers.Control.WPSClient.js
  • OpenLayers.WPSService.js
  • OpenLayers.WPSServiceContainer.js
  • OpenLayers.Layer.VectorStoringGML.js
It is noted that the client might be necessary to split into smaller JavaScript classes.

Initialization sequence of the WPS client for OpenLayers

WPS's Execution-operations's sequence while using the WPS client for OpenLayers

Known issues

As the project is in incubator stage, there are still several unimplemented parts and unsolved problems
  • Reprocessing
    • Reprocessing of referenced data is still unimplemented. Needs a new layer that extends the OpenLayers.Layer.GML and stores the reference or referenced data.
    • Execute operation handling should check what the schema of processed data is, and if the second process supports the schema.
  • Documentation
    • Some failure situations are unimplemented.
    • Some functions are undocumented.
  • Log
    • Unimplemented.
    • Is this needed? In my opinion is needed for at least debugging (optional).
  • SOAP and WSDL
    • Unimplemented.
  • GetCapabilities- and DescribeProcess-operations
    • POST-method unimplemented
    • A nice feature would be to allow the user to select another method than the default one for testing purposes.
  • Execute-operation's query
    • GET-method has been only partly implemented.
  • getElementsByTagName functions should be changed in several places to getElementsByTagNameNS to take the namespaces into account.
  • LiteralData
    • Units of Measure (UoM) is unimplemented.
    • Continuous values as AllowedValues are unimplemented.
    • Value reference is unimplemented.
  • LiteralOutput
    • Should be tested.
    • None of current processes produce literal output!
  • Monitoring
    • Execute queries should be monitored, but the current WPS specification (version 1.0.0) does not yet allow this as the process queries are not identified.
    • Terminating Execute-calls unimplemented. Needs monitoring.
  • Exception handling
    • Only the latest exception is shown under the inputs in red ... and even that can be overridden by some asynchronous response message!
      • Log or showing multiple info messages is needed.
    • ExceptionReport
      • Should be implemented in a better way.
      • Currently shown to the user using the javaScript alert() method.
  • BoundingBoxData
    • Input & output is unimplemented.
  • Coverage
    • Output is unimplemented.
    • WMS calls should be implemented & tested.
  • Encodings
    • None other than UTF-8 have not been taken into account.
  • Testing, testing, testing, …

Suggested enhancements

Examples / Screenshots

OpenLayers interface with road vectors before running any operations

Roads after running the buffering with a distance of 15 meters

Roads (in red) after the Douglas Peucker simplification algorithm (Tolerance 15 meters)

The client control opened and btw. a road seems to go through my apartment big grin

-- JanneKovanen - 18 Jun 2008
Topic revision: r4 - 11 Jun 2013, EikeJuerrens
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