From cd093ee459ff4e18782de2565493d2973487123b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20de=20Sousa?= Date: Thu, 2 Apr 2015 10:18:51 +0200 Subject: [PATCH 1/3] Adds parser classes for WCS 1.1.1 --- .../Format/WCSCapabilities/v1_1_1.js | 48 +++++++++++++++++++ .../Format/WCSDescribeCoverage/v1_1_1.js | 46 ++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 lib/OpenLayers/Format/WCSCapabilities/v1_1_1.js create mode 100644 lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_1.js diff --git a/lib/OpenLayers/Format/WCSCapabilities/v1_1_1.js b/lib/OpenLayers/Format/WCSCapabilities/v1_1_1.js new file mode 100644 index 0000000000..c425bde01a --- /dev/null +++ b/lib/OpenLayers/Format/WCSCapabilities/v1_1_1.js @@ -0,0 +1,48 @@ +/* ====================================================================== + OpenLayers/Format/WCSCapabilities/v1_1_1.js + ====================================================================== */ + +/* Copyright (c) 2006-2015 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the 2-clause BSD license. + * See license.txt in the OpenLayers distribution or repository for the + * full text of the license. */ + +/** + * @requires OpenLayers/Format/OWSCommon/v1_1_1.js + */ + +/** + * Class: OpenLayers.Format.WCSCapabilities/v1_1_1 + * Read WCS Capabilities version 1.1.1. + * + * Inherits from: + * - + */ +OpenLayers.Format.WCSCapabilities.v1_1_1 = OpenLayers.Class( + OpenLayers.Format.WCSCapabilities.v1_1_0, { + + /** + * Property: namespaces + * {Object} Mapping of namespace aliases to namespace URIs. + */ + namespaces: { + wcs: "http://www.opengis.net/wcs/1.1.1", + xlink: "http://www.w3.org/1999/xlink", + xsi: "http://www.w3.org/2001/XMLSchema-instance", + ows: "http://www.opengis.net/ows/1.1.1", + owsesri: "http://www.opengis.net/ows", + owcsesri: "http://www.opengis.net/wcs/1.1.1/ows" + }, + + /** + * Constructor: OpenLayers.Format.WCSCapabilities.v1_1_0 + * Create a new parser for WCS capabilities version 1.1.0. + * + * Parameters: + * options - {Object} An optional object whose properties will be set on + * this instance. + */ + + CLASS_NAME: "OpenLayers.Format.WCSCapabilities.v1_1_1" + +}); diff --git a/lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_1.js b/lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_1.js new file mode 100644 index 0000000000..8ddb02be8c --- /dev/null +++ b/lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_1.js @@ -0,0 +1,46 @@ +/* ====================================================================== + OpenLayers/Format/WCSDescribeCoverage/v1_1_1.js + ====================================================================== */ + +/* Copyright (c) 2006-2015 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the 2-clause BSD license. + * See license.txt in the OpenLayers distribution or repository for the + * full text of the license. */ + +/** + * @requires OpenLayers/Format/WCSDescribeCoverage/v1_1_1.js + */ + +/** + * Class: OpenLayers.Format.WCSDescribeCoverage/v1_1_1 + * Read WCS DescribeCoverage version 1.1.1. + * + * Inherits from: + * - + */ +OpenLayers.Format.WCSDescribeCoverage.v1_1_1 = OpenLayers.Class( + OpenLayers.Format.WCSDescribeCoverage.v1_1_0, { + + /** + * Property: namespaces + * {Object} Mapping of namespace aliases to namespace URIs. + */ + namespaces: { + wcs: "http://www.opengis.net/wcs/1.1.1", + xlink: "http://www.w3.org/1999/xlink", + xsi: "http://www.w3.org/2001/XMLSchema-instance", + ows: "http://www.opengis.net/ows/1.1.1", + owsesri: "http://www.opengis.net/ows" + }, + + /** + * Constructor: OpenLayers.Format.WCSDescribeCoverage.v1_1_1 + * Create a new parser for WCS capabilities version 1.1.1. + * + * Parameters: + * options - {Object} An optional object whose properties will be set on + * this instance. + */ + + CLASS_NAME: "OpenLayers.Format.WCSDescribeCoverage.v1_1_1" +}); From 3371f0d8825dcc67ada68c832c0a4440a56dd3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20de=20Sousa?= Date: Thu, 2 Apr 2015 15:32:18 +0200 Subject: [PATCH 2/3] Extra namespace aliases in WCSDescribeCoverage.v1_1_0 to support both MapServer and GeoServer. --- .../Format/WCSDescribeCoverage/v1_1_1.js | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_1.js b/lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_1.js index 8ddb02be8c..1a828dc893 100644 --- a/lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_1.js +++ b/lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_1.js @@ -22,17 +22,21 @@ OpenLayers.Format.WCSDescribeCoverage.v1_1_1 = OpenLayers.Class( OpenLayers.Format.WCSDescribeCoverage.v1_1_0, { /** - * Property: namespaces - * {Object} Mapping of namespace aliases to namespace URIs. + * Property: namespaceAlias + * {Object} Mapping of namespace URIs to namespace aliases. + * MapServer and GeoServer use different URIs for the "wcs" alias, + * thus two URIs must be included for each alias. */ - namespaces: { - wcs: "http://www.opengis.net/wcs/1.1.1", - xlink: "http://www.w3.org/1999/xlink", - xsi: "http://www.w3.org/2001/XMLSchema-instance", - ows: "http://www.opengis.net/ows/1.1.1", - owsesri: "http://www.opengis.net/ows" + namespaceAlias: { + "http://www.opengis.net/wcs/1.1.1" : "wcs", + "http://www.opengis.net/wcs/1.1" : "wcs", + "http://www.opengis.net/ows/1.1.1" : "wcs", + "http://www.opengis.net/ows/1.1" : "wcs", + "http://www.w3.org/1999/xlink" : "xlink", + "http://www.w3.org/2001/XMLSchema-instance" : "xsi", + "http://www.opengis.net/ows" : "owsesri" }, - + /** * Constructor: OpenLayers.Format.WCSDescribeCoverage.v1_1_1 * Create a new parser for WCS capabilities version 1.1.1. @@ -41,6 +45,16 @@ OpenLayers.Format.WCSDescribeCoverage.v1_1_1 = OpenLayers.Class( * options - {Object} An optional object whose properties will be set on * this instance. */ - + initialize: function(options) { + if(window.ActiveXObject) { + this.xmldom = new ActiveXObject("Microsoft.XMLDOM"); + } + OpenLayers.Format.prototype.initialize.apply(this, [options]); + // clone the namespace object and set all namespace aliases + // in this class namespaceAlias is larger than namespaces, must be assigned directly + this.namespaces = OpenLayers.Util.extend({}, this.namespaces); + this.namespaceAlias = OpenLayers.Util.extend({}, this.namespaceAlias); + }, + CLASS_NAME: "OpenLayers.Format.WCSDescribeCoverage.v1_1_1" }); From d921e8edf33d9866b4269b8e0a9ccf628e4840c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20de=20Sousa?= Date: Fri, 22 May 2015 11:27:22 +0200 Subject: [PATCH 3/3] WCS 1.1.1 and 1.1.0 admit four values in GirdOffsets element in the DescribeCoverage response document. --- lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_0.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_0.js b/lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_0.js index 688a966285..2cee1145da 100644 --- a/lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_0.js +++ b/lib/OpenLayers/Format/WCSDescribeCoverage/v1_1_0.js @@ -129,6 +129,11 @@ OpenLayers.Format.WCSDescribeCoverage.v1_1_0 = OpenLayers.Class( gridCRS.gridOffsets.x = Number(xy[0]); gridCRS.gridOffsets.y = Number(xy[1]); } + else if (xy.length == 4) { + gridCRS.gridOffsets = {}; + gridCRS.gridOffsets.x = Number(xy[0]); + gridCRS.gridOffsets.y = Number(xy[3]); + } }, "GridCS": function(node, gridCRS) { gridCRS.gridCS = this.getChildValue(node);