diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index 2e5e1bb7ac..1d95ad98de 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -316,6 +316,7 @@ "OpenLayers/Format/WMC/v1.js", "OpenLayers/Format/WMC/v1_0_0.js", "OpenLayers/Format/WMC/v1_1_0.js", + "OpenLayers/Format/WCSGetCoverage.js", "OpenLayers/Format/WMSCapabilities.js", "OpenLayers/Format/WMSCapabilities/v1.js", "OpenLayers/Format/WMSCapabilities/v1_1.js", diff --git a/lib/OpenLayers/Format/WCSGetCoverage.js b/lib/OpenLayers/Format/WCSGetCoverage.js new file mode 100644 index 0000000000..ecc6989807 --- /dev/null +++ b/lib/OpenLayers/Format/WCSGetCoverage.js @@ -0,0 +1,198 @@ +/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the Clear BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the + * full text of the license. */ + +/** + * @requires OpenLayers/Format/XML.js + */ + +/** + * Class: OpenLayers.Format.WCSGetCoverage version 1.1.0 + * + * Inherits from: + * - + */ +OpenLayers.Format.WCSGetCoverage = OpenLayers.Class(OpenLayers.Format.XML, { + + /** + * Property: namespaces + * {Object} Mapping of namespace aliases to namespace URIs. + */ + namespaces: { + ows: "http://www.opengis.net/ows/1.1", + wcs: "http://www.opengis.net/wcs/1.1", + xlink: "http://www.w3.org/1999/xlink", + xsi: "http://www.w3.org/2001/XMLSchema-instance" + }, + + /** + * Property: regExes + * Compiled regular expressions for manipulating strings. + */ + regExes: { + trimSpace: (/^\s*|\s*$/g), + removeSpace: (/\s*/g), + splitSpace: (/\s+/), + trimComma: (/\s*,\s*/g) + }, + + /** + * Constant: VERSION + * {String} 1.1.2 + */ + VERSION: "1.1.2", + + /** + * Property: schemaLocation + * {String} Schema location + */ + schemaLocation: "http://www.opengis.net/wcs/1.1 http://schemas.opengis.net/wcs/1.1/wcsGetCoverage.xsd", + + /** + * Constructor: OpenLayers.Format.WCSGetCoverage + * + * Parameters: + * options - {Object} An optional object whose properties will be set on + * this instance. + */ + + /** + * Method: write + * + * Parameters: + * options - {Object} Optional object. + * + * Returns: + * {String} A WCS GetCoverage request XML string. + */ + write: function(options) { + var node = this.writeNode("wcs:GetCoverage", options); + this.setAttributeNS( + node, this.namespaces.xsi, + "xsi:schemaLocation", this.schemaLocation + ); + return OpenLayers.Format.XML.prototype.write.apply(this, [node]); + }, + + /** + * Property: writers + * As a compliment to the readers property, this structure contains public + * writing functions grouped by namespace alias and named like the + * node names they produce. + */ + writers: { + "wcs": { + "GetCoverage": function(options) { + var node = this.createElementNSPlus("wcs:GetCoverage", { + attributes: { + version: options.version || this.VERSION, + service: 'WCS' + } + }); + this.writeNode("ows:Identifier", options.identifier, node); + this.writeNode("wcs:DomainSubset", options.domainSubset, node); + this.writeNode("wcs:Output", options.output, node); + return node; + }, + "DomainSubset": function(domainSubset) { + var node = this.createElementNSPlus("wcs:DomainSubset", {}); + this.writeNode("ows:BoundingBox", domainSubset.boundingBox, node); + if (domainSubset.temporalSubset) { + this.writeNode("wcs:TemporalSubset", domainSubset.temporalSubset, node); + } + return node; + }, + "TemporalSubset": function(temporalSubset) { + var node = this.createElementNSPlus("wcs:TemporalSubset", {}); + for (var i=0, len=temporalSubset.timePeriods.length; i + + + + + + + diff --git a/tests/Format/WPSExecute.html b/tests/Format/WPSExecute.html index dc68af74dc..fc731e8900 100644 --- a/tests/Format/WPSExecute.html +++ b/tests/Format/WPSExecute.html @@ -3,6 +3,111 @@