add WMS GetCapabilities parser for WMS 1.1.0, 1.1.1, 1.1.1 WMS-C profile and WMS 1.3.0
This commit is contained in:
101
src/ol/parser/ogc/exceptionreport.js
Normal file
101
src/ol/parser/ogc/exceptionreport.js
Normal file
@@ -0,0 +1,101 @@
|
||||
goog.provide('ol.parser.ogc.ExceptionReport');
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('ol.parser.XML');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.parser.XML}
|
||||
*/
|
||||
ol.parser.ogc.ExceptionReport = function() {
|
||||
this.defaultPrefix = 'ogc';
|
||||
this.namespaces = {};
|
||||
this.namespaces['ogc'] = 'http://www.opengis.net/ogc';
|
||||
this.namespaces['ows'] = 'http://www.opengis.net/ows';
|
||||
this.namespaces['ows11'] = 'http://www.opengis.net/ows/1.1';
|
||||
var exceptionReader = function(node, exceptionReport) {
|
||||
var exception = {
|
||||
code: node.getAttribute('exceptionCode'),
|
||||
locator: node.getAttribute('locator'),
|
||||
texts: []
|
||||
};
|
||||
exceptionReport.exceptions.push(exception);
|
||||
this.readChildNodes(node, exception);
|
||||
};
|
||||
var exceptionTextReader = function(node, exception) {
|
||||
var text = this.getChildValue(node);
|
||||
exception.texts.push(text);
|
||||
};
|
||||
this.readers = {
|
||||
'ogc': {
|
||||
'ServiceExceptionReport': function(node, obj) {
|
||||
obj['exceptionReport'] = {};
|
||||
obj['exceptionReport']['exceptions'] = [];
|
||||
this.readChildNodes(node, obj['exceptionReport']);
|
||||
},
|
||||
'ServiceException': function(node, exceptionReport) {
|
||||
var exception = {};
|
||||
exception['code'] = node.getAttribute('code');
|
||||
exception['locator'] = node.getAttribute('locator');
|
||||
exception['text'] = this.getChildValue(node);
|
||||
exceptionReport['exceptions'].push(exception);
|
||||
}
|
||||
},
|
||||
'ows': {
|
||||
'ExceptionReport': function(node, obj) {
|
||||
obj.success = false;
|
||||
obj.exceptionReport = {
|
||||
version: node.getAttribute('version'),
|
||||
language: node.getAttribute('language'),
|
||||
exceptions: []
|
||||
};
|
||||
this.readChildNodes(node, obj.exceptionReport);
|
||||
},
|
||||
'Exception': function(node, exceptionReport) {
|
||||
exceptionReader.apply(this, arguments);
|
||||
},
|
||||
'ExceptionText': function(node, exception) {
|
||||
exceptionTextReader.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
'ows11': {
|
||||
'ExceptionReport': function(node, obj) {
|
||||
obj.exceptionReport = {
|
||||
version: node.getAttribute('version'),
|
||||
language: node.getAttribute('xml:lang'),
|
||||
exceptions: []
|
||||
};
|
||||
this.readChildNodes(node, obj.exceptionReport);
|
||||
},
|
||||
'Exception': function(node, exceptionReport) {
|
||||
exceptionReader.apply(this, arguments);
|
||||
},
|
||||
'ExceptionText': function(node, exception) {
|
||||
exceptionTextReader.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
};
|
||||
goog.base(this);
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.ExceptionReport, ol.parser.XML);
|
||||
|
||||
|
||||
/**
|
||||
* Read OGC exception report data from a string, and return an object with
|
||||
* information about the exceptions.
|
||||
*
|
||||
* @param {string|Document} data to read/parse.
|
||||
* @return {Object} Information about the exceptions that occurred.
|
||||
*/
|
||||
ol.parser.ogc.ExceptionReport.prototype.read = function(data) {
|
||||
if (typeof data == 'string') {
|
||||
data = goog.dom.xml.loadXml(data);
|
||||
}
|
||||
var exceptionInfo = {};
|
||||
exceptionInfo['exceptionReport'] = null;
|
||||
if (data) {
|
||||
this.readChildNodes(data, exceptionInfo);
|
||||
}
|
||||
return exceptionInfo;
|
||||
};
|
||||
121
src/ol/parser/ogc/versioned.js
Normal file
121
src/ol/parser/ogc/versioned.js
Normal file
@@ -0,0 +1,121 @@
|
||||
goog.provide('ol.parser.ogc.Versioned');
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('ol.parser.ogc.ExceptionReport');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} formatOptions Options which will be set on this object.
|
||||
*/
|
||||
ol.parser.ogc.Versioned = function(formatOptions) {
|
||||
formatOptions = formatOptions || {};
|
||||
this.options = formatOptions;
|
||||
this.defaultVersion = formatOptions.defaultVersion || null;
|
||||
this.version = formatOptions.version;
|
||||
this.profile = formatOptions.profile;
|
||||
if (formatOptions.allowFallback !== undefined) {
|
||||
this.allowFallback = formatOptions.allowFallback;
|
||||
} else {
|
||||
this.allowFallback = false;
|
||||
}
|
||||
if (formatOptions.stringifyOutput !== undefined) {
|
||||
this.stringifyOutput = formatOptions.stringifyOutput;
|
||||
} else {
|
||||
this.stringifyOutput = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Element} root root element.
|
||||
* @param {Object=} opt_options optional configuration object.
|
||||
* @return {string} the version to use.
|
||||
*/
|
||||
ol.parser.ogc.Versioned.prototype.getVersion = function(root, opt_options) {
|
||||
var version;
|
||||
// read
|
||||
if (root) {
|
||||
version = this.version;
|
||||
if (!version) {
|
||||
version = root.getAttribute('version');
|
||||
if (!version) {
|
||||
version = this.defaultVersion;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// write
|
||||
version = (opt_options && opt_options.version) ||
|
||||
this.version || this.defaultVersion;
|
||||
}
|
||||
return version;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} version the version to use.
|
||||
* @return {Object} the parser to use.
|
||||
*/
|
||||
ol.parser.ogc.Versioned.prototype.getParser = function(version) {
|
||||
version = version || this.defaultVersion;
|
||||
var profile = this.profile ? '_' + this.profile : '';
|
||||
if (!this.parser || this.parser.VERSION != version) {
|
||||
var format = this.parsers['v' + version.replace(/\./g, '_') + profile];
|
||||
if (!format) {
|
||||
if (profile !== '' && this.allowFallback) {
|
||||
// fallback to the non-profiled version of the parser
|
||||
profile = '';
|
||||
format = this.parsers['v' + version.replace(/\./g, '_') + profile];
|
||||
}
|
||||
if (!format) {
|
||||
throw 'Can\'t find a parser for version ' +
|
||||
version + profile;
|
||||
}
|
||||
}
|
||||
this.parser = new format(this.options);
|
||||
}
|
||||
return this.parser;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Write a document.
|
||||
*
|
||||
* @param {Object} obj An object representing the document.
|
||||
* @param {Object=} opt_options Optional configuration object.
|
||||
* @return {Element|string} the XML created.
|
||||
*/
|
||||
ol.parser.ogc.Versioned.prototype.write = function(obj, opt_options) {
|
||||
var version = this.getVersion(null, opt_options);
|
||||
this.parser = this.getParser(version);
|
||||
var root = this.parser.write(obj, opt_options);
|
||||
if (this.stringifyOutput === false) {
|
||||
return root;
|
||||
} else {
|
||||
return goog.dom.xml.serialize(root);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string|Document} data Data to read.
|
||||
* @param {Object=} opt_options Options for the reader.
|
||||
* @return {Object} An object representing the document.
|
||||
*/
|
||||
ol.parser.ogc.Versioned.prototype.read = function(data, opt_options) {
|
||||
if (typeof data == 'string') {
|
||||
data = goog.dom.xml.loadXml(data);
|
||||
}
|
||||
var root = data.documentElement;
|
||||
var version = this.getVersion(root);
|
||||
this.parser = this.getParser(version);
|
||||
var obj = this.parser.read(data, opt_options);
|
||||
var errorProperty = this.parser.errorProperty || null;
|
||||
if (errorProperty !== null && obj[errorProperty] === undefined) {
|
||||
// an error must have happened, so parse it and report back
|
||||
var format = new ol.parser.ogc.ExceptionReport();
|
||||
obj.error = format.read(data);
|
||||
}
|
||||
obj.version = version;
|
||||
return obj;
|
||||
};
|
||||
2
src/ol/parser/ogc/wmscapabilities.exports
Normal file
2
src/ol/parser/ogc/wmscapabilities.exports
Normal file
@@ -0,0 +1,2 @@
|
||||
@exportSymbol ol.parser.ogc.WMSCapabilities
|
||||
@exportProperty ol.parser.ogc.WMSCapabilities.prototype.read
|
||||
52
src/ol/parser/ogc/wmscapabilities.js
Normal file
52
src/ol/parser/ogc/wmscapabilities.js
Normal file
@@ -0,0 +1,52 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities');
|
||||
goog.require('ol.parser.ogc.Versioned');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1_1_0');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1_1_1');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1_1_1_WMSC');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1_3_0');
|
||||
|
||||
/**
|
||||
* @define {boolean} Whether to enable WMS Capabilities version 1.1.0.
|
||||
*/
|
||||
ol.ENABLE_WMSCAPS_1_1_0 = true;
|
||||
|
||||
/**
|
||||
* @define {boolean} Whether to enable WMS Capabilities version 1.1.1.
|
||||
*/
|
||||
ol.ENABLE_WMSCAPS_1_1_1 = true;
|
||||
|
||||
/**
|
||||
* @define {boolean} Whether to enable WMS Capabilities version 1.3.0.
|
||||
*/
|
||||
ol.ENABLE_WMSCAPS_1_3_0 = true;
|
||||
|
||||
/**
|
||||
* @define {boolean} Whether to enable WMS Capabilities version 1.1.1
|
||||
* WMSC profile.
|
||||
*/
|
||||
ol.ENABLE_WMSCAPS_1_1_1_WMSC = true;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} formatOptions Options which will be set on this object.
|
||||
* @extends {ol.parser.ogc.Versioned}
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities = function(formatOptions) {
|
||||
formatOptions = formatOptions || {};
|
||||
formatOptions['defaultVersion'] = '1.1.1';
|
||||
this.parsers = {};
|
||||
if (ol.ENABLE_WMSCAPS_1_1_0) {
|
||||
this.parsers['v1_1_0'] = ol.parser.ogc.WMSCapabilities_v1_1_0;
|
||||
}
|
||||
if (ol.ENABLE_WMSCAPS_1_1_1) {
|
||||
this.parsers['v1_1_1'] = ol.parser.ogc.WMSCapabilities_v1_1_1;
|
||||
}
|
||||
if (ol.ENABLE_WMSCAPS_1_1_1_WMSC) {
|
||||
this.parsers['v1_1_1_WMSC'] = ol.parser.ogc.WMSCapabilities_v1_1_1_WMSC;
|
||||
}
|
||||
if (ol.ENABLE_WMSCAPS_1_3_0) {
|
||||
this.parsers['v1_3_0'] = ol.parser.ogc.WMSCapabilities_v1_3_0;
|
||||
}
|
||||
goog.base(this, formatOptions);
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities, ol.parser.ogc.Versioned);
|
||||
324
src/ol/parser/ogc/wmscapabilities_v1.js
Normal file
324
src/ol/parser/ogc/wmscapabilities_v1.js
Normal file
@@ -0,0 +1,324 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1');
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.parser.XML');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.parser.XML}
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities_v1 = function() {
|
||||
this.defaultPrefix = 'wms';
|
||||
this.errorProperty = 'service';
|
||||
this.namespaces = {};
|
||||
this.namespaces['wms'] = 'http://www.opengis.net/wms';
|
||||
this.namespaces['xlink'] = 'http://www.w3.org/1999/xlink';
|
||||
this.namespaces['xsi'] = 'http://www.w3.org/2001/XMLSchema-instance';
|
||||
this.readers = {
|
||||
'wms': {
|
||||
'Service': function(node, obj) {
|
||||
obj['service'] = {};
|
||||
this.readChildNodes(node, obj['service']);
|
||||
},
|
||||
'Name': function(node, obj) {
|
||||
obj.name = this.getChildValue(node);
|
||||
},
|
||||
'Title': function(node, obj) {
|
||||
obj.title = this.getChildValue(node);
|
||||
},
|
||||
'Abstract': function(node, obj) {
|
||||
obj['abstract'] = this.getChildValue(node);
|
||||
},
|
||||
'BoundingBox': function(node, obj) {
|
||||
var bbox = {};
|
||||
bbox.bbox = [
|
||||
parseFloat(node.getAttribute('minx')),
|
||||
parseFloat(node.getAttribute('miny')),
|
||||
parseFloat(node.getAttribute('maxx')),
|
||||
parseFloat(node.getAttribute('maxy'))
|
||||
];
|
||||
var res = {
|
||||
x: parseFloat(node.getAttribute('resx')),
|
||||
y: parseFloat(node.getAttribute('resy'))
|
||||
};
|
||||
if (! (isNaN(res.x) && isNaN(res.y))) {
|
||||
bbox.res = res;
|
||||
}
|
||||
// return the bbox so that descendant classes can set the
|
||||
// CRS and SRS and add it to the obj
|
||||
return bbox;
|
||||
},
|
||||
'OnlineResource': function(node, obj) {
|
||||
obj.href = this.getAttributeNS(node, this.namespaces['xlink'],
|
||||
'href');
|
||||
},
|
||||
'ContactInformation': function(node, obj) {
|
||||
obj.contactInformation = {};
|
||||
this.readChildNodes(node, obj.contactInformation);
|
||||
},
|
||||
'ContactPersonPrimary': function(node, obj) {
|
||||
obj.personPrimary = {};
|
||||
this.readChildNodes(node, obj.personPrimary);
|
||||
},
|
||||
'ContactPerson': function(node, obj) {
|
||||
obj.person = this.getChildValue(node);
|
||||
},
|
||||
'ContactOrganization': function(node, obj) {
|
||||
obj.organization = this.getChildValue(node);
|
||||
},
|
||||
'ContactPosition': function(node, obj) {
|
||||
obj.position = this.getChildValue(node);
|
||||
},
|
||||
'ContactAddress': function(node, obj) {
|
||||
obj.contactAddress = {};
|
||||
this.readChildNodes(node, obj.contactAddress);
|
||||
},
|
||||
'AddressType': function(node, obj) {
|
||||
obj.type = this.getChildValue(node);
|
||||
},
|
||||
'Address': function(node, obj) {
|
||||
obj.address = this.getChildValue(node);
|
||||
},
|
||||
'City': function(node, obj) {
|
||||
obj.city = this.getChildValue(node);
|
||||
},
|
||||
'StateOrProvince': function(node, obj) {
|
||||
obj.stateOrProvince = this.getChildValue(node);
|
||||
},
|
||||
'PostCode': function(node, obj) {
|
||||
obj.postcode = this.getChildValue(node);
|
||||
},
|
||||
'Country': function(node, obj) {
|
||||
obj.country = this.getChildValue(node);
|
||||
},
|
||||
'ContactVoiceTelephone': function(node, obj) {
|
||||
obj.phone = this.getChildValue(node);
|
||||
},
|
||||
'ContactFacsimileTelephone': function(node, obj) {
|
||||
obj.fax = this.getChildValue(node);
|
||||
},
|
||||
'ContactElectronicMailAddress': function(node, obj) {
|
||||
obj.email = this.getChildValue(node);
|
||||
},
|
||||
'Fees': function(node, obj) {
|
||||
var fees = this.getChildValue(node);
|
||||
if (fees && fees.toLowerCase() != 'none') {
|
||||
obj.fees = fees;
|
||||
}
|
||||
},
|
||||
'AccessConstraints': function(node, obj) {
|
||||
var constraints = this.getChildValue(node);
|
||||
if (constraints && constraints.toLowerCase() != 'none') {
|
||||
obj.accessConstraints = constraints;
|
||||
}
|
||||
},
|
||||
'Capability': function(node, obj) {
|
||||
obj.capability = {
|
||||
nestedLayers: [],
|
||||
layers: []
|
||||
};
|
||||
this.readChildNodes(node, obj.capability);
|
||||
},
|
||||
'Request': function(node, obj) {
|
||||
obj.request = {};
|
||||
this.readChildNodes(node, obj.request);
|
||||
},
|
||||
'GetCapabilities': function(node, obj) {
|
||||
obj.getcapabilities = {formats: []};
|
||||
this.readChildNodes(node, obj.getcapabilities);
|
||||
},
|
||||
'Format': function(node, obj) {
|
||||
if (goog.isArray(obj.formats)) {
|
||||
obj.formats.push(this.getChildValue(node));
|
||||
} else {
|
||||
obj.format = this.getChildValue(node);
|
||||
}
|
||||
},
|
||||
'DCPType': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'HTTP': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'Get': function(node, obj) {
|
||||
obj.get = {};
|
||||
this.readChildNodes(node, obj.get);
|
||||
// backwards compatibility
|
||||
if (!obj.href) {
|
||||
obj.href = obj.get.href;
|
||||
}
|
||||
},
|
||||
'Post': function(node, obj) {
|
||||
obj.post = {};
|
||||
this.readChildNodes(node, obj.post);
|
||||
// backwards compatibility
|
||||
if (!obj.href) {
|
||||
obj.href = obj.get.href;
|
||||
}
|
||||
},
|
||||
'GetMap': function(node, obj) {
|
||||
obj.getmap = {formats: []};
|
||||
this.readChildNodes(node, obj.getmap);
|
||||
},
|
||||
'GetFeatureInfo': function(node, obj) {
|
||||
obj.getfeatureinfo = {formats: []};
|
||||
this.readChildNodes(node, obj.getfeatureinfo);
|
||||
},
|
||||
'Exception': function(node, obj) {
|
||||
obj.exception = {formats: []};
|
||||
this.readChildNodes(node, obj.exception);
|
||||
},
|
||||
'Layer': function(node, obj) {
|
||||
var parentLayer, capability;
|
||||
if (obj.capability) {
|
||||
capability = obj.capability;
|
||||
parentLayer = obj;
|
||||
} else {
|
||||
capability = obj;
|
||||
}
|
||||
var attrNode = node.getAttributeNode('queryable');
|
||||
var queryable = (attrNode && attrNode.specified) ?
|
||||
node.getAttribute('queryable') : null;
|
||||
attrNode = node.getAttributeNode('cascaded');
|
||||
var cascaded = (attrNode && attrNode.specified) ?
|
||||
node.getAttribute('cascaded') : null;
|
||||
attrNode = node.getAttributeNode('opaque');
|
||||
var opaque = (attrNode && attrNode.specified) ?
|
||||
node.getAttribute('opaque') : null;
|
||||
var noSubsets = node.getAttribute('noSubsets');
|
||||
var fixedWidth = node.getAttribute('fixedWidth');
|
||||
var fixedHeight = node.getAttribute('fixedHeight');
|
||||
var parent = parentLayer || {};
|
||||
var layer = {
|
||||
nestedLayers: [],
|
||||
styles: parentLayer ? [].concat(parentLayer.styles) : [],
|
||||
srs: {},
|
||||
metadataURLs: [],
|
||||
bbox: {},
|
||||
llbbox: parent.llbbox,
|
||||
dimensions: {},
|
||||
authorityURLs: {},
|
||||
identifiers: {},
|
||||
keywords: [],
|
||||
queryable: (queryable && queryable !== '') ?
|
||||
(queryable === '1' || queryable === 'true') :
|
||||
(parent.queryable || false),
|
||||
cascaded: (cascaded !== null) ? parseInt(cascaded, 10) :
|
||||
(parent.cascaded || 0),
|
||||
opaque: opaque ?
|
||||
(opaque === '1' || opaque === 'true') :
|
||||
(parent.opaque || false),
|
||||
noSubsets: (noSubsets !== null) ?
|
||||
(noSubsets === '1' || noSubsets === 'true') :
|
||||
(parent.noSubsets || false),
|
||||
fixedWidth: (fixedWidth !== null) ?
|
||||
parseInt(fixedWidth, 10) : (parent.fixedWidth || 0),
|
||||
fixedHeight: (fixedHeight !== null) ?
|
||||
parseInt(fixedHeight, 10) : (parent.fixedHeight || 0),
|
||||
minScale: parent.minScale,
|
||||
maxScale: parent.maxScale,
|
||||
attribution: parent.attribution
|
||||
};
|
||||
if (parentLayer) {
|
||||
goog.object.extend(layer.srs, parent.srs);
|
||||
goog.object.extend(layer.bbox, parent.bbox);
|
||||
goog.object.extend(layer.dimensions, parent.dimensions);
|
||||
goog.object.extend(layer.authorityURLs, parent.authorityURLs);
|
||||
}
|
||||
obj.nestedLayers.push(layer);
|
||||
layer.capability = capability;
|
||||
this.readChildNodes(node, layer);
|
||||
delete layer.capability;
|
||||
if (layer.name) {
|
||||
var parts = layer.name.split(':'),
|
||||
request = capability.request,
|
||||
gfi = request.getfeatureinfo;
|
||||
if (parts.length > 0) {
|
||||
layer.prefix = parts[0];
|
||||
}
|
||||
capability.layers.push(layer);
|
||||
if (layer.formats === undefined) {
|
||||
layer.formats = request.getmap.formats;
|
||||
}
|
||||
if (layer.infoFormats === undefined && gfi) {
|
||||
layer.infoFormats = gfi.formats;
|
||||
}
|
||||
}
|
||||
},
|
||||
'Attribution': function(node, obj) {
|
||||
obj.attribution = {};
|
||||
this.readChildNodes(node, obj.attribution);
|
||||
},
|
||||
'LogoURL': function(node, obj) {
|
||||
obj.logo = {
|
||||
width: node.getAttribute('width'),
|
||||
height: node.getAttribute('height')
|
||||
};
|
||||
this.readChildNodes(node, obj.logo);
|
||||
},
|
||||
'Style': function(node, obj) {
|
||||
var style = {};
|
||||
obj.styles.push(style);
|
||||
this.readChildNodes(node, style);
|
||||
},
|
||||
'LegendURL': function(node, obj) {
|
||||
var legend = {
|
||||
width: node.getAttribute('width'),
|
||||
height: node.getAttribute('height')
|
||||
};
|
||||
obj.legend = legend;
|
||||
this.readChildNodes(node, legend);
|
||||
},
|
||||
'MetadataURL': function(node, obj) {
|
||||
var metadataURL = {type: node.getAttribute('type')};
|
||||
obj.metadataURLs.push(metadataURL);
|
||||
this.readChildNodes(node, metadataURL);
|
||||
},
|
||||
'DataURL': function(node, obj) {
|
||||
obj.dataURL = {};
|
||||
this.readChildNodes(node, obj.dataURL);
|
||||
},
|
||||
'FeatureListURL': function(node, obj) {
|
||||
obj.featureListURL = {};
|
||||
this.readChildNodes(node, obj.featureListURL);
|
||||
},
|
||||
'AuthorityURL': function(node, obj) {
|
||||
var name = node.getAttribute('name');
|
||||
var authority = {};
|
||||
this.readChildNodes(node, authority);
|
||||
obj.authorityURLs[name] = authority.href;
|
||||
},
|
||||
'Identifier': function(node, obj) {
|
||||
var authority = node.getAttribute('authority');
|
||||
obj.identifiers[authority] = this.getChildValue(node);
|
||||
},
|
||||
'KeywordList': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'SRS': function(node, obj) {
|
||||
obj.srs[this.getChildValue(node)] = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
goog.base(this);
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1, ol.parser.XML);
|
||||
|
||||
|
||||
/**
|
||||
* @param {string|Document|Element} data Data to read.
|
||||
* @return {Object} An object representing the document.
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities_v1.prototype.read = function(data) {
|
||||
if (typeof data == 'string') {
|
||||
data = goog.dom.xml.loadXml(data);
|
||||
}
|
||||
if (data && data.nodeType == 9) {
|
||||
data = data.documentElement;
|
||||
}
|
||||
var obj = {};
|
||||
this.readNode(data, obj);
|
||||
return obj;
|
||||
};
|
||||
99
src/ol/parser/ogc/wmscapabilities_v1_1.js
Normal file
99
src/ol/parser/ogc/wmscapabilities_v1_1.js
Normal file
@@ -0,0 +1,99 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1_1');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.parser.ogc.WMSCapabilities_v1}
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities_v1_1 = function() {
|
||||
goog.base(this);
|
||||
var bboxreader = this.readers['wms']['BoundingBox'];
|
||||
goog.object.extend(this.readers['wms'], {
|
||||
'WMT_MS_Capabilities': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'Keyword': function(node, obj) {
|
||||
if (obj.keywords) {
|
||||
obj.keywords.push({value: this.getChildValue(node)});
|
||||
}
|
||||
},
|
||||
'DescribeLayer': function(node, obj) {
|
||||
obj.describelayer = {formats: []};
|
||||
this.readChildNodes(node, obj.describelayer);
|
||||
},
|
||||
'GetLegendGraphic': function(node, obj) {
|
||||
obj.getlegendgraphic = {formats: []};
|
||||
this.readChildNodes(node, obj.getlegendgraphic);
|
||||
},
|
||||
'GetStyles': function(node, obj) {
|
||||
obj.getstyles = {formats: []};
|
||||
this.readChildNodes(node, obj.getstyles);
|
||||
},
|
||||
'PutStyles': function(node, obj) {
|
||||
obj.putstyles = {formats: []};
|
||||
this.readChildNodes(node, obj.putstyles);
|
||||
},
|
||||
'UserDefinedSymbolization': function(node, obj) {
|
||||
var userSymbols = {
|
||||
supportSLD: parseInt(node.getAttribute('SupportSLD'), 10) == 1,
|
||||
userLayer: parseInt(node.getAttribute('UserLayer'), 10) == 1,
|
||||
userStyle: parseInt(node.getAttribute('UserStyle'), 10) == 1,
|
||||
remoteWFS: parseInt(node.getAttribute('RemoteWFS'), 10) == 1
|
||||
};
|
||||
obj.userSymbols = userSymbols;
|
||||
},
|
||||
'LatLonBoundingBox': function(node, obj) {
|
||||
obj.llbbox = [
|
||||
parseFloat(node.getAttribute('minx')),
|
||||
parseFloat(node.getAttribute('miny')),
|
||||
parseFloat(node.getAttribute('maxx')),
|
||||
parseFloat(node.getAttribute('maxy'))
|
||||
];
|
||||
},
|
||||
'BoundingBox': function(node, obj) {
|
||||
var bbox = bboxreader.apply(this, arguments);
|
||||
bbox.srs = node.getAttribute('SRS');
|
||||
obj.bbox[bbox.srs] = bbox;
|
||||
},
|
||||
'ScaleHint': function(node, obj) {
|
||||
var min = parseFloat(node.getAttribute('min'));
|
||||
var max = parseFloat(node.getAttribute('max'));
|
||||
var rad2 = Math.pow(2, 0.5);
|
||||
var dpi = (25.4 / 0.28);
|
||||
var ipm = 39.37;
|
||||
if (min !== 0) {
|
||||
obj.maxScale = parseFloat((min / rad2) * ipm * dpi);
|
||||
}
|
||||
if (max != Number.POSITIVE_INFINITY) {
|
||||
obj.minScale = parseFloat((max / rad2) * ipm * dpi);
|
||||
}
|
||||
},
|
||||
'Dimension': function(node, obj) {
|
||||
var name = node.getAttribute('name').toLowerCase();
|
||||
var dim = {
|
||||
name: name,
|
||||
units: node.getAttribute('units'),
|
||||
unitsymbol: node.getAttribute('unitSymbol')
|
||||
};
|
||||
obj.dimensions[dim.name] = dim;
|
||||
},
|
||||
'Extent': function(node, obj) {
|
||||
var name = node.getAttribute('name').toLowerCase();
|
||||
if (name in obj['dimensions']) {
|
||||
var extent = obj.dimensions[name];
|
||||
extent.nearestVal =
|
||||
node.getAttribute('nearestValue') === '1';
|
||||
extent.multipleVal =
|
||||
node.getAttribute('multipleValues') === '1';
|
||||
extent.current = node.getAttribute('current') === '1';
|
||||
extent['default'] = node.getAttribute('default') || '';
|
||||
var values = this.getChildValue(node);
|
||||
extent.values = values.split(',');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1_1,
|
||||
ol.parser.ogc.WMSCapabilities_v1);
|
||||
25
src/ol/parser/ogc/wmscapabilities_v1_1_0.js
Normal file
25
src/ol/parser/ogc/wmscapabilities_v1_1_0.js
Normal file
@@ -0,0 +1,25 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1_1_0');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1_1');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.parser.ogc.WMSCapabilities_v1_1}
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities_v1_1_0 = function() {
|
||||
goog.base(this);
|
||||
this.version = '1.1.0';
|
||||
goog.object.extend(this.readers['wms'], {
|
||||
'SRS': function(node, obj) {
|
||||
var srs = this.getChildValue(node);
|
||||
var values = srs.split(/ +/);
|
||||
for (var i = 0, len = values.length; i < len; i++) {
|
||||
obj.srs[values[i]] = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1_1_0,
|
||||
ol.parser.ogc.WMSCapabilities_v1_1);
|
||||
|
||||
21
src/ol/parser/ogc/wmscapabilities_v1_1_1.js
Normal file
21
src/ol/parser/ogc/wmscapabilities_v1_1_1.js
Normal file
@@ -0,0 +1,21 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1_1_1');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1_1');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.parser.ogc.WMSCapabilities_v1_1}
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities_v1_1_1 = function() {
|
||||
goog.base(this);
|
||||
this.version = '1.1.1';
|
||||
goog.object.extend(this.readers['wms'], {
|
||||
'SRS': function(node, obj) {
|
||||
obj.srs[this.getChildValue(node)] = true;
|
||||
}
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1_1_1,
|
||||
ol.parser.ogc.WMSCapabilities_v1_1);
|
||||
|
||||
46
src/ol/parser/ogc/wmscapabilities_v1_1_1_WMSC.js
Normal file
46
src/ol/parser/ogc/wmscapabilities_v1_1_1_WMSC.js
Normal file
@@ -0,0 +1,46 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1_1_1_WMSC');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1_1_1');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.parser.ogc.WMSCapabilities_v1_1_1}
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities_v1_1_1_WMSC = function() {
|
||||
goog.base(this);
|
||||
this.profile = 'WMSC';
|
||||
goog.object.extend(this.readers['wms'], {
|
||||
'VendorSpecificCapabilities': function(node, obj) {
|
||||
obj.vendorSpecific = {tileSets: []};
|
||||
this.readChildNodes(node, obj.vendorSpecific);
|
||||
},
|
||||
'TileSet': function(node, vendorSpecific) {
|
||||
var tileset = {srs: {}, bbox: {}, resolutions: []};
|
||||
this.readChildNodes(node, tileset);
|
||||
vendorSpecific.tileSets.push(tileset);
|
||||
},
|
||||
'Resolutions': function(node, tileset) {
|
||||
var res = this.getChildValue(node).split(' ');
|
||||
for (var i = 0, len = res.length; i < len; i++) {
|
||||
if (res[i] !== '') {
|
||||
tileset.resolutions.push(parseFloat(res[i]));
|
||||
}
|
||||
}
|
||||
},
|
||||
'Width': function(node, tileset) {
|
||||
tileset.width = parseInt(this.getChildValue(node), 10);
|
||||
},
|
||||
'Height': function(node, tileset) {
|
||||
tileset.height = parseInt(this.getChildValue(node), 10);
|
||||
},
|
||||
'Layers': function(node, tileset) {
|
||||
tileset.layers = this.getChildValue(node);
|
||||
},
|
||||
'Styles': function(node, tileset) {
|
||||
tileset.styles = this.getChildValue(node);
|
||||
}
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1_1_1_WMSC,
|
||||
ol.parser.ogc.WMSCapabilities_v1_1_1);
|
||||
106
src/ol/parser/ogc/wmscapabilities_v1_3_0.js
Normal file
106
src/ol/parser/ogc/wmscapabilities_v1_3_0.js
Normal file
@@ -0,0 +1,106 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1_3_0');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.parser.ogc.WMSCapabilities_v1}
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities_v1_3_0 = function() {
|
||||
goog.base(this);
|
||||
var bboxreader = this.readers['wms']['BoundingBox'];
|
||||
goog.object.extend(this.readers['wms'], {
|
||||
'WMS_Capabilities': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'LayerLimit': function(node, obj) {
|
||||
obj.layerLimit = parseInt(this.getChildValue(node), 10);
|
||||
},
|
||||
'MaxWidth': function(node, obj) {
|
||||
obj.maxWidth = parseInt(this.getChildValue(node), 10);
|
||||
},
|
||||
'MaxHeight': function(node, obj) {
|
||||
obj.maxHeight = parseInt(this.getChildValue(node), 10);
|
||||
},
|
||||
'BoundingBox': function(node, obj) {
|
||||
var bbox = bboxreader.apply(this, arguments);
|
||||
bbox.srs = node.getAttribute('CRS');
|
||||
obj.bbox[bbox.srs] = bbox;
|
||||
},
|
||||
'CRS': function(node, obj) {
|
||||
// CRS is the synonym of SRS
|
||||
this.readers['wms']['SRS'].apply(this, arguments);
|
||||
},
|
||||
'EX_GeographicBoundingBox': function(node, obj) {
|
||||
// replacement of LatLonBoundingBox
|
||||
obj.llbbox = [];
|
||||
this.readChildNodes(node, obj.llbbox);
|
||||
},
|
||||
'westBoundLongitude': function(node, obj) {
|
||||
obj[0] = this.getChildValue(node);
|
||||
},
|
||||
'eastBoundLongitude': function(node, obj) {
|
||||
obj[2] = this.getChildValue(node);
|
||||
},
|
||||
'southBoundLatitude': function(node, obj) {
|
||||
obj[1] = this.getChildValue(node);
|
||||
},
|
||||
'northBoundLatitude': function(node, obj) {
|
||||
obj[3] = this.getChildValue(node);
|
||||
},
|
||||
'MinScaleDenominator': function(node, obj) {
|
||||
obj.maxScale = parseFloat(this.getChildValue(node)).toPrecision(16);
|
||||
},
|
||||
'MaxScaleDenominator': function(node, obj) {
|
||||
obj.minScale = parseFloat(this.getChildValue(node)).toPrecision(16);
|
||||
},
|
||||
'Dimension': function(node, obj) {
|
||||
// dimension has extra attributes: default, multipleValues,
|
||||
// nearestValue, current which used to be part of Extent. It now
|
||||
// also contains the values.
|
||||
var name = node.getAttribute('name').toLowerCase();
|
||||
var dim = {
|
||||
name: name,
|
||||
units: node.getAttribute('units'),
|
||||
unitsymbol: node.getAttribute('unitSymbol'),
|
||||
nearestVal: node.getAttribute('nearestValue') === '1',
|
||||
multipleVal: node.getAttribute('multipleValues') === '1',
|
||||
'default': node.getAttribute('default') || '',
|
||||
current: node.getAttribute('current') === '1',
|
||||
values: this.getChildValue(node).split(',')
|
||||
};
|
||||
// Theoretically there can be more dimensions with the same
|
||||
// name, but with a different unit. Until we meet such a case,
|
||||
// let's just keep the same structure as the WMS 1.1
|
||||
// GetCapabilities parser uses. We will store the last
|
||||
// one encountered.
|
||||
obj.dimensions[dim.name] = dim;
|
||||
},
|
||||
'Keyword': function(node, obj) {
|
||||
var keyword = {value: this.getChildValue(node),
|
||||
vocabulary: node.getAttribute('vocabulary')};
|
||||
if (obj.keywords) {
|
||||
obj.keywords.push(keyword);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.readers['sld'] = {
|
||||
'UserDefinedSymbolization': function(node, obj) {
|
||||
this.readers.wms.UserDefinedSymbolization.apply(this, arguments);
|
||||
// add the two extra attributes
|
||||
var value = node.getAttribute('InlineFeature');
|
||||
obj['userSymbols'].inlineFeature = parseInt(value, 10) == 1;
|
||||
value = node.getAttribute('RemoteWCS');
|
||||
obj['userSymbols'].remoteWCS = parseInt(value, 10) == 1;
|
||||
},
|
||||
'DescribeLayer': function(node, obj) {
|
||||
this.readers.wms.DescribeLayer.apply(this, arguments);
|
||||
},
|
||||
'GetLegendGraphic': function(node, obj) {
|
||||
this.readers.wms.GetLegendGraphic.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1_3_0,
|
||||
ol.parser.ogc.WMSCapabilities_v1);
|
||||
148
src/ol/parser/xml.js
Normal file
148
src/ol/parser/xml.js
Normal file
@@ -0,0 +1,148 @@
|
||||
goog.provide('ol.parser.XML');
|
||||
goog.require('goog.object');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
ol.parser.XML = function() {
|
||||
// clone the namespaces object and set all namespace aliases
|
||||
this.namespaces = goog.object.clone(this.namespaces);
|
||||
this.namespaceAlias = {};
|
||||
for (var alias in this.namespaces) {
|
||||
this.namespaceAlias[this.namespaces[alias]] = alias;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Shorthand for applying one of the named readers given the node
|
||||
* namespace and local name. Readers take two args (node, obj) and
|
||||
* generally extend or modify the second.
|
||||
*
|
||||
* @param {Element|Document} node The node to be read (required).
|
||||
* @param {Object} obj The object to be modified (optional).
|
||||
* @return {Object} The input object, modified (or a new one if none was
|
||||
* provided).
|
||||
*/
|
||||
ol.parser.XML.prototype.readNode = function(node, obj) {
|
||||
if (!obj) {
|
||||
obj = {};
|
||||
}
|
||||
var group = this.readers[node.namespaceURI ?
|
||||
this.namespaceAlias[node.namespaceURI] : this.defaultPrefix];
|
||||
if (group) {
|
||||
var local = node.localName || node.nodeName.split(':').pop();
|
||||
var reader = group[local] || group['*'];
|
||||
if (reader) {
|
||||
reader.apply(this, [node, obj]);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Shorthand for applying the named readers to all children of a node.
|
||||
* For each child of type 1 (element), <readSelf> is called.
|
||||
*
|
||||
* @param {Element|Document} node The node to be read (required).
|
||||
* @param {Object} obj The object to be modified (optional).
|
||||
* @return {Object} The input object, modified.
|
||||
*/
|
||||
ol.parser.XML.prototype.readChildNodes = function(node, obj) {
|
||||
if (!obj) {
|
||||
obj = {};
|
||||
}
|
||||
var children = node.childNodes;
|
||||
var child;
|
||||
for (var i = 0, len = children.length; i < len; ++i) {
|
||||
child = children[i];
|
||||
if (child.nodeType == 1) {
|
||||
this.readNode(child, obj);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the textual value of the node if it exists, or return an
|
||||
* optional default string. Returns an empty string if no first child
|
||||
* exists and no default value is supplied.
|
||||
*
|
||||
* @param {Element} node The element used to look for a first child value.
|
||||
* @param {string} def Optional string to return in the event that no
|
||||
* first child value exists.
|
||||
* @return {string} The value of the first child of the given node.
|
||||
*/
|
||||
ol.parser.XML.prototype.getChildValue = function(node, def) {
|
||||
var value = def || '';
|
||||
if (node) {
|
||||
for (var child = node.firstChild; child; child = child.nextSibling) {
|
||||
switch (child.nodeType) {
|
||||
case 3: // text node
|
||||
case 4: // cdata section
|
||||
value += child.nodeValue;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get an attribute node given the namespace URI and local name.
|
||||
*
|
||||
* @param {Element} node Node on which to search for attribute nodes.
|
||||
* @param {string} uri Namespace URI.
|
||||
* @param {string} name Local name of the attribute (without the prefix).
|
||||
* @return {?Element} An attribute node or null if none found.
|
||||
*/
|
||||
ol.parser.XML.prototype.getAttributeNodeNS = function(node, uri, name) {
|
||||
var attributeNode = null;
|
||||
if (node.getAttributeNodeNS) {
|
||||
attributeNode = node.getAttributeNodeNS(uri, name);
|
||||
} else {
|
||||
var attributes = node.attributes;
|
||||
var potentialNode, fullName;
|
||||
for (var i = 0, len = attributes.length; i < len; ++i) {
|
||||
potentialNode = attributes[i];
|
||||
if (potentialNode.namespaceURI == uri) {
|
||||
fullName = (potentialNode.prefix) ?
|
||||
(potentialNode.prefix + ':' + name) : name;
|
||||
if (fullName == potentialNode.nodeName) {
|
||||
attributeNode = potentialNode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return attributeNode;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get an attribute value given the namespace URI and local name.
|
||||
*
|
||||
* @param {Element} node Node on which to search for an attribute.
|
||||
* @param {string} uri Namespace URI.
|
||||
* @param {string} name Local name of the attribute (without the prefix).
|
||||
* @return {string} An attribute value or and empty string if none found.
|
||||
*/
|
||||
ol.parser.XML.prototype.getAttributeNS = function(node, uri, name) {
|
||||
var attributeValue = '';
|
||||
if (node.getAttributeNS) {
|
||||
attributeValue = node.getAttributeNS(uri, name) || '';
|
||||
} else {
|
||||
var attributeNode = this.getAttributeNodeNS(node, uri, name);
|
||||
if (attributeNode) {
|
||||
attributeValue = attributeNode.nodeValue;
|
||||
}
|
||||
}
|
||||
return attributeValue;
|
||||
};
|
||||
101
test/spec/ol/parser/ogc/exceptionreport.test.js
Normal file
101
test/spec/ol/parser/ogc/exceptionreport.test.js
Normal file
@@ -0,0 +1,101 @@
|
||||
goog.provide('ol.test.parser.ogc.ExceptionReport');
|
||||
|
||||
describe('ol.parser.ogc.exceptionreport', function() {
|
||||
|
||||
var parser = new ol.parser.ogc.ExceptionReport();
|
||||
|
||||
describe('test read exception', function() {
|
||||
var result, exceptions;
|
||||
var url = 'spec/ol/parser/ogc/xml/exceptionreport/wms1_3_0.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
result = parser.read(xhr.getResponseXml());
|
||||
exceptions = result.exceptionReport.exceptions;
|
||||
});
|
||||
it('OCG WMS 1.3.0 exceptions', function() {
|
||||
expect(exceptions.length).toBe(4);
|
||||
var str = 'Plain text message about an error.';
|
||||
expect(goog.string.trim(exceptions[0].text)).toBe(str);
|
||||
expect(exceptions[1].code).toBe('InvalidUpdateSequence');
|
||||
str = ' Another error message, this one with a service exception ' +
|
||||
'code supplied. ';
|
||||
expect(exceptions[1].text).toBe(str);
|
||||
str = 'Error in module <foo.c>, line 42A message that includes angle ' +
|
||||
'brackets in text must be enclosed in a Character Data Section as ' +
|
||||
'in this example. All XML-like markup is ignored except for this ' +
|
||||
'sequence of three closing characters:';
|
||||
expect(goog.string.trim(exceptions[2].text), str);
|
||||
str = '<Module>foo.c</Module> <Error>An error occurred</Error> ' +
|
||||
'<Explanation>Similarly, actual XML can be enclosed in a CDATA ' +
|
||||
'section. A generic parser will ignore that XML, but ' +
|
||||
'application-specific software may choose to process it.' +
|
||||
'</Explanation>';
|
||||
expect(goog.string.trim(exceptions[3].text), str);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test read exception OWSCommon 1.0.0', function() {
|
||||
var result, report, exception;
|
||||
var url = 'spec/ol/parser/ogc/xml/exceptionreport/ows1_0_0.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
result = parser.read(xhr.getResponseXml());
|
||||
report = result.exceptionReport;
|
||||
exception = report.exceptions[0];
|
||||
});
|
||||
it('Version parsed correctly', function() {
|
||||
expect(report.version).toEqual('1.0.0');
|
||||
});
|
||||
it('Language parsed correctly', function() {
|
||||
expect(report.language).toEqual('en');
|
||||
});
|
||||
it('exceptionCode properly parsed', function() {
|
||||
expect(exception.code).toEqual('InvalidParameterValue');
|
||||
});
|
||||
it('locator properly parsed', function() {
|
||||
expect(exception.locator).toEqual('foo');
|
||||
});
|
||||
it('ExceptionText correctly parsed', function() {
|
||||
var msg = 'Update error: Error occured updating features';
|
||||
expect(exception.texts[0]).toEqual(msg);
|
||||
});
|
||||
it('Second ExceptionText correctly parsed', function() {
|
||||
var msg = 'Second exception line';
|
||||
expect(exception.texts[1]).toEqual(msg);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test read exception OWSCommon 1.1.0', function() {
|
||||
var result, report, exception;
|
||||
var url = 'spec/ol/parser/ogc/xml/exceptionreport/ows1_1_0.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
result = parser.read(xhr.getResponseXml());
|
||||
report = result.exceptionReport;
|
||||
exception = report.exceptions[0];
|
||||
});
|
||||
it('Version parsed correctly', function() {
|
||||
expect(report.version).toEqual('1.1.0');
|
||||
});
|
||||
it('Language parsed correctly', function() {
|
||||
expect(report.language).toEqual('en');
|
||||
});
|
||||
it('exceptionCode properly parsed', function() {
|
||||
expect(exception.code).toEqual('InvalidParameterValue');
|
||||
});
|
||||
it('locator properly parsed', function() {
|
||||
expect(exception.locator).toEqual('foo');
|
||||
});
|
||||
it('ExceptionText correctly parsed', function() {
|
||||
var msg = 'Update error: Error occured updating features';
|
||||
expect(exception.texts[0]).toEqual(msg);
|
||||
});
|
||||
it('Second ExceptionText correctly parsed', function() {
|
||||
expect(exception.texts[1]).toEqual('Second exception line');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('goog.net.XhrIo');
|
||||
goog.require('goog.string');
|
||||
goog.require('ol.parser.ogc.ExceptionReport');
|
||||
28
test/spec/ol/parser/ogc/versioned.test.js
Normal file
28
test/spec/ol/parser/ogc/versioned.test.js
Normal file
@@ -0,0 +1,28 @@
|
||||
goog.provide('ol.test.parser.ogc.Versioned');
|
||||
|
||||
describe('ol.parser.ogc.versioned', function() {
|
||||
|
||||
var snippet = '<foo version="2.0.0"></foo>';
|
||||
var snippet2 = '<foo></foo>';
|
||||
|
||||
describe('test constructor', function() {
|
||||
var parser = new ol.parser.ogc.Versioned({version: '1.0.0'});
|
||||
it('new OpenLayers.Format.XML.VersionedOGC returns object', function() {
|
||||
expect(parser instanceof ol.parser.ogc.Versioned).toBeTruthy();
|
||||
});
|
||||
it('constructor sets version correctly', function() {
|
||||
expect(parser.version).toEqual('1.0.0');
|
||||
});
|
||||
it('defaultVersion should be null if not specified', function() {
|
||||
expect(parser.defaultVersion).toBeNull();
|
||||
});
|
||||
it('format has a read function', function() {
|
||||
expect(typeof(parser.read)).toEqual('function');
|
||||
});
|
||||
it('format has a write function', function() {
|
||||
expect(typeof(parser.write)).toEqual('function');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('ol.parser.ogc.Versioned');
|
||||
45
test/spec/ol/parser/ogc/wmscapabilities.test.js
Normal file
45
test/spec/ol/parser/ogc/wmscapabilities.test.js
Normal file
@@ -0,0 +1,45 @@
|
||||
goog.provide('ol.test.parser.ogc.WMSCapabilities');
|
||||
|
||||
describe('test WMSCapabilities', function() {
|
||||
describe('test getVersion', function() {
|
||||
var snippet = '<WMS_Capabilities version="1.3.0" ' +
|
||||
'xmlns="http://www.opengis.net/wms"><Service></Service>' +
|
||||
'</WMS_Capabilities>';
|
||||
var snippet2 = '<WMS_Capabilities xmlns="http://www.opengis.net/wms">' +
|
||||
'<Service></Service></WMS_Capabilities>';
|
||||
it('Version taken from document', function() {
|
||||
var parser = new ol.parser.ogc.WMSCapabilities();
|
||||
var data = parser.read(snippet);
|
||||
expect(data.version).toEqual('1.3.0');
|
||||
});
|
||||
it('Version taken from parser takes preference', function() {
|
||||
var parser = new ol.parser.ogc.WMSCapabilities({version: '1.1.0'});
|
||||
var data = parser.read(snippet);
|
||||
expect(data.version).toEqual('1.1.0');
|
||||
});
|
||||
it('If nothing else is set, defaultVersion should be returned', function() {
|
||||
var parser = new ol.parser.ogc.WMSCapabilities({defaultVersion: '1.1.1'});
|
||||
var data = parser.read(snippet2);
|
||||
expect(data.version).toEqual('1.1.1');
|
||||
});
|
||||
var parser = new ol.parser.ogc.WMSCapabilities({defaultVersion: '1.1.1'});
|
||||
it('Version from options returned', function() {
|
||||
var version = parser.getVersion(null, {version: '1.3.0'});
|
||||
expect(version).toEqual('1.3.0');
|
||||
});
|
||||
var msg = 'defaultVersion returned if no version specified in options ' +
|
||||
'and no version on the format';
|
||||
it(msg, function() {
|
||||
var version = parser.getVersion(null);
|
||||
expect(version).toEqual('1.1.1');
|
||||
});
|
||||
msg = 'version returned of the Format if no version specified in options';
|
||||
it(msg, function() {
|
||||
parser.version = '1.1.0';
|
||||
var version = parser.getVersion(null);
|
||||
expect(version).toEqual('1.1.0');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('ol.parser.ogc.WMSCapabilities');
|
||||
444
test/spec/ol/parser/ogc/wmscapabilities_v1_1_1.test.js
Normal file
444
test/spec/ol/parser/ogc/wmscapabilities_v1_1_1.test.js
Normal file
@@ -0,0 +1,444 @@
|
||||
goog.provide('ol.test.parser.ogc.WMSCapabilities_v1_1_1');
|
||||
|
||||
describe('ol.parser.ogc.wmscapabilities_v1_1_1', function() {
|
||||
|
||||
var parser = new ol.parser.ogc.WMSCapabilities();
|
||||
|
||||
describe('test read exception', function() {
|
||||
var obj, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/exceptionsample.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
obj = parser.read(xhr.getResponseXml());
|
||||
});
|
||||
it('Error reported correctly', function() {
|
||||
expect(!!obj.error).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test read', function() {
|
||||
var obj, capability, getmap, describelayer, getfeatureinfo, layer, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
obj = parser.read(xhr.getResponseXml());
|
||||
capability = obj.capability;
|
||||
getmap = capability.request.getmap;
|
||||
describelayer = capability.request.describelayer;
|
||||
getfeatureinfo = capability.request.getfeatureinfo;
|
||||
layer = capability.layers[2];
|
||||
});
|
||||
it('object contains capability property', function() {
|
||||
expect(capability).toBeTruthy();
|
||||
});
|
||||
it('getmap formats parsed', function() {
|
||||
expect(getmap.formats.length).toEqual(28);
|
||||
});
|
||||
it('getmap href parsed', function() {
|
||||
var url = 'http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&';
|
||||
expect(getmap.href).toEqual(url);
|
||||
});
|
||||
it('getmap.get.href parsed', function() {
|
||||
expect(getmap.get.href).toEqual(getmap.href);
|
||||
});
|
||||
it('getmap.post not available', function() {
|
||||
expect(getmap.post).toBeUndefined();
|
||||
});
|
||||
it('describelayer href parsed', function() {
|
||||
var url = 'http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&';
|
||||
expect(describelayer.href).toEqual(url);
|
||||
});
|
||||
it('describelayer.get.href parsed', function() {
|
||||
expect(describelayer.get.href).toEqual(describelayer.href);
|
||||
});
|
||||
it('describelayer.post not available', function() {
|
||||
expect(describelayer.post).toBeUndefined();
|
||||
});
|
||||
it('getfeatureinfo href parsed', function() {
|
||||
var url = 'http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&';
|
||||
expect(getfeatureinfo.href).toEqual(url);
|
||||
});
|
||||
it('getmap.get.href parsed', function() {
|
||||
expect(getfeatureinfo.get.href).toEqual(getfeatureinfo.href);
|
||||
});
|
||||
it('getfeatureinfo.post set correctly', function() {
|
||||
var url = 'http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&';
|
||||
expect(getfeatureinfo.post.href).toEqual(url);
|
||||
});
|
||||
it('layers parsed', function() {
|
||||
expect(capability.layers).toBeTruthy();
|
||||
});
|
||||
it('correct number of layers parsed', function() {
|
||||
expect(capability.layers.length).toEqual(22);
|
||||
});
|
||||
it('infoFormats set on layer', function() {
|
||||
var infoFormats = ['text/plain', 'text/html', 'application/vnd.ogc.gml'];
|
||||
expect(layer.infoFormats).toEqual(infoFormats);
|
||||
});
|
||||
it('[2] correct layer name', function() {
|
||||
expect(layer.name).toEqual('tiger:tiger_roads');
|
||||
});
|
||||
it('[2] correct layer prefix', function() {
|
||||
expect(layer.prefix).toEqual('tiger');
|
||||
});
|
||||
it('[2] correct layer title', function() {
|
||||
expect(layer.title).toEqual('Manhattan (NY) roads');
|
||||
});
|
||||
it('[2] correct layer abstract', function() {
|
||||
var abstr = 'Highly simplified road layout of Manhattan in New York..';
|
||||
expect(layer['abstract']).toEqual(abstr);
|
||||
});
|
||||
it('[2] correct layer bbox', function() {
|
||||
var bbox = [-74.08769307536667, 40.660618924633326,
|
||||
-73.84653192463333, 40.90178007536667];
|
||||
expect(layer.llbbox).toEqual(bbox);
|
||||
});
|
||||
it('[2] correct styles length', function() {
|
||||
expect(layer.styles.length).toEqual(1);
|
||||
});
|
||||
it('[2] correct style name', function() {
|
||||
expect(layer.styles[0].name).toEqual('tiger_roads');
|
||||
});
|
||||
it('[2] correct legend url', function() {
|
||||
var url = 'http://publicus.opengeo.org:80/geoserver/wms/' +
|
||||
'GetLegendGraphic?VERSION=1.0.0&FORMAT=image/png&WIDTH=20&' +
|
||||
'HEIGHT=20&LAYER=tiger:tiger_roads';
|
||||
expect(layer.styles[0].legend.href).toEqual(url);
|
||||
});
|
||||
it('[2] correct legend format', function() {
|
||||
expect(layer.styles[0].legend.format).toEqual('image/png');
|
||||
});
|
||||
it('[2] correct queryable attribute', function() {
|
||||
expect(layer.queryable).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test layers', function() {
|
||||
var obj, capability, layers = {}, rootlayer, identifiers, authorities;
|
||||
var featurelist, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
obj = parser.read(xhr.getResponseXml());
|
||||
capability = obj.capability;
|
||||
for (var i = 0, len = capability.layers.length; i < len; i++) {
|
||||
if ('name' in capability.layers[i]) {
|
||||
layers[capability.layers[i].name] = capability.layers[i];
|
||||
}
|
||||
}
|
||||
rootlayer = capability.layers[capability.layers.length - 1];
|
||||
identifiers = layers['ROADS_RIVERS'].identifiers;
|
||||
authorities = layers['ROADS_RIVERS'].authorityURLs;
|
||||
featurelist = layers['ROADS_RIVERS'].featureListURL;
|
||||
});
|
||||
it('SRS parsed correctly for root layer', function() {
|
||||
expect(rootlayer.srs).toEqual({'EPSG:4326': true});
|
||||
});
|
||||
it('Inheritance of SRS handled correctly when adding SRSes', function() {
|
||||
var srs = {'EPSG:4326': true, 'EPSG:26986': true};
|
||||
expect(layers['ROADS_RIVERS'].srs).toEqual(srs);
|
||||
});
|
||||
var msg = 'Inheritance of SRS handled correctly when redeclaring an ' +
|
||||
'inherited SRS';
|
||||
it(msg, function() {
|
||||
expect(layers['Temperature'].srs).toEqual({'EPSG:4326': true});
|
||||
});
|
||||
it('Correct bbox and res from BoundingBox', function() {
|
||||
var bbox = layers['ROADS_RIVERS'].bbox['EPSG:26986'];
|
||||
expect(bbox.bbox).toEqual([189000, 834000, 285000, 962000]);
|
||||
expect(bbox.res).toEqual({x: 1, y: 1});
|
||||
});
|
||||
it('Correct bbox and res from BoundingBox (override)', function() {
|
||||
bbox = layers['ROADS_RIVERS'].bbox['EPSG:4326'];
|
||||
expect(bbox.bbox).toEqual([-71.63, 41.75, -70.78, 42.90]);
|
||||
expect(bbox.res).toEqual({x: 0.01, y: 0.01});
|
||||
});
|
||||
it('Correctly inherited bbox and resolution', function() {
|
||||
bbox = layers['ROADS_1M'].bbox['EPSG:26986'];
|
||||
expect(bbox.bbox).toEqual([189000, 834000, 285000, 962000]);
|
||||
expect(bbox.res).toEqual({x: 1, y: 1});
|
||||
});
|
||||
it('got identifiers from layer ROADS_RIVERS', function() {
|
||||
expect(identifiers).toBeTruthy();
|
||||
});
|
||||
it('authority attribute from Identifiers parsed correctly', function() {
|
||||
expect('DIF_ID' in identifiers).toBeTruthy();
|
||||
});
|
||||
it('Identifier value parsed correctly', function() {
|
||||
expect(identifiers['DIF_ID']).toEqual('123456');
|
||||
});
|
||||
it('AuthorityURLs parsed and inherited correctly', function() {
|
||||
expect('DIF_ID' in authorities).toBeTruthy();
|
||||
});
|
||||
it('OnlineResource in AuthorityURLs parsed correctly', function() {
|
||||
var url = 'http://gcmd.gsfc.nasa.gov/difguide/whatisadif.html';
|
||||
expect(authorities['DIF_ID']).toEqual(url);
|
||||
});
|
||||
it('layer has FeatureListURL', function() {
|
||||
expect(featurelist).toBeTruthy();
|
||||
});
|
||||
it('FeatureListURL format parsed correctly', function() {
|
||||
expect(featurelist.format).toEqual('application/vnd.ogc.se_xml');
|
||||
});
|
||||
it('FeatureListURL OnlineResource parsed correctly', function() {
|
||||
var url = 'http://www.university.edu/data/roads_rivers.gml';
|
||||
expect(featurelist.href).toEqual(url);
|
||||
});
|
||||
it('queryable property inherited correctly', function() {
|
||||
expect(layers['Pressure'].queryable).toBeTruthy();
|
||||
});
|
||||
it('queryable property has correct default value', function() {
|
||||
expect(layers['ozone_image'].queryable).toBeFalsy();
|
||||
});
|
||||
it('cascaded property parsed correctly', function() {
|
||||
expect(layers['population'].cascaded).toEqual(1);
|
||||
});
|
||||
it('fixedWidth property correctly parsed', function() {
|
||||
expect(layers['ozone_image'].fixedWidth).toEqual(512);
|
||||
});
|
||||
it('fixedHeight property correctly parsed', function() {
|
||||
expect(layers['ozone_image'].fixedHeight).toEqual(256);
|
||||
});
|
||||
it('opaque property parsed correctly', function() {
|
||||
expect(layers['ozone_image'].opaque).toBeTruthy();
|
||||
});
|
||||
it('noSubsets property parsed correctly', function() {
|
||||
expect(layers['ozone_image'].noSubsets).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test dimensions', function() {
|
||||
var obj, capability, layers = {}, time, elevation, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
obj = parser.read(xhr.getResponseXml());
|
||||
capability = obj.capability;
|
||||
for (var i = 0, len = capability.layers.length; i < len; i++) {
|
||||
if ('name' in capability.layers[i]) {
|
||||
layers[capability.layers[i].name] = capability.layers[i];
|
||||
}
|
||||
}
|
||||
time = layers['Clouds'].dimensions.time;
|
||||
elevation = layers['Pressure'].dimensions.elevation;
|
||||
});
|
||||
it('Default time value parsed correctly', function() {
|
||||
expect(time['default']).toEqual('2000-08-22');
|
||||
});
|
||||
it('Currect number of time extent values/periods', function() {
|
||||
expect(time.values.length).toEqual(1);
|
||||
});
|
||||
it('Time extent values parsed correctly', function() {
|
||||
expect(time.values[0]).toEqual('1999-01-01/2000-08-22/P1D');
|
||||
});
|
||||
it('Dimension units parsed correctly', function() {
|
||||
expect(elevation.units).toEqual('EPSG:5030');
|
||||
});
|
||||
it('Default elevation value parsed correctly', function() {
|
||||
expect(elevation['default']).toEqual('0');
|
||||
});
|
||||
it('NearestValue parsed correctly', function() {
|
||||
expect(elevation.nearestVal).toBeTruthy();
|
||||
});
|
||||
it('Absense of MultipleValues handled correctly', function() {
|
||||
expect(elevation.multipleVal).toBeFalsy();
|
||||
});
|
||||
it('Parsing of comma-separated values done correctly', function() {
|
||||
expect(elevation.values).toEqual(['0', '1000', '3000', '5000', '10000']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test contact info', function() {
|
||||
var obj, service, contactinfo, personPrimary, addr, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
obj = parser.read(xhr.getResponseXml());
|
||||
service = obj.service;
|
||||
contactinfo = service.contactInformation;
|
||||
personPrimary = contactinfo.personPrimary;
|
||||
addr = contactinfo.contactAddress;
|
||||
});
|
||||
it('object contains contactInformation property', function() {
|
||||
expect(contactinfo).toBeTruthy();
|
||||
});
|
||||
it('object contains personPrimary property', function() {
|
||||
expect(personPrimary).toBeTruthy();
|
||||
});
|
||||
it('ContactPerson parsed correctly', function() {
|
||||
expect(personPrimary.person).toEqual('Jeff deLaBeaujardiere');
|
||||
});
|
||||
it('ContactOrganization parsed correctly', function() {
|
||||
expect(personPrimary.organization).toEqual('NASA');
|
||||
});
|
||||
it('ContactPosition parsed correctly', function() {
|
||||
expect(contactinfo.position).toEqual('Computer Scientist');
|
||||
});
|
||||
it('object contains contactAddress property', function() {
|
||||
expect(addr).toBeTruthy();
|
||||
});
|
||||
it('AddressType parsed correctly', function() {
|
||||
expect(addr.type).toEqual('postal');
|
||||
});
|
||||
it('Address parsed correctly', function() {
|
||||
var address = 'NASA Goddard Space Flight Center, Code 933';
|
||||
expect(addr.address).toEqual(address);
|
||||
});
|
||||
it('City parsed correctly', function() {
|
||||
expect(addr.city).toEqual('Greenbelt');
|
||||
});
|
||||
it('StateOrProvince parsed correctly', function() {
|
||||
expect(addr.stateOrProvince).toEqual('MD');
|
||||
});
|
||||
it('PostCode parsed correctly', function() {
|
||||
expect(addr.postcode).toEqual('20771');
|
||||
});
|
||||
it('Country parsed correctly', function() {
|
||||
expect(addr.country).toEqual('USA');
|
||||
});
|
||||
it('ContactVoiceTelephone parsed correctly', function() {
|
||||
expect(contactinfo.phone).toEqual('+1 301 286-1569');
|
||||
});
|
||||
it('ContactFacsimileTelephone parsed correctly', function() {
|
||||
expect(contactinfo.fax).toEqual('+1 301 286-1777');
|
||||
});
|
||||
it('ContactElectronicMailAddress parsed correctly', function() {
|
||||
expect(contactinfo.email).toEqual('delabeau@iniki.gsfc.nasa.gov');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Test fees and constraints', function() {
|
||||
var obj, service, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
obj = parser.read(xhr.getResponseXml());
|
||||
service = obj.service;
|
||||
});
|
||||
it('Fees=none handled correctly', function() {
|
||||
expect('fees' in service).toBeFalsy();
|
||||
});
|
||||
it('AccessConstraints=none handled correctly', function() {
|
||||
expect('accessConstraints' in service).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Test requests', function() {
|
||||
var obj, request, exception, userSymbols, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
obj = parser.read(xhr.getResponseXml());
|
||||
request = obj.capability.request;
|
||||
exception = obj.capability.exception;
|
||||
userSymbols = obj.capability.userSymbols;
|
||||
});
|
||||
it('request property exists', function() {
|
||||
expect(request).toBeTruthy();
|
||||
});
|
||||
it('got GetMap request', function() {
|
||||
expect('getmap' in request).toBeTruthy();
|
||||
});
|
||||
it('got GetFeatureInfo request', function() {
|
||||
expect('getfeatureinfo' in request).toBeTruthy();
|
||||
});
|
||||
it('GetFeatureInfo formats correctly parsed', function() {
|
||||
var formats = ['text/plain', 'text/html', 'application/vnd.ogc.gml'];
|
||||
expect(request.getfeatureinfo.formats).toEqual(formats);
|
||||
});
|
||||
it('got DescribeLayer request', function() {
|
||||
expect('describelayer' in request).toBeTruthy();
|
||||
});
|
||||
it('got GetLegendGraphic request', function() {
|
||||
expect('getlegendgraphic' in request).toBeTruthy();
|
||||
});
|
||||
it('exception property exists', function() {
|
||||
expect(exception).toBeTruthy();
|
||||
});
|
||||
it('Exception Format parsed', function() {
|
||||
expect(exception.formats).toEqual(['application/vnd.ogc.se_xml']);
|
||||
});
|
||||
it('userSymbols property exists', function() {
|
||||
expect(userSymbols).toBeTruthy();
|
||||
});
|
||||
it('supportSLD parsed', function() {
|
||||
expect(userSymbols.supportSLD).toBeTruthy();
|
||||
});
|
||||
it('userLayer parsed', function() {
|
||||
expect(userSymbols.userLayer).toBeTruthy();
|
||||
});
|
||||
it('userStyle parsed', function() {
|
||||
expect(userSymbols.userStyle).toBeTruthy();
|
||||
});
|
||||
it('remoteWFS parsed', function() {
|
||||
expect(userSymbols.remoteWFS).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test ogc', function() {
|
||||
var obj, capability, attribution, keywords, metadataURLs, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
obj = parser.read(xhr.getResponseXml());
|
||||
capability = obj.capability;
|
||||
attribution = capability.layers[2].attribution;
|
||||
keywords = capability.layers[0].keywords;
|
||||
metadataURLs = capability.layers[0].metadataURLs;
|
||||
});
|
||||
it('attribution title parsed correctly.', function() {
|
||||
expect(attribution.title).toEqual('State College University');
|
||||
});
|
||||
it('attribution href parsed correctly.', function() {
|
||||
expect(attribution.href).toEqual('http://www.university.edu/');
|
||||
});
|
||||
it('attribution logo url parsed correctly.', function() {
|
||||
var url = 'http://www.university.edu/icons/logo.gif';
|
||||
expect(attribution.logo.href).toEqual(url);
|
||||
});
|
||||
it('attribution logo format parsed correctly.', function() {
|
||||
expect(attribution.logo.format).toEqual('image/gif');
|
||||
});
|
||||
it('attribution logo width parsed correctly.', function() {
|
||||
expect(attribution.logo.width).toEqual('100');
|
||||
});
|
||||
it('attribution logo height parsed correctly.', function() {
|
||||
expect(attribution.logo.height).toEqual('100');
|
||||
});
|
||||
it('layer has 3 keywords.', function() {
|
||||
expect(keywords.length).toEqual(3);
|
||||
});
|
||||
it('1st keyword parsed correctly.', function() {
|
||||
expect(keywords[0].value).toEqual('road');
|
||||
});
|
||||
it('layer has 2 metadata urls.', function() {
|
||||
expect(metadataURLs.length).toEqual(2);
|
||||
});
|
||||
it('type parsed correctly.', function() {
|
||||
expect(metadataURLs[0].type).toEqual('FGDC');
|
||||
});
|
||||
it('format parsed correctly.', function() {
|
||||
expect(metadataURLs[0].format).toEqual('text/plain');
|
||||
});
|
||||
it('href parsed correctly.', function() {
|
||||
var href = 'http://www.university.edu/metadata/roads.txt';
|
||||
expect(metadataURLs[0].href).toEqual(href);
|
||||
});
|
||||
it('layer.minScale is correct', function() {
|
||||
expect(Math.round(capability.layers[0].minScale)).toEqual(250000);
|
||||
});
|
||||
it('layer.maxScale is correct', function() {
|
||||
expect(Math.round(capability.layers[0].maxScale)).toEqual(1000);
|
||||
});
|
||||
it('layer.minScale for max="Infinity" is correct', function() {
|
||||
expect(capability.layers[1].minScale).toBeUndefined();
|
||||
});
|
||||
it('layer.maxScale for min="0" is correct', function() {
|
||||
expect(capability.layers[1].maxScale).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('goog.net.XhrIo');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities');
|
||||
74
test/spec/ol/parser/ogc/wmscapabilities_v1_1_1_WMSC.test.js
Normal file
74
test/spec/ol/parser/ogc/wmscapabilities_v1_1_1_WMSC.test.js
Normal file
@@ -0,0 +1,74 @@
|
||||
goog.provide('ol.test.parser.ogc.WMSCapabilities_v1_1_1_WMSC');
|
||||
|
||||
describe('ol.parser.ogc.wmscapabilities_v1_1_1_wmsc', function() {
|
||||
|
||||
var parser = new ol.parser.ogc.WMSCapabilities({
|
||||
profile: 'WMSC',
|
||||
allowFallback: true
|
||||
});
|
||||
|
||||
describe('test read', function() {
|
||||
var obj, tilesets, tileset, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1_WMSC/wmsc.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
obj = parser.read(xhr.getResponseXml());
|
||||
tilesets = obj.capability.vendorSpecific.tileSets;
|
||||
tileset = tilesets[0];
|
||||
});
|
||||
it('We expect 2 tilesets to be parsed', function() {
|
||||
expect(tilesets.length).toEqual(2);
|
||||
});
|
||||
it('BBOX correctly parsed', function() {
|
||||
var bbox = [-13697515.466796875, 5165920.118906248,
|
||||
-13619243.94984375, 5244191.635859374];
|
||||
expect(tileset.bbox['EPSG:900913'].bbox).toEqual(bbox);
|
||||
});
|
||||
it('Format correctly parsed', function() {
|
||||
expect(tileset.format).toEqual('image/png');
|
||||
});
|
||||
it('Height correctly parsed', function() {
|
||||
expect(tileset.height).toEqual(256);
|
||||
});
|
||||
it('Width correctly parsed', function() {
|
||||
expect(tileset.width).toEqual(256);
|
||||
});
|
||||
it('Layers correctly parsed', function() {
|
||||
expect(tileset.layers).toEqual('medford:hydro');
|
||||
});
|
||||
it('SRS correctly parsed', function() {
|
||||
expect(tileset.srs['EPSG:900913']).toBeTruthy();
|
||||
});
|
||||
it('Resolutions correctly parsed', function() {
|
||||
var resolutions = [156543.03390625, 78271.516953125, 39135.7584765625,
|
||||
19567.87923828125, 9783.939619140625, 4891.9698095703125,
|
||||
2445.9849047851562, 1222.9924523925781, 611.4962261962891,
|
||||
305.74811309814453, 152.87405654907226, 76.43702827453613,
|
||||
38.218514137268066, 19.109257068634033, 9.554628534317017,
|
||||
4.777314267158508, 2.388657133579254, 1.194328566789627,
|
||||
0.5971642833948135, 0.29858214169740677, 0.14929107084870338,
|
||||
0.07464553542435169, 0.037322767712175846, 0.018661383856087923,
|
||||
0.009330691928043961, 0.004665345964021981];
|
||||
expect(tileset.resolutions).toEqual(resolutions);
|
||||
});
|
||||
it('Styles correctly parsed', function() {
|
||||
expect(tileset.styles).toEqual('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('test fallback', function() {
|
||||
var obj, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1_WMSC/fallback.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
obj = parser.read(xhr.getResponseXml());
|
||||
});
|
||||
it('layers parsed with allowFallback true', function() {
|
||||
expect(obj.capability.layers.length).toEqual(2);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('goog.net.XhrIo');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities');
|
||||
297
test/spec/ol/parser/ogc/wmscapabilities_v1_3_0.test.js
Normal file
297
test/spec/ol/parser/ogc/wmscapabilities_v1_3_0.test.js
Normal file
@@ -0,0 +1,297 @@
|
||||
goog.provide('ol.test.parser.ogc.WMSCapabilities_v1_3_0');
|
||||
|
||||
describe('ol.parser.ogc.wmscapabilities_v1_3_0', function() {
|
||||
|
||||
var parser = new ol.parser.ogc.WMSCapabilities();
|
||||
|
||||
var obj, capability, layers = {}, rootlayer, identifiers, authorities;
|
||||
var featurelist, time, elevation, service, contactinfo, personPrimary, addr;
|
||||
var request, exception, attribution, keywords, metadataURLs, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_3_0/ogcsample.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
obj = parser.read(xhr.getResponseXml());
|
||||
capability = obj.capability;
|
||||
for (var i = 0, len = capability.layers.length; i < len; i++) {
|
||||
if ('name' in capability.layers[i]) {
|
||||
layers[capability.layers[i].name] = capability.layers[i];
|
||||
}
|
||||
}
|
||||
rootlayer = capability.layers[capability.layers.length - 1];
|
||||
identifiers = layers['ROADS_RIVERS'].identifiers;
|
||||
authorities = layers['ROADS_RIVERS'].authorityURLs;
|
||||
featurelist = layers['ROADS_RIVERS'].featureListURL;
|
||||
time = layers['Clouds'].dimensions.time;
|
||||
elevation = layers['Pressure'].dimensions.elevation;
|
||||
service = obj.service;
|
||||
contactinfo = service.contactInformation;
|
||||
personPrimary = contactinfo.personPrimary;
|
||||
addr = contactinfo.contactAddress;
|
||||
request = obj.capability.request;
|
||||
exception = obj.capability.exception;
|
||||
attribution = capability.layers[2].attribution;
|
||||
keywords = capability.layers[0].keywords;
|
||||
metadataURLs = capability.layers[0].metadataURLs;
|
||||
});
|
||||
|
||||
describe('test read exception', function() {
|
||||
var result, url;
|
||||
url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_3_0/exceptionsample.xml';
|
||||
goog.net.XhrIo.send(url, function(e) {
|
||||
var xhr = e.target;
|
||||
result = parser.read(xhr.getResponseXml());
|
||||
});
|
||||
it('Error reported correctly', function() {
|
||||
expect(!!result.error).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test layers', function() {
|
||||
it('SRS parsed correctly for root layer', function() {
|
||||
expect(rootlayer.srs).toEqual({'CRS:84': true});
|
||||
});
|
||||
it('Inheritance of SRS handled correctly when adding SRSes', function() {
|
||||
var srs = {'CRS:84': true, 'EPSG:26986': true};
|
||||
expect(layers['ROADS_RIVERS'].srs).toEqual(srs);
|
||||
});
|
||||
it('Inheritance of SRS handled correctly when redeclaring an' +
|
||||
' inherited SRS', function() {
|
||||
expect(layers['Temperature'].srs).toEqual({'CRS:84': true});
|
||||
});
|
||||
it('infoFormats set correctly on layer', function() {
|
||||
var infoFormats = ['text/xml', 'text/plain', 'text/html'];
|
||||
expect(layers['Temperature'].infoFormats).toEqual(infoFormats);
|
||||
});
|
||||
it('Correct resolution and bbox from BoundingBox', function() {
|
||||
var bbox = layers['ROADS_RIVERS'].bbox['EPSG:26986'];
|
||||
expect(bbox.bbox).toEqual([189000, 834000, 285000, 962000]);
|
||||
expect(bbox.res).toEqual({x: 1, y: 1});
|
||||
});
|
||||
it('Correct resolution and bbox from BoundingBox (override)', function() {
|
||||
var bbox = layers['ROADS_RIVERS'].bbox['CRS:84'];
|
||||
expect(bbox.bbox).toEqual([-71.63, 41.75, -70.78, 42.90]);
|
||||
expect(bbox.res).toEqual({x: 0.01, y: 0.01});
|
||||
});
|
||||
it('Correctly inherited bbox and resolution', function() {
|
||||
var bbox = layers['ROADS_1M'].bbox['EPSG:26986'];
|
||||
expect(bbox.bbox).toEqual([189000, 834000, 285000, 962000]);
|
||||
expect(bbox.res).toEqual({x: 1, y: 1});
|
||||
});
|
||||
it('got identifiers from layer ROADS_RIVERS', function() {
|
||||
expect(identifiers).toBeTruthy();
|
||||
});
|
||||
it('authority attribute from Identifiers parsed correctly', function() {
|
||||
expect('DIF_ID' in identifiers).toBeTruthy();
|
||||
});
|
||||
it('Identifier value parsed correctly', function() {
|
||||
expect(identifiers['DIF_ID']).toEqual('123456');
|
||||
});
|
||||
it('AuthorityURLs parsed and inherited correctly', function() {
|
||||
expect('DIF_ID' in authorities).toBeTruthy();
|
||||
});
|
||||
it('OnlineResource in AuthorityURLs parsed correctly', function() {
|
||||
var url = 'http://gcmd.gsfc.nasa.gov/difguide/whatisadif.html';
|
||||
expect(authorities['DIF_ID']).toEqual(url);
|
||||
});
|
||||
it('layer has FeatureListURL', function() {
|
||||
expect(featurelist).toBeTruthy();
|
||||
});
|
||||
it('FeatureListURL format parsed correctly', function() {
|
||||
expect(featurelist.format).toEqual('XML');
|
||||
});
|
||||
it('FeatureListURL OnlineResource parsed correctly', function() {
|
||||
var url = 'http://www.university.edu/data/roads_rivers.gml';
|
||||
expect(featurelist.href).toEqual(url);
|
||||
});
|
||||
it('queryable property inherited correctly', function() {
|
||||
expect(layers['Pressure'].queryable).toBeTruthy();
|
||||
});
|
||||
it('queryable property has correct default value', function() {
|
||||
expect(layers['ozone_image'].queryable).toBeFalsy();
|
||||
});
|
||||
it('cascaded property parsed correctly', function() {
|
||||
expect(layers['population'].cascaded).toEqual(1);
|
||||
});
|
||||
it('fixedWidth property correctly parsed', function() {
|
||||
expect(layers['ozone_image'].fixedWidth).toEqual(512);
|
||||
});
|
||||
it('fixedHeight property correctly parsed', function() {
|
||||
expect(layers['ozone_image'].fixedHeight).toEqual(256);
|
||||
});
|
||||
it('opaque property parsed correctly', function() {
|
||||
expect(layers['ozone_image'].opaque).toBeTruthy();
|
||||
});
|
||||
it('noSubsets property parsed correctly', function() {
|
||||
expect(layers['ozone_image'].noSubsets).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test dimensions', function() {
|
||||
it('Default time value parsed correctly', function() {
|
||||
expect(time['default']).toEqual('2000-08-22');
|
||||
});
|
||||
it('Currect number of time extent values/periods', function() {
|
||||
expect(time.values.length).toEqual(1);
|
||||
});
|
||||
it('Time extent values parsed correctly', function() {
|
||||
expect(time.values[0]).toEqual('1999-01-01/2000-08-22/P1D');
|
||||
});
|
||||
it('Dimension units parsed correctly', function() {
|
||||
expect(elevation.units).toEqual('CRS:88');
|
||||
});
|
||||
it('Default elevation value parsed correctly', function() {
|
||||
expect(elevation['default']).toEqual('0');
|
||||
});
|
||||
it('NearestValue parsed correctly', function() {
|
||||
expect(elevation.nearestVal).toBeTruthy();
|
||||
});
|
||||
it('Absense of MultipleValues handled correctly', function() {
|
||||
expect(elevation.multipleVal).toBeFalsy();
|
||||
});
|
||||
it('Parsing of comma-separated values done correctly', function() {
|
||||
expect(elevation.values).toEqual(['0', '1000', '3000', '5000', '10000']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test contact info', function() {
|
||||
it('object contains contactInformation property', function() {
|
||||
expect(contactinfo).toBeTruthy();
|
||||
});
|
||||
it('object contains personPrimary property', function() {
|
||||
expect(personPrimary).toBeTruthy();
|
||||
});
|
||||
it('ContactPerson parsed correctly', function() {
|
||||
expect(personPrimary.person).toEqual('Jeff Smith');
|
||||
});
|
||||
it('ContactOrganization parsed correctly', function() {
|
||||
expect(personPrimary.organization).toEqual('NASA');
|
||||
});
|
||||
it('ContactPosition parsed correctly', function() {
|
||||
expect(contactinfo.position).toEqual('Computer Scientist');
|
||||
});
|
||||
it('object contains contactAddress property', function() {
|
||||
expect(addr).toBeTruthy();
|
||||
});
|
||||
it('AddressType parsed correctly', function() {
|
||||
expect(addr.type).toEqual('postal');
|
||||
});
|
||||
it('Address parsed correctly', function() {
|
||||
expect(addr.address).toEqual('NASA Goddard Space Flight Center');
|
||||
});
|
||||
it('City parsed correctly', function() {
|
||||
expect(addr.city).toEqual('Greenbelt');
|
||||
});
|
||||
it('StateOrProvince parsed correctly', function() {
|
||||
expect(addr.stateOrProvince).toEqual('MD');
|
||||
});
|
||||
it('PostCode parsed correctly', function() {
|
||||
expect(addr.postcode).toEqual('20771');
|
||||
});
|
||||
it('Country parsed correctly', function() {
|
||||
expect(addr.country).toEqual('USA');
|
||||
});
|
||||
it('ContactVoiceTelephone parsed correctly', function() {
|
||||
expect(contactinfo.phone).toEqual('+1 301 555-1212');
|
||||
});
|
||||
it('ContactElectronicMailAddress parsed correctly', function() {
|
||||
expect(contactinfo.email).toEqual('user@host.com');
|
||||
});
|
||||
});
|
||||
|
||||
describe('test fees and constraints', function() {
|
||||
it('Fees=none handled correctly', function() {
|
||||
expect('fees' in service).toBeFalsy();
|
||||
});
|
||||
it('AccessConstraints=none handled correctly', function() {
|
||||
expect('accessConstraints' in service).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test requests', function() {
|
||||
it('request property exists', function() {
|
||||
expect(request).toBeTruthy();
|
||||
});
|
||||
it('got GetMap request', function() {
|
||||
expect('getmap' in request).toBeTruthy();
|
||||
});
|
||||
it('got GetFeatureInfo request', function() {
|
||||
expect('getfeatureinfo' in request).toBeTruthy();
|
||||
});
|
||||
it('GetFeatureInfo formats correctly parsed', function() {
|
||||
var formats = ['text/xml', 'text/plain', 'text/html'];
|
||||
expect(request.getfeatureinfo.formats).toEqual(formats);
|
||||
});
|
||||
it('exception property exists', function() {
|
||||
expect(exception).toBeTruthy();
|
||||
});
|
||||
it('Exception Format parsed', function() {
|
||||
var formats = ['XML', 'INIMAGE', 'BLANK'];
|
||||
expect(exception.formats).toEqual(formats);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test ogc', function() {
|
||||
it('attribution title parsed correctly.', function() {
|
||||
expect(attribution.title).toEqual('State College University');
|
||||
});
|
||||
it('attribution href parsed correctly.', function() {
|
||||
expect(attribution.href).toEqual('http://www.university.edu/');
|
||||
});
|
||||
it('attribution logo url parsed correctly.', function() {
|
||||
var url = 'http://www.university.edu/icons/logo.gif';
|
||||
expect(attribution.logo.href).toEqual(url);
|
||||
});
|
||||
it('attribution logo format parsed correctly.', function() {
|
||||
expect(attribution.logo.format).toEqual('image/gif');
|
||||
});
|
||||
it('attribution logo width parsed correctly.', function() {
|
||||
expect(attribution.logo.width).toEqual('100');
|
||||
});
|
||||
it('attribution logo height parsed correctly.', function() {
|
||||
expect(attribution.logo.height).toEqual('100');
|
||||
});
|
||||
it('layer has 3 keywords.', function() {
|
||||
expect(keywords.length).toEqual(3);
|
||||
});
|
||||
it('1st keyword parsed correctly.', function() {
|
||||
expect(keywords[0].value).toEqual('road');
|
||||
});
|
||||
it('layer has 2 metadata urls.', function() {
|
||||
expect(metadataURLs.length).toEqual(2);
|
||||
});
|
||||
it('type parsed correctly.', function() {
|
||||
expect(metadataURLs[0].type).toEqual('FGDC:1998');
|
||||
});
|
||||
it('format parsed correctly.', function() {
|
||||
expect(metadataURLs[0].format).toEqual('text/plain');
|
||||
});
|
||||
it('href parsed correctly.', function() {
|
||||
var url = 'http://www.university.edu/metadata/roads.txt';
|
||||
expect(metadataURLs[0].href).toEqual(url);
|
||||
});
|
||||
it('layer.minScale is correct', function() {
|
||||
var minScale = 250000;
|
||||
expect(capability.layers[0].minScale).toEqual(minScale.toPrecision(16));
|
||||
});
|
||||
it('layer.maxScale is correct', function() {
|
||||
var maxScale = 1000;
|
||||
expect(capability.layers[0].maxScale).toEqual(maxScale.toPrecision(16));
|
||||
});
|
||||
});
|
||||
|
||||
describe('test WMS 1.3 specials', function() {
|
||||
it('LayerLimit parsed correctly', function() {
|
||||
expect(obj.service.layerLimit).toEqual(16);
|
||||
});
|
||||
it('MaxHeight parsed correctly', function() {
|
||||
expect(obj.service.maxHeight).toEqual(2048);
|
||||
});
|
||||
it('MaxWidth parsed correctly', function() {
|
||||
expect(obj.service.maxWidth).toEqual(2048);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('goog.net.XhrIo');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities');
|
||||
9
test/spec/ol/parser/ogc/xml/exceptionreport/ows1_0_0.xml
Normal file
9
test/spec/ol/parser/ogc/xml/exceptionreport/ows1_0_0.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ows:ExceptionReport language="en" version="1.0.0"
|
||||
xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">
|
||||
<ows:Exception locator="foo" exceptionCode="InvalidParameterValue">
|
||||
<ows:ExceptionText>Update error: Error occured updating features</ows:ExceptionText>
|
||||
<ows:ExceptionText>Second exception line</ows:ExceptionText>
|
||||
</ows:Exception>
|
||||
</ows:ExceptionReport>
|
||||
9
test/spec/ol/parser/ogc/xml/exceptionreport/ows1_1_0.xml
Normal file
9
test/spec/ol/parser/ogc/xml/exceptionreport/ows1_1_0.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ows:ExceptionReport xml:lang="en" version="1.1.0"
|
||||
xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows/1.1">
|
||||
<ows:Exception locator="foo" exceptionCode="InvalidParameterValue">
|
||||
<ows:ExceptionText>Update error: Error occured updating features</ows:ExceptionText>
|
||||
<ows:ExceptionText>Second exception line</ows:ExceptionText>
|
||||
</ows:Exception>
|
||||
</ows:ExceptionReport>
|
||||
16
test/spec/ol/parser/ogc/xml/exceptionreport/wms1_3_0.xml
Normal file
16
test/spec/ol/parser/ogc/xml/exceptionreport/wms1_3_0.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.opengis.net/ogc
|
||||
http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">
|
||||
<ServiceException> Plain text message about an error. </ServiceException>
|
||||
<ServiceException code="InvalidUpdateSequence"> Another error message, this one with a service exception code supplied. </ServiceException>
|
||||
<ServiceException>
|
||||
<![CDATA[ Error in module <foo.c>, line 42
|
||||
A message that includes angle brackets in text must be enclosed in a Character Data Section as in this example. All XML-like markup is ignored except for this sequence of three closing characters:' +
|
||||
]]>
|
||||
</ServiceException>
|
||||
<ServiceException>
|
||||
<![CDATA[ <Module>foo.c</Module> <Error>An error occurred</Error> <Explanation>Similarly, actual XML can be enclosed in a CDATA section. A generic parser will ignore that XML, but application-specific software may choose to process it.</Explanation> ]]>
|
||||
</ServiceException>
|
||||
</ServiceExceptionReport>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/WMS_exception_1_1_1.dtd">
|
||||
<ServiceExceptionReport version="1.1.1"><ServiceException> Plain text message about an error. </ServiceException>
|
||||
</ServiceExceptionReport>
|
||||
4497
test/spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml
Normal file
4497
test/spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml
Normal file
File diff suppressed because it is too large
Load Diff
283
test/spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml
Normal file
283
test/spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml
Normal file
@@ -0,0 +1,283 @@
|
||||
<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
|
||||
<!DOCTYPE WMT_MS_Capabilities SYSTEM
|
||||
"http://schemas.opengis.net/wms/1.1.1/capabilities_1_1_1.dtd"
|
||||
[
|
||||
<!ELEMENT VendorSpecificCapabilities EMPTY>
|
||||
]>
|
||||
|
||||
<WMT_MS_Capabilities version="1.1.1" updateSequence="0">
|
||||
<Service>
|
||||
|
||||
<Name>OGC:WMS</Name>
|
||||
<Title>Acme Corp. Map Server</Title>
|
||||
<Abstract>WMT Map Server maintained by Acme Corporation. Contact: webmaster@wmt.acme.com. High-quality maps showing roadrunner nests and possible ambush locations.</Abstract>
|
||||
<KeywordList>
|
||||
|
||||
<Keyword>bird</Keyword>
|
||||
<Keyword>roadrunner</Keyword>
|
||||
<Keyword>ambush</Keyword>
|
||||
</KeywordList>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
|
||||
xlink:href="http://hostname/" />
|
||||
|
||||
<ContactInformation>
|
||||
<ContactPersonPrimary>
|
||||
<ContactPerson>Jeff deLaBeaujardiere</ContactPerson>
|
||||
<ContactOrganization>NASA</ContactOrganization>
|
||||
</ContactPersonPrimary>
|
||||
<ContactPosition>Computer Scientist</ContactPosition>
|
||||
<ContactAddress>
|
||||
|
||||
<AddressType>postal</AddressType>
|
||||
<Address>NASA Goddard Space Flight Center, Code 933</Address>
|
||||
<City>Greenbelt</City>
|
||||
<StateOrProvince>MD</StateOrProvince>
|
||||
<PostCode>20771</PostCode>
|
||||
<Country>USA</Country>
|
||||
|
||||
</ContactAddress>
|
||||
<ContactVoiceTelephone>+1 301 286-1569</ContactVoiceTelephone>
|
||||
<ContactFacsimileTelephone>+1 301 286-1777</ContactFacsimileTelephone>
|
||||
<ContactElectronicMailAddress>delabeau@iniki.gsfc.nasa.gov</ContactElectronicMailAddress>
|
||||
</ContactInformation>
|
||||
<Fees>none</Fees>
|
||||
|
||||
<AccessConstraints>none</AccessConstraints>
|
||||
</Service>
|
||||
<Capability>
|
||||
<Request>
|
||||
<GetCapabilities>
|
||||
<Format>application/vnd.ogc.wms_xml</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://hostname:port/path" />
|
||||
</Get>
|
||||
<Post>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://hostname:port/path" />
|
||||
</Post>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
|
||||
</GetCapabilities>
|
||||
<GetMap>
|
||||
<Format>image/gif</Format>
|
||||
<Format>image/png</Format>
|
||||
<Format>image/jpeg</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://hostname:port/path/get" />
|
||||
</Get>
|
||||
<Post>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://hostname:port/path/post" />
|
||||
</Post>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetMap>
|
||||
<GetFeatureInfo>
|
||||
<Format>application/vnd.ogc.gml</Format>
|
||||
|
||||
<Format>text/plain</Format>
|
||||
<Format>text/html</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://hostname:port/path" />
|
||||
</Get>
|
||||
</HTTP>
|
||||
|
||||
</DCPType>
|
||||
</GetFeatureInfo>
|
||||
<DescribeLayer>
|
||||
<Format>application/vnd.ogc.gml</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://hostname:port/path" />
|
||||
|
||||
</Get>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</DescribeLayer>
|
||||
</Request>
|
||||
<Exception>
|
||||
<Format>application/vnd.ogc.se_xml</Format>
|
||||
<Format>application/vnd.ogc.se_inimage</Format>
|
||||
|
||||
<Format>application/vnd.ogc.se_blank</Format>
|
||||
</Exception>
|
||||
<VendorSpecificCapabilities />
|
||||
<UserDefinedSymbolization SupportSLD="1" UserLayer="1" UserStyle="1"
|
||||
RemoteWFS="1" />
|
||||
|
||||
<Layer>
|
||||
<Title>Acme Corp. Map Server</Title>
|
||||
<SRS>EPSG:4326</SRS>
|
||||
<BoundingBox SRS="EPSG:4326"
|
||||
minx="-1" miny="-1" maxx="1" maxy="1" resx="0.0" resy="0.0"/>
|
||||
<AuthorityURL name="DIF_ID">
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
|
||||
xlink:href="http://gcmd.gsfc.nasa.gov/difguide/whatisadif.html" />
|
||||
</AuthorityURL>
|
||||
<Layer>
|
||||
<Name>ROADS_RIVERS</Name>
|
||||
<Title>Roads and Rivers</Title>
|
||||
<SRS>EPSG:26986</SRS>
|
||||
<LatLonBoundingBox minx="-71.63" miny="41.75" maxx="-70.78" maxy="42.90"/>
|
||||
<BoundingBox SRS="EPSG:4326"
|
||||
minx="-71.63" miny="41.75" maxx="-70.78" maxy="42.90" resx="0.01" resy="0.01"/>
|
||||
|
||||
<BoundingBox SRS="EPSG:26986"
|
||||
minx="189000" miny="834000" maxx="285000" maxy="962000" resx="1" resy="1" />
|
||||
<Attribution>
|
||||
<Title>State College University</Title>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/" />
|
||||
<LogoURL width="100" height="100">
|
||||
<Format>image/gif</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/icons/logo.gif" />
|
||||
|
||||
</LogoURL>
|
||||
</Attribution>
|
||||
<Identifier authority="DIF_ID">123456</Identifier>
|
||||
<FeatureListURL>
|
||||
<Format>application/vnd.ogc.se_xml</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/data/roads_rivers.gml" />
|
||||
</FeatureListURL>
|
||||
|
||||
<Style>
|
||||
<Name>USGS</Name>
|
||||
<Title>USGS Topo Map Style</Title>
|
||||
<Abstract>Features are shown in a style like that used in USGS topographic maps.</Abstract>
|
||||
<LegendURL width="72" height="72">
|
||||
<Format>image/gif</Format>
|
||||
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/legends/usgs.gif" />
|
||||
</LegendURL>
|
||||
<StyleSheetURL>
|
||||
<Format>text/xsl</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/stylesheets/usgs.xsl" />
|
||||
</StyleSheetURL>
|
||||
</Style>
|
||||
|
||||
|
||||
<Layer queryable="1">
|
||||
<Name>ROADS_1M</Name>
|
||||
<Title>Roads at 1:1M scale</Title>
|
||||
<Abstract>Roads at a scale of 1 to 1 million.</Abstract>
|
||||
<KeywordList>
|
||||
<Keyword>road</Keyword>
|
||||
|
||||
<Keyword>transportation</Keyword>
|
||||
<Keyword>atlas</Keyword>
|
||||
</KeywordList>
|
||||
<Identifier authority="DIF_ID">123456</Identifier>
|
||||
<MetadataURL type="FGDC">
|
||||
<Format>text/plain</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/metadata/roads.txt" />
|
||||
</MetadataURL>
|
||||
<MetadataURL type="FGDC">
|
||||
<Format>text/xml</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/metadata/roads.xml" />
|
||||
</MetadataURL>
|
||||
<Style>
|
||||
|
||||
<Name>ATLAS</Name>
|
||||
<Title>Road atlas style</Title>
|
||||
<Abstract>Roads are shown in a style like that used in a commercial road atlas.</Abstract>
|
||||
<LegendURL width="72" height="72">
|
||||
<Format>image/gif</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/legends/atlas.gif" />
|
||||
</LegendURL>
|
||||
|
||||
</Style>
|
||||
<ScaleHint min="0.3959805894" max="98.9951473564114" />
|
||||
</Layer>
|
||||
<Layer queryable="1">
|
||||
<Name>RIVERS_1M</Name>
|
||||
<Title>Rivers at 1:1M scale</Title>
|
||||
<Abstract>Rivers at a scale of 1 to 1 million.</Abstract>
|
||||
<KeywordList>
|
||||
|
||||
<Keyword>river</Keyword>
|
||||
<Keyword>canal</Keyword>
|
||||
<Keyword>waterway</Keyword>
|
||||
</KeywordList>
|
||||
<ScaleHint min="0" max="Infinity" />
|
||||
</Layer>
|
||||
</Layer>
|
||||
<Layer queryable="1">
|
||||
|
||||
<Title>Weather Forecast Data</Title>
|
||||
<SRS>EPSG:4326</SRS>
|
||||
<LatLonBoundingBox minx="-180" miny="-90" maxx="180" maxy="90" />
|
||||
<Dimension name="time" units="ISO8601" />
|
||||
<Extent name="time" default="2000-08-22">1999-01-01/2000-08-22/P1D</Extent>
|
||||
|
||||
<Layer>
|
||||
<Name>Clouds</Name>
|
||||
<Title>Forecast cloud cover</Title>
|
||||
</Layer>
|
||||
|
||||
<Layer>
|
||||
<Name>Temperature</Name>
|
||||
<Title>Forecast temperature</Title>
|
||||
</Layer>
|
||||
|
||||
<Layer>
|
||||
<Name>Pressure</Name>
|
||||
<Title>Forecast barometric pressure</Title>
|
||||
<Dimension name="time" units="ISO8601" />
|
||||
<Dimension name="elevation" units="EPSG:5030" />
|
||||
<Extent name="time" default="2000-08-22">1999-01-01/2000-08-22/P1D</Extent>
|
||||
<Extent name="elevation" default="0" nearestValue="1">0,1000,3000,5000,10000</Extent>
|
||||
</Layer>
|
||||
|
||||
</Layer>
|
||||
|
||||
<Layer opaque="1" noSubsets="1" fixedWidth="512" fixedHeight="256">
|
||||
<Name>ozone_image</Name>
|
||||
<Title>Global ozone distribution (1992)</Title>
|
||||
<LatLonBoundingBox minx="-180" miny="-90" maxx="180" maxy="90" />
|
||||
<Extent name="time" default="1992">1992</Extent>
|
||||
</Layer>
|
||||
|
||||
<Layer cascaded="1">
|
||||
<Name>population</Name>
|
||||
<Title>World population, annual</Title>
|
||||
<LatLonBoundingBox minx="-180" miny="-90" maxx="180" maxy="90" />
|
||||
<Extent name="time" default="2000">1990/2000/P1Y</Extent>
|
||||
</Layer>
|
||||
|
||||
</Layer>
|
||||
|
||||
|
||||
</Capability>
|
||||
</WMT_MS_Capabilities>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
|
||||
<!DOCTYPE WMT_MS_Capabilities SYSTEM "http://schemas.opengis.net/wms/1.1.0/capabilities_1_1_0.dtd"
|
||||
[
|
||||
<!ELEMENT VendorSpecificCapabilities EMPTY>
|
||||
]>
|
||||
<WMT_MS_Capabilities version="1.1.0">
|
||||
|
||||
<Service>
|
||||
<Name>OGC:WMS</Name>
|
||||
<Title>i3Geo - i3geo</Title>
|
||||
<Abstract>Web services gerados da base de dados do i3Geo. Para chamar um tema especificamente, veja o sistema de ajuda, digitando no navegador web ogc.php?ajuda=, para uma lista compacta de todos os servicos, digite ogc.php?lista=temas</Abstract>
|
||||
<KeywordList>
|
||||
<Keyword>i3Geo</Keyword>
|
||||
</KeywordList>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mapas.mma.gov.br/i3geo/ogc.php?"/>
|
||||
<ContactInformation>
|
||||
<ContactPersonPrimary>
|
||||
<ContactPerson>Web Master</ContactPerson>
|
||||
<ContactOrganization>Coordena??o Geral de TI</ContactOrganization>
|
||||
</ContactPersonPrimary>
|
||||
<ContactPosition>Administrador do s?tio web</ContactPosition>
|
||||
<ContactAddress>
|
||||
<AddressType>uri</AddressType>
|
||||
<Address>http://www.mma.gov.br</Address>
|
||||
<City>Brasilia</City>
|
||||
<StateOrProvince>DF</StateOrProvince>
|
||||
<PostCode></PostCode>
|
||||
<Country>Brasil</Country>
|
||||
</ContactAddress>
|
||||
<ContactElectronicMailAddress>geoprocessamento@mma.gov.br</ContactElectronicMailAddress>
|
||||
</ContactInformation>
|
||||
<Fees>none</Fees>
|
||||
<AccessConstraints>vedado o uso comercial</AccessConstraints>
|
||||
</Service>
|
||||
|
||||
<Capability>
|
||||
<Request>
|
||||
<GetCapabilities>
|
||||
<Format>application/vnd.ogc.wms_xml</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mapas.mma.gov.br/i3geo/ogc.php?"/></Get>
|
||||
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mapas.mma.gov.br/i3geo/ogc.php?"/></Post>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetCapabilities>
|
||||
<GetMap>
|
||||
<Format>image/png</Format>
|
||||
<Format>image/jpeg</Format>
|
||||
<Format>image/gif</Format>
|
||||
<Format>image/png; mode=8bit</Format>
|
||||
<Format>application/x-pdf</Format>
|
||||
<Format>image/svg+xml</Format>
|
||||
<Format>image/tiff</Format>
|
||||
<Format>application/vnd.google-earth.kml+xml</Format>
|
||||
<Format>application/vnd.google-earth.kmz</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mapas.mma.gov.br/i3geo/ogc.php?"/></Get>
|
||||
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mapas.mma.gov.br/i3geo/ogc.php?"/></Post>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetMap>
|
||||
<GetFeatureInfo>
|
||||
<Format>text/plain</Format>
|
||||
<Format>application/vnd.ogc.gml</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mapas.mma.gov.br/i3geo/ogc.php?"/></Get>
|
||||
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mapas.mma.gov.br/i3geo/ogc.php?"/></Post>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetFeatureInfo>
|
||||
<DescribeLayer>
|
||||
<Format>text/xml</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mapas.mma.gov.br/i3geo/ogc.php?"/></Get>
|
||||
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mapas.mma.gov.br/i3geo/ogc.php?"/></Post>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</DescribeLayer>
|
||||
</Request>
|
||||
<Exception>
|
||||
<Format>application/vnd.ogc.se_xml</Format>
|
||||
<Format>application/vnd.ogc.se_inimage</Format>
|
||||
<Format>application/vnd.ogc.se_blank</Format>
|
||||
</Exception>
|
||||
<VendorSpecificCapabilities />
|
||||
<UserDefinedSymbolization SupportSLD="1" UserLayer="0" UserStyle="1" RemoteWFS="0"/>
|
||||
<Layer>
|
||||
<Name>i3geoogc</Name>
|
||||
<Title>i3Geo - i3geo</Title>
|
||||
<Abstract>Web services gerados da base de dados do i3Geo. Para chamar um tema especificamente, veja o sistema de ajuda, digitando no navegador web ogc.php?ajuda=, para uma lista compacta de todos os servicos, digite ogc.php?lista=temas</Abstract>
|
||||
<KeywordList>
|
||||
<Keyword>i3Geo</Keyword>
|
||||
</KeywordList>
|
||||
<SRS></SRS>
|
||||
<LatLonBoundingBox minx="-76.5126" miny="-36.9484" maxx="-29.5852" maxy="7.04601" />
|
||||
<BoundingBox SRS=""
|
||||
minx="-76.5126" miny="-36.9484" maxx="-29.5852" maxy="7.04601" />
|
||||
<Attribution>
|
||||
<Title>i3Geo</Title>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mapas.mma.gov.br/i3geo"/>
|
||||
<LogoURL width="85" height="56">
|
||||
<Format>image/png</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://mapas.mma.gov.br/i3geo/imagens/i3geo.png"/>
|
||||
</LogoURL>
|
||||
</Attribution>
|
||||
<Layer queryable="1" opaque="0" cascaded="0">
|
||||
<Name>antigo_caminantes</Name>
|
||||
<Title>Guia de Caminantes - 1817</Title>
|
||||
<SRS> EPSG:4618 EPSG:4291 EPSG:4326 EPSG:22521 EPSG:22522 EPSG:22523 EPSG:22524 EPSG:22525 EPSG:29101 EPSG:29119 EPSG:29120 EPSG:29121 EPSG:29122 EPSG:29177 EPSG:29178 EPSG:29179 EPSG:29180 EPSG:29181 EPSG:29182 EPSG:29183 EPSG:29184 EPSG:29185</SRS>
|
||||
<LatLonBoundingBox minx="-75.2336" miny="-33.7516" maxx="-27.593" maxy="5.27216" />
|
||||
<BoundingBox SRS=""
|
||||
minx="-75.2336" miny="-33.7516" maxx="-27.593" maxy="5.27216" />
|
||||
<MetadataURL type="TC211">
|
||||
<Format>text/html</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://consorcio.bn.br"/>
|
||||
</MetadataURL>
|
||||
</Layer>
|
||||
</Layer>
|
||||
</Capability>
|
||||
</WMT_MS_Capabilities>
|
||||
178
test/spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1_WMSC/wmsc.xml
Normal file
178
test/spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1_WMSC/wmsc.xml
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE WMT_MS_Capabilities SYSTEM "http://schemas.opengis.net/wms/1.1.1/capabilities_1_1_1.dtd"[
|
||||
<!ELEMENT VendorSpecificCapabilities (TileSet*) >
|
||||
<!ELEMENT TileSet (SRS, BoundingBox?, Resolutions, Width, Height, Format, Layers*, Styles*) >
|
||||
<!ELEMENT Resolutions (#PCDATA) >
|
||||
<!ELEMENT Width (#PCDATA) >
|
||||
<!ELEMENT Height (#PCDATA) >
|
||||
<!ELEMENT Layers (#PCDATA) >
|
||||
<!ELEMENT Styles (#PCDATA) >
|
||||
]>
|
||||
<WMT_MS_Capabilities version="1.1.1" updateSequence="57">
|
||||
<Service>
|
||||
<Name>OGC:WMS</Name>
|
||||
<Title>GeoServer Web Map Service</Title>
|
||||
<Abstract>A compliant implementation of WMS 1.1.1 plus most of the SLD 1.0 extension (dynamic styling). Can also generate PDF, SVG, KML, GeoRSS</Abstract>
|
||||
<KeywordList>
|
||||
<Keyword>WFS</Keyword>
|
||||
<Keyword>WMS</Keyword>
|
||||
<Keyword>GEOSERVER</Keyword>
|
||||
</KeywordList>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8080/geoserver-suite/wms"/>
|
||||
<ContactInformation>
|
||||
<ContactPersonPrimary>
|
||||
<ContactPerson>OpenGeo</ContactPerson>
|
||||
<ContactOrganization>OpenGeo</ContactOrganization>
|
||||
</ContactPersonPrimary>
|
||||
<ContactPosition>Outreach</ContactPosition>
|
||||
<ContactAddress>
|
||||
<AddressType>Work</AddressType>
|
||||
<Address/>
|
||||
<City>New York</City>
|
||||
<StateOrProvince/>
|
||||
<PostCode/>
|
||||
<Country>USA</Country>
|
||||
</ContactAddress>
|
||||
<ContactVoiceTelephone/>
|
||||
<ContactFacsimileTelephone/>
|
||||
<ContactElectronicMailAddress>inquiry@opengeo.org</ContactElectronicMailAddress>
|
||||
</ContactInformation>
|
||||
<Fees>NONE</Fees>
|
||||
<AccessConstraints>NONE</AccessConstraints>
|
||||
</Service>
|
||||
<Capability>
|
||||
<Request>
|
||||
<GetCapabilities>
|
||||
<Format>application/vnd.ogc.wms_xml</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8080/geoserver-suite/wms?SERVICE=WMS&"/>
|
||||
</Get>
|
||||
<Post>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8080/geoserver-suite/wms?SERVICE=WMS&"/>
|
||||
</Post>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetCapabilities>
|
||||
<GetMap>
|
||||
<Format>image/png</Format>
|
||||
<Format>application/atom xml</Format>
|
||||
<Format>application/atom+xml</Format>
|
||||
<Format>application/openlayers</Format>
|
||||
<Format>application/pdf</Format>
|
||||
<Format>application/rss xml</Format>
|
||||
<Format>application/rss+xml</Format>
|
||||
<Format>application/vnd.google-earth.kml</Format>
|
||||
<Format>application/vnd.google-earth.kml xml</Format>
|
||||
<Format>application/vnd.google-earth.kml+xml</Format>
|
||||
<Format>application/vnd.google-earth.kmz</Format>
|
||||
<Format>application/vnd.google-earth.kmz xml</Format>
|
||||
<Format>application/vnd.google-earth.kmz+xml</Format>
|
||||
<Format>atom</Format>
|
||||
<Format>image/geotiff</Format>
|
||||
<Format>image/geotiff8</Format>
|
||||
<Format>image/gif</Format>
|
||||
<Format>image/jpeg</Format>
|
||||
<Format>image/png8</Format>
|
||||
<Format>image/svg</Format>
|
||||
<Format>image/svg xml</Format>
|
||||
<Format>image/svg+xml</Format>
|
||||
<Format>image/tiff</Format>
|
||||
<Format>image/tiff8</Format>
|
||||
<Format>kml</Format>
|
||||
<Format>kmz</Format>
|
||||
<Format>openlayers</Format>
|
||||
<Format>rss</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8080/geoserver-suite/wms?SERVICE=WMS&"/>
|
||||
</Get>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetMap>
|
||||
<GetFeatureInfo>
|
||||
<Format>text/plain</Format>
|
||||
<Format>application/vnd.ogc.gml</Format>
|
||||
<Format>text/html</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8080/geoserver-suite/wms?SERVICE=WMS&"/>
|
||||
</Get>
|
||||
<Post>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8080/geoserver-suite/wms?SERVICE=WMS&"/>
|
||||
</Post>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetFeatureInfo>
|
||||
<DescribeLayer>
|
||||
<Format>application/vnd.ogc.wms_xml</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8080/geoserver-suite/wms?SERVICE=WMS&"/>
|
||||
</Get>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</DescribeLayer>
|
||||
<GetLegendGraphic>
|
||||
<Format>image/png</Format>
|
||||
<Format>image/jpeg</Format>
|
||||
<Format>image/gif</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8080/geoserver-suite/wms?SERVICE=WMS&"/>
|
||||
</Get>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetLegendGraphic>
|
||||
<GetStyles>
|
||||
<Format>application/vnd.ogc.sld+xml</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8080/geoserver-suite/wms?SERVICE=WMS&"/>
|
||||
</Get>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetStyles>
|
||||
</Request>
|
||||
<Exception>
|
||||
<Format>application/vnd.ogc.se_xml</Format>
|
||||
<Format>application/vnd.ogc.se_inimage</Format>
|
||||
</Exception>
|
||||
<VendorSpecificCapabilities>
|
||||
<TileSet>
|
||||
<SRS>EPSG:900913</SRS>
|
||||
<BoundingBox SRS="EPSG:900913" minx="-1.3697515466796875E7" miny="5165920.118906248" maxx="-1.361924394984375E7" maxy="5244191.635859374"/>
|
||||
<Resolutions>156543.03390625 78271.516953125 39135.7584765625 19567.87923828125 9783.939619140625 4891.9698095703125 2445.9849047851562 1222.9924523925781 611.4962261962891 305.74811309814453 152.87405654907226 76.43702827453613 38.218514137268066 19.109257068634033 9.554628534317017 4.777314267158508 2.388657133579254 1.194328566789627 0.5971642833948135 0.29858214169740677 0.14929107084870338 0.07464553542435169 0.037322767712175846 0.018661383856087923 0.009330691928043961 0.004665345964021981 </Resolutions>
|
||||
<Width>256</Width>
|
||||
<Height>256</Height>
|
||||
<Format>image/png</Format>
|
||||
<Layers>medford:hydro</Layers>
|
||||
<Styles/>
|
||||
</TileSet>
|
||||
<TileSet>
|
||||
<SRS>EPSG:4326</SRS>
|
||||
<BoundingBox SRS="EPSG:4326" minx="-123.046875" miny="42.1875" maxx="-122.6953125" maxy="42.5390625"/>
|
||||
<Resolutions>0.703125 0.3515625 0.17578125 0.087890625 0.0439453125 0.02197265625 0.010986328125 0.0054931640625 0.00274658203125 0.001373291015625 6.866455078125E-4 3.4332275390625E-4 1.71661376953125E-4 8.58306884765625E-5 4.291534423828125E-5 2.1457672119140625E-5 1.0728836059570312E-5 5.364418029785156E-6 2.682209014892578E-6 1.341104507446289E-6 6.705522537231445E-7 3.3527612686157227E-7 1.6763806343078613E-7 8.381903171539307E-8 4.190951585769653E-8 2.0954757928848267E-8 </Resolutions>
|
||||
<Width>256</Width>
|
||||
<Height>256</Height>
|
||||
<Format>image/gif</Format>
|
||||
<Layers>medford</Layers>
|
||||
<Styles/>
|
||||
</TileSet>
|
||||
</VendorSpecificCapabilities>
|
||||
<UserDefinedSymbolization SupportSLD="1" UserLayer="1" UserStyle="1" RemoteWFS="1"/>
|
||||
<Layer queryable="0" opaque="0" noSubsets="0">
|
||||
<Title>GeoServer Web Map Service</Title>
|
||||
<Abstract>A compliant implementation of WMS 1.1.1 plus most of the SLD 1.0 extension (dynamic styling). Can also generate PDF, SVG, KML, GeoRSS</Abstract>
|
||||
<SRS>EPSG:4326</SRS>
|
||||
<SRS>EPSG:900913</SRS>
|
||||
<LatLonBoundingBox minx="-180.0" miny="-90.0" maxx="180.0" maxy="83.624"/>
|
||||
</Layer>
|
||||
</Capability>
|
||||
</WMT_MS_Capabilities>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version='1.0' encoding="UTF-8"?>
|
||||
<ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.opengis.net/ogc
|
||||
http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">
|
||||
<ServiceException> Plain text message about an error. </ServiceException>
|
||||
<ServiceException code="InvalidUpdateSequence"> Another error message, this one with a service
|
||||
exception code supplied. </ServiceException>
|
||||
<ServiceException>
|
||||
<![CDATA[ Error in module <foo.c>, line 42
|
||||
A message that includes angle brackets in text must be enclosed in a Character Data Section as in this example. All XML-like markup is ignored except for this sequence of three closing characters:
|
||||
]]>
|
||||
</ServiceException>
|
||||
<ServiceException>
|
||||
<![CDATA[ <Module>foo.c</Module> <Error>An error occurred</Error> <Explanation>Similarly, actual XML can be enclosed in a CDATA section. A generic parser will ignore that XML, but application-specific software may choose to process it.</Explanation> ]]>
|
||||
</ServiceException>
|
||||
</ServiceExceptionReport>
|
||||
284
test/spec/ol/parser/ogc/xml/wmscapabilities_v1_3_0/ogcsample.xml
Normal file
284
test/spec/ol/parser/ogc/xml/wmscapabilities_v1_3_0/ogcsample.xml
Normal file
@@ -0,0 +1,284 @@
|
||||
<?xml version='1.0' encoding="UTF-8"?>
|
||||
<WMS_Capabilities version="1.3.0" xmlns="http://www.opengis.net/wms"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd">
|
||||
<Service>
|
||||
<Name>WMS</Name>
|
||||
<Title>Acme Corp. Map Server</Title>
|
||||
<Abstract>Map Server maintained by Acme Corporation. Contact: webmaster@wmt.acme.com. High-quality maps showing roadrunner nests and possible ambush locations.</Abstract>
|
||||
|
||||
<KeywordList>
|
||||
<Keyword>bird</Keyword>
|
||||
<Keyword>roadrunner</Keyword>
|
||||
<Keyword>ambush</Keyword>
|
||||
</KeywordList>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
|
||||
xlink:href="http://hostname/" />
|
||||
|
||||
|
||||
<ContactInformation>
|
||||
<ContactPersonPrimary>
|
||||
<ContactPerson>Jeff Smith</ContactPerson>
|
||||
<ContactOrganization>NASA</ContactOrganization>
|
||||
</ContactPersonPrimary>
|
||||
<ContactPosition>Computer Scientist</ContactPosition>
|
||||
|
||||
<ContactAddress>
|
||||
<AddressType>postal</AddressType>
|
||||
<Address>NASA Goddard Space Flight Center</Address>
|
||||
<City>Greenbelt</City>
|
||||
<StateOrProvince>MD</StateOrProvince>
|
||||
<PostCode>20771</PostCode>
|
||||
|
||||
<Country>USA</Country>
|
||||
</ContactAddress>
|
||||
<ContactVoiceTelephone>+1 301 555-1212</ContactVoiceTelephone>
|
||||
<ContactElectronicMailAddress>user@host.com</ContactElectronicMailAddress>
|
||||
</ContactInformation>
|
||||
|
||||
<Fees>none</Fees>
|
||||
|
||||
<AccessConstraints>none</AccessConstraints>
|
||||
<LayerLimit>16</LayerLimit>
|
||||
<MaxWidth>2048</MaxWidth>
|
||||
<MaxHeight>2048</MaxHeight>
|
||||
</Service>
|
||||
<Capability>
|
||||
<Request>
|
||||
<GetCapabilities>
|
||||
|
||||
<Format>text/xml</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://hostname/path?" />
|
||||
</Get>
|
||||
<Post>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://hostname/path?" />
|
||||
|
||||
</Post>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetCapabilities>
|
||||
<GetMap>
|
||||
<Format>image/gif</Format>
|
||||
<Format>image/png</Format>
|
||||
<Format>image/jpeg</Format>
|
||||
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://hostname/path?" />
|
||||
</Get>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetMap>
|
||||
|
||||
<GetFeatureInfo>
|
||||
<Format>text/xml</Format>
|
||||
<Format>text/plain</Format>
|
||||
<Format>text/html</Format>
|
||||
<DCPType>
|
||||
<HTTP>
|
||||
<Get>
|
||||
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://hostname/path?" />
|
||||
</Get>
|
||||
</HTTP>
|
||||
</DCPType>
|
||||
</GetFeatureInfo>
|
||||
</Request>
|
||||
<Exception>
|
||||
<Format>XML</Format>
|
||||
|
||||
<Format>INIMAGE</Format>
|
||||
<Format>BLANK</Format>
|
||||
</Exception>
|
||||
<Layer>
|
||||
<Title>Acme Corp. Map Server</Title>
|
||||
<CRS>CRS:84</CRS>
|
||||
|
||||
<AuthorityURL name="DIF_ID">
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
|
||||
xlink:href="http://gcmd.gsfc.nasa.gov/difguide/whatisadif.html" />
|
||||
</AuthorityURL>
|
||||
<BoundingBox CRS="CRS:84"
|
||||
minx="-1" miny="-1" maxx="1" maxy="1" resx="0.0" resy="0.0"/>
|
||||
<Layer>
|
||||
|
||||
<Name>ROADS_RIVERS</Name>
|
||||
<Title>Roads and Rivers</Title>
|
||||
|
||||
<CRS>EPSG:26986</CRS>
|
||||
<EX_GeographicBoundingBox>
|
||||
<westBoundLongitude>-71.63</westBoundLongitude>
|
||||
<eastBoundLongitude>-70.78</eastBoundLongitude>
|
||||
<southBoundLatitude>41.75</southBoundLatitude>
|
||||
<northBoundLatitude>42.90</northBoundLatitude>
|
||||
|
||||
</EX_GeographicBoundingBox>
|
||||
<BoundingBox CRS="CRS:84"
|
||||
minx="-71.63" miny="41.75" maxx="-70.78" maxy="42.90" resx="0.01" resy="0.01"/>
|
||||
<BoundingBox CRS="EPSG:26986"
|
||||
minx="189000" miny="834000" maxx="285000" maxy="962000" resx="1" resy="1" />
|
||||
<Attribution>
|
||||
<Title>State College University</Title>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/" />
|
||||
|
||||
<LogoURL width="100" height="100">
|
||||
<Format>image/gif</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/icons/logo.gif" />
|
||||
</LogoURL>
|
||||
</Attribution>
|
||||
<Identifier authority="DIF_ID">123456</Identifier>
|
||||
<FeatureListURL>
|
||||
|
||||
<Format>XML</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/data/roads_rivers.gml" />
|
||||
</FeatureListURL>
|
||||
<Style>
|
||||
<Name>USGS</Name>
|
||||
<Title>USGS Topo Map Style</Title>
|
||||
<Abstract>Features are shown in a style like that used in USGS topographic maps.</Abstract>
|
||||
|
||||
<LegendURL width="72" height="72">
|
||||
<Format>image/gif</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/legends/usgs.gif" />
|
||||
</LegendURL>
|
||||
<StyleSheetURL>
|
||||
<Format>text/xsl</Format>
|
||||
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/stylesheets/usgs.xsl" />
|
||||
</StyleSheetURL>
|
||||
</Style>
|
||||
<MinScaleDenominator>1000</MinScaleDenominator>
|
||||
<MaxScaleDenominator>250000</MaxScaleDenominator>
|
||||
<Layer queryable="1">
|
||||
<Name>ROADS_1M</Name>
|
||||
<Title>Roads at 1:1M scale</Title>
|
||||
<Abstract>Roads at a scale of 1 to 1 million.</Abstract>
|
||||
|
||||
<KeywordList>
|
||||
<Keyword>road</Keyword>
|
||||
<Keyword>transportation</Keyword>
|
||||
<Keyword>atlas</Keyword>
|
||||
</KeywordList>
|
||||
<Identifier authority="DIF_ID">123456</Identifier>
|
||||
<MetadataURL type="FGDC:1998">
|
||||
|
||||
<Format>text/plain</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/metadata/roads.txt" />
|
||||
</MetadataURL>
|
||||
<MetadataURL type="ISO19115:2003">
|
||||
<Format>text/xml</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/metadata/roads.xml" />
|
||||
</MetadataURL>
|
||||
|
||||
<Style>
|
||||
<Name>ATLAS</Name>
|
||||
<Title>Road atlas style</Title>
|
||||
<Abstract>Roads are shown in a style like that used in a commercial road atlas.</Abstract>
|
||||
<LegendURL width="72" height="72">
|
||||
<Format>image/gif</Format>
|
||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:type="simple"
|
||||
xlink:href="http://www.university.edu/legends/atlas.gif" />
|
||||
|
||||
</LegendURL>
|
||||
</Style>
|
||||
</Layer>
|
||||
<Layer queryable="1">
|
||||
<Name>RIVERS_1M</Name>
|
||||
<Title>Rivers at 1:1M scale</Title>
|
||||
<Abstract>Rivers at a scale of 1 to 1 million.</Abstract>
|
||||
|
||||
<KeywordList>
|
||||
<Keyword>river</Keyword>
|
||||
<Keyword>canal</Keyword>
|
||||
<Keyword>waterway</Keyword>
|
||||
</KeywordList>
|
||||
</Layer>
|
||||
</Layer>
|
||||
|
||||
<Layer queryable="1">
|
||||
<Title>Weather Forecast Data</Title>
|
||||
<CRS>CRS:84</CRS>
|
||||
|
||||
<EX_GeographicBoundingBox>
|
||||
<westBoundLongitude>-180</westBoundLongitude>
|
||||
<eastBoundLongitude>180</eastBoundLongitude>
|
||||
|
||||
<southBoundLatitude>-90</southBoundLatitude>
|
||||
<northBoundLatitude>90</northBoundLatitude>
|
||||
</EX_GeographicBoundingBox>
|
||||
<Dimension name="time" units="ISO8601" default="2000-08-22">1999-01-01/2000-08-22/P1D</Dimension>
|
||||
<Layer>
|
||||
|
||||
<Name>Clouds</Name>
|
||||
<Title>Forecast cloud cover</Title>
|
||||
</Layer>
|
||||
<Layer>
|
||||
<Name>Temperature</Name>
|
||||
<Title>Forecast temperature</Title>
|
||||
</Layer>
|
||||
|
||||
<Layer>
|
||||
<Name>Pressure</Name>
|
||||
<Title>Forecast barometric pressure</Title>
|
||||
<Dimension name="elevation" units="EPSG:5030" />
|
||||
<Dimension name="time" units="ISO8601" default="2000-08-22">
|
||||
1999-01-01/2000-08-22/P1D</Dimension>
|
||||
|
||||
<Dimension name="elevation" units="CRS:88" default="0" nearestValue="1">0,1000,3000,5000,10000</Dimension>
|
||||
</Layer>
|
||||
</Layer>
|
||||
<Layer opaque="1" noSubsets="1" fixedWidth="512" fixedHeight="256">
|
||||
<Name>ozone_image</Name>
|
||||
<Title>Global ozone distribution (1992)</Title>
|
||||
|
||||
<EX_GeographicBoundingBox>
|
||||
<westBoundLongitude>-180</westBoundLongitude>
|
||||
<eastBoundLongitude>180</eastBoundLongitude>
|
||||
<southBoundLatitude>-90</southBoundLatitude>
|
||||
<northBoundLatitude>90</northBoundLatitude>
|
||||
</EX_GeographicBoundingBox>
|
||||
<Dimension name="time" units="ISO8601" default="1992">1992</Dimension>
|
||||
|
||||
</Layer>
|
||||
<Layer cascaded="1">
|
||||
<Name>population</Name>
|
||||
<Title>World population, annual</Title>
|
||||
<EX_GeographicBoundingBox>
|
||||
<westBoundLongitude>-180</westBoundLongitude>
|
||||
|
||||
<eastBoundLongitude>180</eastBoundLongitude>
|
||||
<southBoundLatitude>-90</southBoundLatitude>
|
||||
<northBoundLatitude>90</northBoundLatitude>
|
||||
</EX_GeographicBoundingBox>
|
||||
<Dimension name="time" units="ISO8601" default="2000">1990/2000/P1Y</Dimension>
|
||||
</Layer>
|
||||
</Layer>
|
||||
|
||||
</Capability>
|
||||
</WMS_Capabilities>
|
||||
Reference in New Issue
Block a user