[OpenLayers-Commits] r11931 - in sandbox/bartvde/wps/openlayers: lib/OpenLayers/Format tests/Format

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Fri Apr 29 08:32:42 EDT 2011


Author: bartvde
Date: 2011-04-29 05:32:41 -0700 (Fri, 29 Apr 2011)
New Revision: 11931

Modified:
   sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/WPSDescribeProcess.js
   sandbox/bartvde/wps/openlayers/tests/Format/WPSDescribeProcess.html
Log:
add support for BoundingBoxData

Modified: sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/WPSDescribeProcess.js
===================================================================
--- sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/WPSDescribeProcess.js	2011-04-29 12:24:52 UTC (rev 11930)
+++ sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/WPSDescribeProcess.js	2011-04-29 12:32:41 UTC (rev 11931)
@@ -134,6 +134,16 @@
                 this.readChildNodes(node, input);
                 dataInputs[input.identifier] = input;
             },
+            "BoundingBoxData": function(node, input) {
+                input.boundingBoxData = {};
+                this.readChildNodes(node, input.boundingBoxData);
+            },
+            "CRS": function(node, obj) {
+                if (!obj.CRSs) {
+                    obj.CRSs = {};
+                }
+                obj.CRSs[this.getChildValue(node)] = true;
+            },
             "LiteralData": function(node, input) {
                 input.literalData = {};
                 this.readChildNodes(node, input.literalData);
@@ -143,16 +153,19 @@
                 this.readChildNodes(node,  input.complexData);
             },
             "Default": function(node, complexData) {
-                complexData["default"] = {formats: {}};
+                complexData["default"] = {};
                 this.readChildNodes(node,  complexData["default"]);
             },
             "Supported": function(node, complexData) {
-                complexData["supported"] = {formats: {}};
+                complexData["supported"] = {};
                 this.readChildNodes(node,  complexData["supported"]);
             },
             "Format": function(node, obj) {
                 var format = {};
                 this.readChildNodes(node, format);
+                if (!obj.formats) {
+                    obj.formats = {};
+                }
                 obj.formats[format.mimeType] = true;
             },
             "MimeType": function(node, format) {

Modified: sandbox/bartvde/wps/openlayers/tests/Format/WPSDescribeProcess.html
===================================================================
--- sandbox/bartvde/wps/openlayers/tests/Format/WPSDescribeProcess.html	2011-04-29 12:24:52 UTC (rev 11930)
+++ sandbox/bartvde/wps/openlayers/tests/Format/WPSDescribeProcess.html	2011-04-29 12:32:41 UTC (rev 11931)
@@ -4,7 +4,7 @@
     <script type="text/javascript">
 
     function test_read_WPSDescribeProcess(t) {
-        t.plan(15);
+        t.plan(16);
 
         var parser = new OpenLayers.Format.WPSDescribeProcess();
         var text =
@@ -134,6 +134,59 @@
         t.eq(result.complexOutput["default"].formats["text/xml; subtype=gml/3.1.1"], true, "processOutputs default format read correctly");
         t.eq(result.complexOutput["supported"].formats["text/xml; subtype=gml/3.1.1"], true, "processOutputs supported format read correctly [1/2]");
         t.eq(result.complexOutput["supported"].formats["application/wkt"], true, "processOutputs supported format read correctly [1/2]");
+
+        text = '<?xml version="1.0" encoding="UTF-8"?>' +
+'<wps:ProcessDescriptions service="WPS" version="1.0.0" xmlns:wps="http://www.opengis.net/wps/1.0.0"' +
+'    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en"' +
+'    xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd"' +
+'    xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink">' +
+'    <ProcessDescription wps:processVersion="1.0.0" statusSupported="false"' +
+'        storeSupported="false">' +
+'        <ows:Identifier>gt:VectorToRaster</ows:Identifier>' +
+'        <ows:Title>Rasterize features</ows:Title>' +
+'        <ows:Abstract>Rasterize all or selected features in a FeatureCollection</ows:Abstract>' +
+'        <DataInputs>' +
+'            <Input maxOccurs="1" minOccurs="0">' +
+'                <ows:Identifier>bounds</ows:Identifier>' +
+'                <ows:Title>Bounds</ows:Title>' +
+'                <ows:Abstract>Bounds of the area to rasterize</ows:Abstract>' +
+'                <BoundingBoxData>' +
+'                    <Default>' +
+'                        <CRS>EPSG:4326</CRS>' +
+'                    </Default>' +
+'                    <Supported>' +
+'                        <CRS>EPSG:4326</CRS>' +
+'                    </Supported>' +
+'                </BoundingBoxData>' +
+'            </Input>' +
+'        </DataInputs>' +
+'        <ProcessOutputs>' +
+'            <Output>' +
+'                <ows:Identifier>result</ows:Identifier>' +
+'                <ows:Title>Result</ows:Title>' +
+'                <ComplexOutput>' +
+'                    <Default>' +
+'                        <Format>' +
+'                            <MimeType>image/tiff</MimeType>' +
+'                        </Format>' +
+'                    </Default>' +
+'                    <Supported>' +
+'                        <Format>' +
+'                            <MimeType>image/tiff</MimeType>' +
+'                        </Format>' +
+'                        <Format>' +
+'                            <MimeType>application/arcgrid</MimeType>' +
+'                        </Format>' +
+'                    </Supported>' +
+'                </ComplexOutput>' +
+'            </Output>' +
+'        </ProcessOutputs>' +
+'    </ProcessDescription>' +
+'</wps:ProcessDescriptions>';
+
+        res = parser.read(text);
+        var vector2Raster = res.processDescriptions["gt:VectorToRaster"];
+        t.eq(vector2Raster.dataInputs["bounds"].boundingBoxData["default"].CRSs["EPSG:4326"], true, "BoundingBoxData CRS parsed correctly");
     }
 
     </script>



More information about the Commits mailing list