Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following:

 var popProto = new OpenLayers.Protocol.WFS({
    url:  WFS_HOST,
    version: "1.1.0",
    featureType: layerName,
    featureNS: namespace,
    srsName: "EPSG:4326",
    propertyNames: ["grid_code"],
    defaultFilter: popFilter

which I wish to convert to GML so that I can chain it to a WPS request. I've been looking around for sometime, but I can't get a way out. Any suggestions on how I can convert this to GML format will be appreciated very much.

UPDATE: Below is my attempt so far:

function createWPSExecuteRequest(namespace, layerName, popFilter) {
    var request = OpenLayers.Format.XML.prototype.write(new OpenLayers.Format.WPSExecute().writeNode('wps:Execute', {
        identifier: 'gs:Aggregate',
        dataInputs: [{
            identifier: 'features',
            reference: {
                mimeType: 'text/xml',
                href: WFS_HOST,
                method: 'POST',
                body: {
                    wfs: {
                        featureType: layerName,
                        version: '1.1.0',
                        featureNS: namespace,
                        srsName: "EPSG:4326",
                        propertyNames: ["grid_code"],
                        defaultFilter: popFilter
            identifier: 'aggregationAttribute',
            data: {literalData: 'grid_code'}
            .....more inputs here....
        responseForm: {
            rawDataOutput: {
                identifier: 'result'

    return request;

But the identifier: 'aggregationAttribute' and defaultFilter: popFilter is not being included in the generated GML. Anything I may be doing wrong?

share|improve this question
may be useful for you… – Sunil Feb 22 '13 at 10:27

If you look at the response in firebug you will see that WFS responds all the features in GML format.

If you just want the GML and not the openlayers features call the WFS (WFS_HOST) rest service directly. much of the response is in GML.

share|improve this answer
I want to convert the request to GML, not the response. In GML, I can easily chain it to a WPS request, and send both as one request. – okello Jul 27 '12 at 5:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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