I have generated the WPS request below using GeoServer's WPS Request Builder. I wish to append more parameters to this request (geometry selection), and then send it either using GET or POST from within my OpenLayers JavaScript code. I can't seem to get information on how this can be done. How can I append geometry selection parameter to the request, and how can I send the request using OpenLayers? Any assistance will highly appreciated.

<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
      <wps:Reference mimeType="text/xml; subtype=wfs-collection/1.0" xlink:href="http://geoserver/wfs" method="POST">
          <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2">
            <wfs:Query typeName="learning_workspace:pop_layer"/>
    <wps:RawDataOutput mimeType="text/xml">

My environment: GeoServer 2.1.3, OpenLayers 2.11, PostGIS 1.5.

1 Answer 1


Incorporate filters within the <wfs:Query><wfs:Query/> section in a <Filter></Filter>. The format of the filter is dependent on its type. More info on filters and examples is available here and here.

As for requests, I used OpenLayers' POST method to send request, as illustrated below:

var request = new OpenLayers.Request.POST({
        url: WPS_HOST,
        data: wpsRequestData,
        headers: {
            "Content-Type": "text/xml;charset=utf-8"
        callback: function (response) {
            //read the response from GeoServer
            var gmlParser = new OpenLayers.Format.GML();
            var xmlSum = gmlParser.read(response.responseText);
            // TODO: More operations here
        failure: function (response) {
            alert("Something went wrong in the request");

I hope this will be of help to someone.

  • can you give example in openlayers 3..?
    – Priyanka
    Jun 29, 2017 at 8:56
  • @Priyanka I too waiting for the ol3 example for the WPS request builder Please share if u have the code my mail id is [email protected]
    – user28536
    Feb 22, 2018 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.