Merge pull request #1848 from twpayne/remove-old-parsers
Remove old parsers
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||
<title>GML example</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span12">
|
||||
<h4 id="title">GML example</h4>
|
||||
<p id="shortdesc">Example of using the GML parser.</p>
|
||||
<div id="docs">
|
||||
<p>See the <a href="gml.js" target="_blank">gml.js source</a> to see how this is done.</p>
|
||||
</div>
|
||||
<div id="tags">GML</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=gml" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,43 +0,0 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.parser.ogc.GML_v3');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
parser: new ol.parser.ogc.GML_v3(),
|
||||
url: 'data/gml/topp-states-wfs.xml'
|
||||
}),
|
||||
style: new ol.style.Style({
|
||||
symbolizers: [
|
||||
new ol.style.Fill({
|
||||
color: '#ffffff',
|
||||
opacity: 0.25
|
||||
}),
|
||||
new ol.style.Stroke({
|
||||
color: '#6666ff'
|
||||
})
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [raster, vector],
|
||||
renderer: ol.RendererHint.CANVAS,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: [-10997171, 4658434],
|
||||
zoom: 4
|
||||
})
|
||||
});
|
||||
@@ -1,2 +0,0 @@
|
||||
@exportSymbol ol.parser.ogc.WMSCapabilities
|
||||
@exportProperty ol.parser.ogc.WMSCapabilities.prototype.read
|
||||
@@ -1,69 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities');
|
||||
goog.require('ol.parser.ogc.Versioned');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1_0_0');
|
||||
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.0.0.
|
||||
*/
|
||||
ol.ENABLE_WMSCAPS_1_0_0 = false;
|
||||
|
||||
|
||||
/**
|
||||
* @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=} opt_options Options which will be set on this object.
|
||||
* @extends {ol.parser.ogc.Versioned}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities = function(opt_options) {
|
||||
opt_options = opt_options || {};
|
||||
opt_options['defaultVersion'] = '1.1.1';
|
||||
this.parsers = {};
|
||||
if (ol.ENABLE_WMSCAPS_1_0_0) {
|
||||
this.parsers['v1_0_0'] = ol.parser.ogc.WMSCapabilities_v1_0_0;
|
||||
}
|
||||
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, opt_options);
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities, ol.parser.ogc.Versioned);
|
||||
@@ -1,317 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1');
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.parser.XML');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Read [WMS](http://www.opengeospatial.org/standards/wms) capabilities
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.parser.XML}
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities_v1 = function() {
|
||||
this.defaultNamespaceURI = 'http://www.opengis.net/wms';
|
||||
this.errorProperty = 'service';
|
||||
this.readers = {
|
||||
'http://www.opengis.net/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, 'http://www.w3.org/1999/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'] = {};
|
||||
obj['capability']['nestedLayers'] = [];
|
||||
obj['capability']['layers'] = [];
|
||||
this.readChildNodes(node, obj['capability']);
|
||||
},
|
||||
'Request': function(node, obj) {
|
||||
obj['request'] = {};
|
||||
this.readChildNodes(node, obj['request']);
|
||||
},
|
||||
'GetCapabilities': function(node, obj) {
|
||||
obj['getcapabilities'] = {};
|
||||
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']);
|
||||
},
|
||||
'Post': function(node, obj) {
|
||||
obj['post'] = {};
|
||||
this.readChildNodes(node, obj['post']);
|
||||
},
|
||||
'GetMap': function(node, obj) {
|
||||
obj['getmap'] = {};
|
||||
obj['getmap']['formats'] = [];
|
||||
this.readChildNodes(node, obj['getmap']);
|
||||
},
|
||||
'GetFeatureInfo': function(node, obj) {
|
||||
obj['getfeatureinfo'] = {};
|
||||
obj['getfeatureinfo']['formats'] = [];
|
||||
this.readChildNodes(node, obj['getfeatureinfo']);
|
||||
},
|
||||
'Exception': function(node, obj) {
|
||||
obj['exception'] = {};
|
||||
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 (!goog.isDef(layer['formats'])) {
|
||||
layer['formats'] = request['getmap']['formats'];
|
||||
}
|
||||
if (!goog.isDef(layer['infoFormats']) && 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 (goog.isString(data)) {
|
||||
data = goog.dom.xml.loadXml(data);
|
||||
}
|
||||
if (data && data.nodeType == 9) {
|
||||
data = data.documentElement;
|
||||
}
|
||||
var obj = {};
|
||||
this.readNode(data, obj);
|
||||
return obj;
|
||||
};
|
||||
@@ -1,66 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1_0_0');
|
||||
|
||||
goog.require('goog.object');
|
||||
goog.require('goog.string');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1_1_0');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Read [WMS](http://www.opengeospatial.org/standards/wms) capabilities
|
||||
* version 1.0.0
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.parser.ogc.WMSCapabilities_v1_1_0}
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities_v1_0_0 = function() {
|
||||
goog.base(this);
|
||||
this.version = '1.0.0';
|
||||
goog.object.extend(this.readers['http://www.opengis.net/wms'], {
|
||||
'Format': function(node, obj) {
|
||||
for (var i = 0, ii = node.childNodes.length; i < ii; i++) {
|
||||
var child = node.childNodes[i];
|
||||
var local = child.localName || child.nodeName.split(':').pop();
|
||||
if (goog.isArray(obj['formats'])) {
|
||||
obj['formats'].push(local);
|
||||
} else {
|
||||
obj['format'] = local;
|
||||
}
|
||||
}
|
||||
},
|
||||
'Keywords': function(node, obj) {
|
||||
if (!goog.isDef(obj['keywords'])) {
|
||||
obj['keywords'] = [];
|
||||
}
|
||||
var keywords = this.getChildValue(node).split(/ +/);
|
||||
for (var i = 0, ii = keywords.length; i < ii; ++i) {
|
||||
if (!goog.string.isEmpty(keywords[i])) {
|
||||
obj['keywords'].push({'value': keywords[i]});
|
||||
}
|
||||
}
|
||||
},
|
||||
'OnlineResource': function(node, obj) {
|
||||
obj['href'] = this.getChildValue(node);
|
||||
},
|
||||
'Get': function(node, obj) {
|
||||
obj['get'] = {'href': node.getAttribute('onlineResource')};
|
||||
},
|
||||
'Post': function(node, obj) {
|
||||
obj['post'] = {'href': node.getAttribute('onlineResource')};
|
||||
},
|
||||
'Map': function(node, obj) {
|
||||
var reader = this.readers[this.defaultNamespaceURI]['GetMap'];
|
||||
reader.apply(this, arguments);
|
||||
},
|
||||
'Capabilities': function(node, obj) {
|
||||
var reader = this.readers[this.defaultNamespaceURI]['GetCapabilities'];
|
||||
reader.apply(this, arguments);
|
||||
},
|
||||
'FeatureInfo': function(node, obj) {
|
||||
var reader = this.readers[this.defaultNamespaceURI]['GetFeatureInfo'];
|
||||
reader.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1_0_0,
|
||||
ol.parser.ogc.WMSCapabilities_v1_1_0);
|
||||
@@ -1,101 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1_1');
|
||||
|
||||
goog.require('goog.object');
|
||||
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['http://www.opengis.net/wms']['BoundingBox'];
|
||||
goog.object.extend(this.readers['http://www.opengis.net/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 != 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);
|
||||
@@ -1,29 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1_1_0');
|
||||
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1_1');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Read [WMS](http://www.opengeospatial.org/standards/wms) capabilities
|
||||
* version 1.1.0
|
||||
*
|
||||
* @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['http://www.opengis.net/wms'], {
|
||||
'SRS': function(node, obj) {
|
||||
var srs = this.getChildValue(node);
|
||||
var values = srs.split(/ +/);
|
||||
for (var i = 0, ii = values.length; i < ii; i++) {
|
||||
obj['srs'][values[i]] = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1_1_0,
|
||||
ol.parser.ogc.WMSCapabilities_v1_1);
|
||||
@@ -1,25 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1_1_1');
|
||||
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1_1');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Read [WMS](http://www.opengeospatial.org/standards/wms) capabilities
|
||||
* version 1.1.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['http://www.opengis.net/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);
|
||||
@@ -1,48 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1_1_1_WMSC');
|
||||
|
||||
goog.require('goog.object');
|
||||
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['http://www.opengis.net/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, ii = res.length; i < ii; 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);
|
||||
@@ -1,114 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.WMSCapabilities_v1_3_0');
|
||||
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.parser.ogc.WMSCapabilities_v1');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Read [WMS](http://www.opengeospatial.org/standards/wms) capabilities
|
||||
* version 1.3.0
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.parser.ogc.WMSCapabilities_v1}
|
||||
*/
|
||||
ol.parser.ogc.WMSCapabilities_v1_3_0 = function() {
|
||||
goog.base(this);
|
||||
var bboxreader = this.readers['http://www.opengis.net/wms']['BoundingBox'];
|
||||
goog.object.extend(this.readers['http://www.opengis.net/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['http://www.opengis.net/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) {
|
||||
var readers = this.readers['http://www.opengis.net/wms'];
|
||||
readers.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) {
|
||||
var readers = this.readers['http://www.opengis.net/wms'];
|
||||
readers.DescribeLayer.apply(this, arguments);
|
||||
},
|
||||
'GetLegendGraphic': function(node, obj) {
|
||||
var readers = this.readers['http://www.opengis.net/wms'];
|
||||
readers.GetLegendGraphic.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1_3_0,
|
||||
ol.parser.ogc.WMSCapabilities_v1);
|
||||
@@ -1,6 +0,0 @@
|
||||
@exportSymbol ol.parser.ogc.GML_v2
|
||||
@exportProperty ol.parser.ogc.GML_v2.prototype.read
|
||||
@exportProperty ol.parser.ogc.GML_v2.prototype.write
|
||||
@exportSymbol ol.parser.ogc.GML_v3
|
||||
@exportProperty ol.parser.ogc.GML_v3.prototype.read
|
||||
@exportProperty ol.parser.ogc.GML_v3.prototype.write
|
||||
@@ -1,667 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.GML');
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.geom.Geometry');
|
||||
goog.require('ol.geom.GeometryCollection');
|
||||
goog.require('ol.geom.GeometryType');
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.geom.LinearRing');
|
||||
goog.require('ol.geom.MultiLineString');
|
||||
goog.require('ol.geom.MultiPoint');
|
||||
goog.require('ol.geom.MultiPolygon');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.parser.StringFeatureParser');
|
||||
goog.require('ol.parser.XML');
|
||||
goog.require('ol.proj');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @implements {ol.parser.StringFeatureParser}
|
||||
* @param {olx.parser.GMLOptions=} opt_options
|
||||
* Optional configuration object.
|
||||
* @extends {ol.parser.XML}
|
||||
*/
|
||||
ol.parser.ogc.GML = function(opt_options) {
|
||||
var options = /** @type {olx.parser.GMLOptions} */
|
||||
(goog.isDef(opt_options) ? opt_options : {});
|
||||
this.extractAttributes = goog.isDef(options.extractAttributes) ?
|
||||
options.extractAttributes : true;
|
||||
this.surface = goog.isDef(options.surface) ?
|
||||
options.surface : false;
|
||||
this.curve = goog.isDef(options.curve) ?
|
||||
options.curve : false;
|
||||
this.multiCurve = goog.isDef(options.multiCurve) ?
|
||||
options.multiCurve : true;
|
||||
this.multiSurface = goog.isDef(options.multiSurface) ?
|
||||
options.multiSurface : true;
|
||||
this.readOptions = options.readOptions;
|
||||
this.writeOptions = options.writeOptions;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
this.srsName;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
this.axisOrientation;
|
||||
|
||||
if (goog.isDef(options.schemaLocation)) {
|
||||
this.schemaLocation = options.schemaLocation;
|
||||
}
|
||||
if (goog.isDef(options.featureNS)) {
|
||||
this.featureNS = options.featureNS;
|
||||
}
|
||||
if (goog.isDef(options.featureType)) {
|
||||
this.featureType = options.featureType;
|
||||
}
|
||||
this.singleFeatureType = !goog.isDef(opt_options) ||
|
||||
goog.isString(opt_options.featureType);
|
||||
this.defaultNamespaceURI = 'http://www.opengis.net/gml';
|
||||
this.readers = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
'FeatureCollection': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
}
|
||||
},
|
||||
'http://www.opengis.net/gml': {
|
||||
'_inherit': function(node, obj, container) {
|
||||
// Version specific parsers extend this with goog.functions.sequence
|
||||
var srsName;
|
||||
if (!goog.isDef(this.srsName)) {
|
||||
srsName = this.srsName = node.getAttribute('srsName');
|
||||
}
|
||||
if (!goog.isDef(this.axisOrientation)) {
|
||||
if (goog.isDefAndNotNull(srsName)) {
|
||||
this.axisOrientation = ol.proj.get(srsName).getAxisOrientation();
|
||||
} else {
|
||||
this.axisOrientation = 'enu';
|
||||
}
|
||||
}
|
||||
},
|
||||
'name': function(node, obj) {
|
||||
obj.name = this.getChildValue(node);
|
||||
},
|
||||
'featureMember': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'featureMembers': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'GeometryCollection': function(node, container) {
|
||||
var parts = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, parts, container]);
|
||||
this.readChildNodes(node, parts);
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.GEOMETRY_COLLECTION,
|
||||
parts: parts
|
||||
};
|
||||
},
|
||||
'geometryMember': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'MultiPoint': function(node, container) {
|
||||
var parts = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, parts, container]);
|
||||
this.readChildNodes(node, parts);
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.MULTI_POINT,
|
||||
parts: parts
|
||||
};
|
||||
},
|
||||
'pointMember': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'MultiLineString': function(node, container) {
|
||||
var parts = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, parts, container]);
|
||||
this.readChildNodes(node, parts);
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.MULTI_LINE_STRING,
|
||||
parts: parts
|
||||
};
|
||||
},
|
||||
'lineStringMember': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'MultiPolygon': function(node, container) {
|
||||
var parts = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, parts, container]);
|
||||
this.readChildNodes(node, parts);
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.MULTI_POLYGON,
|
||||
parts: parts
|
||||
};
|
||||
},
|
||||
'polygonMember': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'boundedBy': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'Point': function(node, container) {
|
||||
var coordinates = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, coordinates, container]);
|
||||
this.readChildNodes(node, coordinates);
|
||||
var point = {
|
||||
type: ol.geom.GeometryType.POINT,
|
||||
coordinates: coordinates[0][0]
|
||||
};
|
||||
// in the case of a multi geometry this is parts
|
||||
if (goog.isArray(container)) {
|
||||
container.push(point);
|
||||
} else {
|
||||
container.geometry = point;
|
||||
}
|
||||
},
|
||||
'LineString': function(node, container) {
|
||||
var coordinates = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, coordinates, container]);
|
||||
this.readChildNodes(node, coordinates);
|
||||
var linestring = {
|
||||
type: ol.geom.GeometryType.LINE_STRING,
|
||||
coordinates: coordinates[0]
|
||||
};
|
||||
// in the case of a multi geometry this is parts
|
||||
if (goog.isArray(container)) {
|
||||
container.push(linestring);
|
||||
} else {
|
||||
container.geometry = linestring;
|
||||
}
|
||||
},
|
||||
'Polygon': function(node, container) {
|
||||
var obj = {outer: null, inner: []};
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, obj, container]);
|
||||
this.readChildNodes(node, obj);
|
||||
obj.inner.unshift(obj.outer);
|
||||
var polygon = {
|
||||
type: ol.geom.GeometryType.POLYGON,
|
||||
coordinates: obj.inner
|
||||
};
|
||||
// in the case of a multi geometry this is parts
|
||||
if (goog.isArray(container)) {
|
||||
container.push(polygon);
|
||||
} else {
|
||||
container.geometry = polygon;
|
||||
}
|
||||
},
|
||||
'LinearRing': function(node, container) {
|
||||
var coordinates = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, coordinates, container]);
|
||||
this.readChildNodes(node, coordinates);
|
||||
if (goog.isArray(container)) {
|
||||
container.push(coordinates);
|
||||
} else {
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.LINEAR_RING,
|
||||
coordinates: coordinates[0]
|
||||
};
|
||||
}
|
||||
},
|
||||
'coordinates': function(node, coordinates) {
|
||||
var str = this.getChildValue(node).replace(
|
||||
this.regExes.trimSpace, '');
|
||||
str = str.replace(this.regExes.trimComma, ',');
|
||||
var coords;
|
||||
var cs = node.getAttribute('cs') || ',';
|
||||
var ts = node.getAttribute('ts') || this.regExes.splitSpace;
|
||||
var pointList = str.split(ts);
|
||||
var numPoints = pointList.length;
|
||||
var points = new Array(numPoints);
|
||||
for (var i = 0; i < numPoints; ++i) {
|
||||
coords = goog.array.map(pointList[i].split(cs), parseFloat);
|
||||
if (this.axisOrientation.substr(0, 2) === 'en') {
|
||||
points[i] = coords;
|
||||
} else {
|
||||
if (coords.length === 2) {
|
||||
points[i] = coords.reverse();
|
||||
} else if (coords.length === 3) {
|
||||
points[i] = [coords[1], coords[0], coords[2]];
|
||||
}
|
||||
}
|
||||
}
|
||||
coordinates.push(points);
|
||||
},
|
||||
'coord': function(node, coordinates) {
|
||||
var coord = {};
|
||||
if (coordinates.length === 0) {
|
||||
coordinates.push([]);
|
||||
}
|
||||
this.readChildNodes(node, coord);
|
||||
if (goog.isDef(coord.z)) {
|
||||
coordinates.push([coord.x, coord.y, coord.z]);
|
||||
} else {
|
||||
coordinates[0].push([coord.x, coord.y]);
|
||||
}
|
||||
},
|
||||
'X': function(node, coord) {
|
||||
coord.x = parseFloat(this.getChildValue(node));
|
||||
},
|
||||
'Y': function(node, coord) {
|
||||
coord.y = parseFloat(this.getChildValue(node));
|
||||
},
|
||||
'Z': function(node, coord) {
|
||||
coord.z = parseFloat(this.getChildValue(node));
|
||||
}
|
||||
}
|
||||
};
|
||||
this.featureNSReaders_ = {
|
||||
'*': function(node, obj) {
|
||||
// The node can either be named like the featureType, or it
|
||||
// can be a child of the feature:featureType. Children can be
|
||||
// geometry or attributes.
|
||||
var name;
|
||||
var local = node.localName || node.nodeName.split(':').pop();
|
||||
// Since an attribute can have the same name as the feature type
|
||||
// we only want to read the node as a feature if the parent
|
||||
// node can have feature nodes as children. In this case, the
|
||||
// obj.features property is set.
|
||||
if (obj.features) {
|
||||
if (!this.singleFeatureType &&
|
||||
(goog.array.indexOf(this.featureType, local) !== -1)) {
|
||||
name = '_typeName';
|
||||
} else if (local === this.featureType) {
|
||||
name = '_typeName';
|
||||
}
|
||||
} else {
|
||||
// Assume attribute elements have one child node and that the child
|
||||
// is a text node. Otherwise assume it is a geometry node.
|
||||
if (node.childNodes.length === 0 ||
|
||||
(node.childNodes.length === 1 &&
|
||||
node.firstChild.nodeType === 3)) {
|
||||
if (this.extractAttributes) {
|
||||
name = '_attribute';
|
||||
}
|
||||
} else {
|
||||
name = '_geometry';
|
||||
}
|
||||
}
|
||||
if (name) {
|
||||
this.readers[this.featureNS][name].apply(this, [node, obj]);
|
||||
}
|
||||
},
|
||||
'_typeName': function(node, obj) {
|
||||
var container = {properties: {}};
|
||||
this.readChildNodes(node, container);
|
||||
// look for common gml namespaced elements
|
||||
if (container.name) {
|
||||
container.properties.name = container.name;
|
||||
}
|
||||
var feature = new ol.Feature(container.properties);
|
||||
var geom = container.geometry;
|
||||
if (geom) {
|
||||
var geometry = this.createGeometry({geometry: geom});
|
||||
if (goog.isDef(geometry)) {
|
||||
feature.setGeometry(geometry);
|
||||
}
|
||||
}
|
||||
// TODO set feature.type and feature.namespace
|
||||
var fid = node.getAttribute('fid') ||
|
||||
this.getAttributeNS(node, this.defaultNamespaceURI, 'id');
|
||||
if (!goog.isNull(fid)) {
|
||||
feature.setId(fid);
|
||||
}
|
||||
obj.features.push(feature);
|
||||
},
|
||||
'_geometry': function(node, obj) {
|
||||
var local = node.localName || node.nodeName.split(':').pop();
|
||||
this.readChildNodes(node, obj);
|
||||
obj.properties[local] = this.createGeometry({geometry: obj.geometry});
|
||||
delete obj.geometry;
|
||||
},
|
||||
'_attribute': function(node, obj) {
|
||||
var local = node.localName || node.nodeName.split(':').pop();
|
||||
var value = this.getChildValue(node);
|
||||
obj.properties[local] = value;
|
||||
}
|
||||
};
|
||||
if (goog.isDef(this.featureNS)) {
|
||||
this.readers[this.featureNS] = this.featureNSReaders_;
|
||||
}
|
||||
this.writers = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'featureMember': function(obj) {
|
||||
var node = this.createElementNS('gml:featureMember');
|
||||
this.writeNode('_typeName', obj, this.featureNS, node);
|
||||
return node;
|
||||
},
|
||||
'MultiPoint': function(geometry) {
|
||||
var node = this.createElementNS('gml:MultiPoint');
|
||||
var components = geometry.getComponents();
|
||||
for (var i = 0, ii = components.length; i < ii; ++i) {
|
||||
this.writeNode('pointMember', components[i], null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'pointMember': function(geometry) {
|
||||
var node = this.createElementNS('gml:pointMember');
|
||||
this.writeNode('Point', geometry, null, node);
|
||||
return node;
|
||||
},
|
||||
'MultiLineString': function(geometry) {
|
||||
var node = this.createElementNS('gml:MultiLineString');
|
||||
var components = geometry.getComponents();
|
||||
for (var i = 0, ii = components.length; i < ii; ++i) {
|
||||
this.writeNode('lineStringMember', components[i], null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'lineStringMember': function(geometry) {
|
||||
var node = this.createElementNS('gml:lineStringMember');
|
||||
this.writeNode('LineString', geometry, null, node);
|
||||
return node;
|
||||
},
|
||||
'MultiPolygon': function(geometry) {
|
||||
var node = this.createElementNS('gml:MultiPolygon');
|
||||
var components = geometry.getComponents();
|
||||
for (var i = 0, ii = components.length; i < ii; ++i) {
|
||||
this.writeNode('polygonMember', components[i], null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'polygonMember': function(geometry) {
|
||||
var node = this.createElementNS('gml:polygonMember');
|
||||
this.writeNode('Polygon', geometry, null, node);
|
||||
return node;
|
||||
},
|
||||
'GeometryCollection': function(geometry) {
|
||||
var node = this.createElementNS('gml:GeometryCollection');
|
||||
var components = geometry.getComponents();
|
||||
for (var i = 0, ii = components.length; i < ii; ++i) {
|
||||
this.writeNode('geometryMember', components[i], null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'geometryMember': function(geometry) {
|
||||
var node = this.createElementNS('gml:geometryMember');
|
||||
var child = this.writeNode('_geometry', {value: geometry},
|
||||
this.featureNS);
|
||||
node.appendChild(child.firstChild);
|
||||
return node;
|
||||
}
|
||||
},
|
||||
'http://www.opengis.net/wfs': {
|
||||
'FeatureCollection': function(features) {
|
||||
/**
|
||||
* This is only here because GML2 only describes abstract
|
||||
* feature collections. Typically, you would not be using
|
||||
* the GML format to write wfs elements. This just provides
|
||||
* some way to write out lists of features. GML3 defines the
|
||||
* featureMembers element, so that is used by default instead.
|
||||
*/
|
||||
var node = this.createElementNS('wfs:FeatureCollection',
|
||||
'http://www.opengis.net/wfs');
|
||||
for (var i = 0, ii = features.length; i < ii; ++i) {
|
||||
this.writeNode('featureMember', features[i], null, node);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
}
|
||||
};
|
||||
this.featureNSWriters_ = {
|
||||
'_typeName': function(feature) {
|
||||
var node = this.createElementNS('feature:' + this.featureType,
|
||||
this.featureNS);
|
||||
var fid = feature.getId();
|
||||
if (goog.isDef(fid)) {
|
||||
this.setAttributeNS(node, this.defaultNamespaceURI, 'fid', fid);
|
||||
}
|
||||
var attributes = feature.getAttributes();
|
||||
for (var name in attributes) {
|
||||
var value = attributes[name];
|
||||
if (goog.isDefAndNotNull(value)) {
|
||||
if (value instanceof ol.geom.Geometry) {
|
||||
this.writeNode('_geometry', {name: name, value: value},
|
||||
this.featureNS, node);
|
||||
} else {
|
||||
this.writeNode('_attribute', {name: name, value: value},
|
||||
this.featureNS, node);
|
||||
}
|
||||
}
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'_geometry': function(obj) {
|
||||
var node = this.createElementNS('feature:' + obj.name,
|
||||
this.featureNS);
|
||||
var geometry = obj.value;
|
||||
var type = geometry.getType(), child;
|
||||
if (type === ol.geom.GeometryType.POINT) {
|
||||
child = this.writeNode('Point', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.MULTI_POINT) {
|
||||
child = this.writeNode('MultiPoint', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.LINEAR_RING) {
|
||||
child = this.writeNode('LinearRing', geometry.getCoordinates(), null,
|
||||
node);
|
||||
} else if (type === ol.geom.GeometryType.LINE_STRING) {
|
||||
child = this.writeNode('LineString', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.MULTI_LINE_STRING) {
|
||||
child = this.writeNode('MultiLineString', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.POLYGON) {
|
||||
child = this.writeNode('Polygon', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.MULTI_POLYGON) {
|
||||
child = this.writeNode('MultiPolygon', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.GEOMETRY_COLLECTION) {
|
||||
child = this.writeNode('GeometryCollection', geometry, null, node);
|
||||
}
|
||||
if (goog.isDefAndNotNull(this.srsName)) {
|
||||
this.setAttributeNS(child, null, 'srsName', this.srsName);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'_attribute': function(obj) {
|
||||
var node = this.createElementNS('feature:' + obj.name, this.featureNS);
|
||||
node.appendChild(this.createTextNode(obj.value));
|
||||
return node;
|
||||
}
|
||||
};
|
||||
if (goog.isDef(this.featureNS)) {
|
||||
this.writers[this.featureNS] = this.featureNSWriters_;
|
||||
}
|
||||
goog.base(this);
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.GML, ol.parser.XML);
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.Geometry} geometry Geometry.
|
||||
* @return {Element} XML node representing the geometry.
|
||||
*/
|
||||
ol.parser.ogc.GML.prototype.writeGeometry = function(geometry) {
|
||||
return this.featureNSWriters_['_geometry'].call(this, {value: geometry})
|
||||
.firstChild;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string|Document|Element|Object} data Data to read.
|
||||
* @param {olx.parser.GMLReadOptions=} opt_options Read options.
|
||||
* @return {ol.parser.ReadFeaturesResult} An object representing the document.
|
||||
*/
|
||||
ol.parser.ogc.GML.prototype.read = function(data, opt_options) {
|
||||
var srsName;
|
||||
if (goog.isDef(opt_options) && goog.isDef(opt_options.srsName)) {
|
||||
srsName = opt_options.srsName;
|
||||
} else if (goog.isDef(this.readOptions) &&
|
||||
goog.isDef(this.readOptions.srsName)) {
|
||||
srsName = this.readOptions.srsName;
|
||||
}
|
||||
if (goog.isDef(srsName)) {
|
||||
this.srsName = goog.isString(srsName) ? srsName : srsName.getCode();
|
||||
}
|
||||
if (goog.isDef(opt_options) && goog.isDef(opt_options.axisOrientation)) {
|
||||
this.axisOrientation = opt_options.axisOrientation;
|
||||
} else if (goog.isDef(this.readOptions) &&
|
||||
goog.isDef(this.readOptions.axisOrientation)) {
|
||||
this.axisOrientation = this.readOptions.axisOrientation;
|
||||
}
|
||||
if (typeof data == 'string') {
|
||||
data = goog.dom.xml.loadXml(data);
|
||||
}
|
||||
if (data && data.nodeType == 9) {
|
||||
data = data.documentElement;
|
||||
}
|
||||
var obj = /** @type {ol.parser.ReadFeaturesResult} */
|
||||
({features: [], metadata: {}});
|
||||
this.readNode(data, obj, true);
|
||||
obj.metadata.projection = this.srsName;
|
||||
delete this.srsName;
|
||||
delete this.axisOrientation;
|
||||
return obj;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Element|Document} node The node to be read.
|
||||
* @param {Object} obj The object to be modified.
|
||||
* @param {boolean=} opt_first Should be set to true for the first node read.
|
||||
* This is usually the readNode call in the read method. Without this being
|
||||
* set, auto-configured properties will stick on subsequent reads.
|
||||
* @return {Object} The input object, modified (or a new one if none was
|
||||
* provided).
|
||||
*/
|
||||
ol.parser.ogc.GML.prototype.readNode = function(node, obj, opt_first) {
|
||||
// on subsequent calls of this.read(), we want to reset auto-
|
||||
// configured properties and auto-configure again.
|
||||
if (opt_first === true && this.autoConfig === true) {
|
||||
this.featureType = null;
|
||||
delete this.readers[this.featureNS];
|
||||
delete this.writers[this.featureNS];
|
||||
this.featureNS = null;
|
||||
}
|
||||
// featureType auto-configuration
|
||||
if (!this.featureNS && (!(node.namespaceURI in this.readers) &&
|
||||
node.parentNode.namespaceURI == this.defaultNamespaceURI &&
|
||||
(/^(.*:)?featureMembers?$/).test(node.parentNode.nodeName))) {
|
||||
this.featureType = node.nodeName.split(':').pop();
|
||||
this.readers[node.namespaceURI] = this.featureNSReaders_;
|
||||
this.writers[node.namespaceURI] = this.featureNSWriters_;
|
||||
this.featureNS = node.namespaceURI;
|
||||
this.autoConfig = true;
|
||||
}
|
||||
return ol.parser.XML.prototype.readNode.apply(this, [node, obj]);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Object} container Geometry container.
|
||||
* @return {ol.geom.Geometry} The geometry created.
|
||||
*/
|
||||
// TODO use a mixin since this is also used in the KML parser
|
||||
ol.parser.ogc.GML.prototype.createGeometry = function(container) {
|
||||
var geometry = null, coordinates, i, ii;
|
||||
switch (container.geometry.type) {
|
||||
case ol.geom.GeometryType.POINT:
|
||||
geometry = new ol.geom.Point(container.geometry.coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.LINEAR_RING:
|
||||
geometry = new ol.geom.LinearRing(container.geometry.coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.LINE_STRING:
|
||||
geometry = new ol.geom.LineString(container.geometry.coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.POLYGON:
|
||||
geometry = new ol.geom.Polygon(container.geometry.coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.MULTI_POINT:
|
||||
coordinates = [];
|
||||
for (i = 0, ii = container.geometry.parts.length; i < ii; i++) {
|
||||
coordinates.push(container.geometry.parts[i].coordinates);
|
||||
}
|
||||
geometry = new ol.geom.MultiPoint(coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.MULTI_LINE_STRING:
|
||||
coordinates = [];
|
||||
for (i = 0, ii = container.geometry.parts.length; i < ii; i++) {
|
||||
coordinates.push(container.geometry.parts[i].coordinates);
|
||||
}
|
||||
geometry = new ol.geom.MultiLineString(coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.MULTI_POLYGON:
|
||||
coordinates = [];
|
||||
for (i = 0, ii = container.geometry.parts.length; i < ii; i++) {
|
||||
coordinates.push(container.geometry.parts[i].coordinates);
|
||||
}
|
||||
geometry = new ol.geom.MultiPolygon(coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.GEOMETRY_COLLECTION:
|
||||
var geometries = [];
|
||||
for (i = 0, ii = container.geometry.parts.length; i < ii; i++) {
|
||||
geometries.push(this.createGeometry({
|
||||
geometry: container.geometry.parts[i]
|
||||
}));
|
||||
}
|
||||
geometry = new ol.geom.GeometryCollection(geometries);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return geometry;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Parse a GML document provided as a string.
|
||||
* @param {string} str GML document.
|
||||
* @return {ol.parser.ReadFeaturesResult} Features and metadata.
|
||||
*/
|
||||
ol.parser.ogc.GML.prototype.readFeaturesFromString = function(str) {
|
||||
return this.read(str);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Applies the writeOptions passed into the write function.
|
||||
* @param {ol.parser.ReadFeaturesResult} obj Object structure to write out as
|
||||
* GML.
|
||||
* @param {olx.parser.GMLWriteOptions=} opt_options Write options.
|
||||
*/
|
||||
ol.parser.ogc.GML.prototype.applyWriteOptions = function(obj, opt_options) {
|
||||
// srsName handling: opt_options -> this.writeOptions -> obj.metadata
|
||||
var srsName;
|
||||
if (goog.isDef(opt_options) && goog.isDef(opt_options.srsName)) {
|
||||
srsName = opt_options.srsName;
|
||||
} else if (goog.isDef(this.writeOptions) &&
|
||||
goog.isDef(this.writeOptions.srsName)) {
|
||||
srsName = this.writeOptions.srsName;
|
||||
} else if (goog.isDef(obj.metadata)) {
|
||||
srsName = obj.metadata.projection;
|
||||
}
|
||||
goog.asserts.assert(goog.isDef(srsName), 'srsName required for writing GML');
|
||||
this.srsName = goog.isString(srsName) ? srsName : srsName.getCode();
|
||||
// axisOrientation handling: opt_options -> this.writeOptions
|
||||
if (goog.isDef(opt_options) && goog.isDef(opt_options.axisOrientation)) {
|
||||
this.axisOrientation = opt_options.axisOrientation;
|
||||
} else if (goog.isDef(this.writeOptions) &&
|
||||
goog.isDef(this.writeOptions.axisOrientation)) {
|
||||
this.axisOrientation = this.writeOptions.axisOrientation;
|
||||
} else {
|
||||
this.axisOrientation = ol.proj.get(this.srsName).getAxisOrientation();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} featureNS Feature namespace.
|
||||
*/
|
||||
ol.parser.ogc.GML.prototype.setFeatureNS = function(featureNS) {
|
||||
this.featureNS = featureNS;
|
||||
this.readers[featureNS] = this.featureNSReaders_;
|
||||
this.writers[featureNS] = this.featureNSWriters_;
|
||||
};
|
||||
@@ -1,145 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.GML_v2');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.parser.ogc.GML');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Read and write [GML](http://www.opengeospatial.org/standards/gml)
|
||||
* version 2.1.2
|
||||
*
|
||||
* @constructor
|
||||
* @param {olx.parser.GMLOptions=} opt_options Optional configuration object.
|
||||
* @extends {ol.parser.ogc.GML}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.parser.ogc.GML_v2 = function(opt_options) {
|
||||
this.schemaLocation = 'http://www.opengis.net/gml ' +
|
||||
'http://schemas.opengis.net/gml/2.1.2/feature.xsd';
|
||||
goog.base(this, opt_options);
|
||||
goog.object.extend(this.readers['http://www.opengis.net/gml'], {
|
||||
'outerBoundaryIs': function(node, container) {
|
||||
var coordinates = [];
|
||||
this.readChildNodes(node, coordinates);
|
||||
container['outer'] = coordinates[0][0];
|
||||
},
|
||||
'innerBoundaryIs': function(node, container) {
|
||||
var coordinates = [];
|
||||
this.readChildNodes(node, coordinates);
|
||||
container.inner.push(coordinates[0][0]);
|
||||
},
|
||||
'Box': function(node, container) {
|
||||
var coordinates = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, coordinates, container]);
|
||||
this.readChildNodes(node, coordinates);
|
||||
container.projection = node.getAttribute('srsName');
|
||||
container.bounds = [
|
||||
coordinates[0][0][0], coordinates[0][0][1],
|
||||
coordinates[0][1][0], coordinates[0][1][1]
|
||||
];
|
||||
}
|
||||
});
|
||||
goog.object.extend(this.writers['http://www.opengis.net/gml'], {
|
||||
'Point': function(geometry) {
|
||||
var node = this.createElementNS('gml:Point');
|
||||
this.writeNode('coordinates', [geometry.getCoordinates()], null, node);
|
||||
return node;
|
||||
},
|
||||
'coordinates': function(coordinates) {
|
||||
var numCoordinates = coordinates.length;
|
||||
var parts = new Array(numCoordinates);
|
||||
for (var i = 0; i < numCoordinates; ++i) {
|
||||
var coord = coordinates[i];
|
||||
var part = goog.array.concat(coord);
|
||||
if (goog.isDef(this.axisOrientation) &&
|
||||
this.axisOrientation.substr(0, 2) !== 'en') {
|
||||
part[0] = coord[1];
|
||||
part[1] = coord[0];
|
||||
}
|
||||
parts[i] = part.join(',');
|
||||
}
|
||||
var value = parts.join(' ');
|
||||
var node = this.createElementNS('gml:coordinates');
|
||||
this.setAttributeNS(node, null, 'decimal', '.');
|
||||
this.setAttributeNS(node, null, 'cs', ',');
|
||||
this.setAttributeNS(node, null, 'ts', ' ');
|
||||
node.appendChild(this.createTextNode(value));
|
||||
return node;
|
||||
},
|
||||
'LineString': function(geometry) {
|
||||
var node = this.createElementNS('gml:LineString');
|
||||
this.writeNode('coordinates', geometry.getCoordinates(), null, node);
|
||||
return node;
|
||||
},
|
||||
'Polygon': function(geometry) {
|
||||
var node = this.createElementNS('gml:Polygon');
|
||||
var coordinates = geometry.getCoordinates();
|
||||
/**
|
||||
* Though there continues to be ambiguity around this, GML references
|
||||
* ISO 19107, which says polygons have counter-clockwise exterior rings
|
||||
* and clockwise interior rings. The ambiguity comes because the
|
||||
* the Simple Feature Access - SQL spec (ISO 19125-2) says that no
|
||||
* winding order is enforced. Anyway, we write out counter-clockwise
|
||||
* exterior and clockwise interior here but accept either when reading.
|
||||
*/
|
||||
this.writeNode('outerBoundaryIs', coordinates[0].reverse(), null, node);
|
||||
for (var i = 1; i < coordinates.length; ++i) {
|
||||
this.writeNode('innerBoundaryIs', coordinates[i].reverse(), null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'outerBoundaryIs': function(ring) {
|
||||
var node = this.createElementNS('gml:outerBoundaryIs');
|
||||
this.writeNode('LinearRing', ring, null, node);
|
||||
return node;
|
||||
},
|
||||
'innerBoundaryIs': function(ring) {
|
||||
var node = this.createElementNS('gml:innerBoundaryIs');
|
||||
this.writeNode('LinearRing', ring, null, node);
|
||||
return node;
|
||||
},
|
||||
'LinearRing': function(ring) {
|
||||
var node = this.createElementNS('gml:LinearRing');
|
||||
this.writeNode('coordinates', ring, null, node);
|
||||
return node;
|
||||
},
|
||||
'Box': function(extent) {
|
||||
var node = this.createElementNS('gml:Box');
|
||||
var coordinates = [
|
||||
[extent[0], extent[1]],
|
||||
[extent[2], extent[3]]
|
||||
];
|
||||
this.writeNode('coordinates', coordinates, null, node);
|
||||
// srsName attribute is optional for gml:Box
|
||||
if (goog.isDefAndNotNull(this.srsName)) {
|
||||
node.setAttribute('srsName', this.srsName);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.GML_v2, ol.parser.ogc.GML);
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.parser.ReadFeaturesResult} obj Object structure to write out as
|
||||
* GML.
|
||||
* @param {olx.parser.GMLWriteOptions=} opt_options Write options.
|
||||
* @return {string} A string representing the GML document.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.parser.ogc.GML_v2.prototype.write = function(obj, opt_options) {
|
||||
this.applyWriteOptions(obj, opt_options);
|
||||
var root = this.writeNode('FeatureCollection', obj.features,
|
||||
'http://www.opengis.net/wfs');
|
||||
this.setAttributeNS(
|
||||
root, 'http://www.w3.org/2001/XMLSchema-instance',
|
||||
'xsi:schemaLocation', this.schemaLocation);
|
||||
var gml = this.serialize(root);
|
||||
delete this.srsName;
|
||||
delete this.axisOrientation;
|
||||
return gml;
|
||||
};
|
||||
@@ -1,442 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.GML_v3');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.functions');
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.geom.GeometryType');
|
||||
goog.require('ol.parser.ogc.GML');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Read and write [GML](http://www.opengeospatial.org/standards/gml)
|
||||
* version 3.1.1
|
||||
*
|
||||
* @constructor
|
||||
* @param {olx.parser.GMLOptions=} opt_options Optional configuration object.
|
||||
* @extends {ol.parser.ogc.GML}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.parser.ogc.GML_v3 = function(opt_options) {
|
||||
this.schemaLocation = 'http://www.opengis.net/gml ' +
|
||||
'http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/' +
|
||||
'1.0.0/gmlsf.xsd';
|
||||
goog.base(this, opt_options);
|
||||
this.featureNSWriters_['_geometry'] = function(obj) {
|
||||
var node = this.createElementNS('feature:' + obj.name,
|
||||
this.featureNS);
|
||||
var geometry = obj.value;
|
||||
var type = geometry.getType(), child;
|
||||
if (type === ol.geom.GeometryType.POINT) {
|
||||
child = this.writeNode('Point', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.MULTI_POINT) {
|
||||
child = this.writeNode('MultiPoint', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.LINE_STRING) {
|
||||
if (this.curve === true) {
|
||||
child = this.writeNode('Curve', geometry, null, node);
|
||||
} else {
|
||||
child = this.writeNode('LineString', geometry, null, node);
|
||||
}
|
||||
} else if (type === ol.geom.GeometryType.LINEAR_RING) {
|
||||
child = this.writeNode('LinearRing', geometry.getCoordinates(), null,
|
||||
node);
|
||||
} else if (type === ol.geom.GeometryType.MULTI_LINE_STRING) {
|
||||
if (this.multiCurve === false) {
|
||||
child = this.writeNode('MultiLineString', geometry, null, node);
|
||||
} else {
|
||||
child = this.writeNode('MultiCurve', geometry, null, node);
|
||||
}
|
||||
} else if (type === ol.geom.GeometryType.POLYGON) {
|
||||
if (this.surface === true) {
|
||||
child = this.writeNode('Surface', geometry, null, node);
|
||||
} else {
|
||||
child = this.writeNode('Polygon', geometry, null, node);
|
||||
}
|
||||
} else if (type === ol.geom.GeometryType.MULTI_POLYGON) {
|
||||
if (this.multiSurface === false) {
|
||||
child = this.writeNode('MultiPolygon', geometry, null, node);
|
||||
} else {
|
||||
child = this.writeNode('MultiSurface', geometry, null, node);
|
||||
}
|
||||
} else if (type === ol.geom.GeometryType.GEOMETRY_COLLECTION) {
|
||||
child = this.writeNode('MultiGeometry', geometry, null, node);
|
||||
}
|
||||
if (goog.isDefAndNotNull(this.srsName)) {
|
||||
this.setAttributeNS(child, null, 'srsName', this.srsName);
|
||||
}
|
||||
return node;
|
||||
};
|
||||
goog.object.extend(this.readers['http://www.opengis.net/gml'], {
|
||||
'_inherit': goog.functions.sequence(
|
||||
this.readers['http://www.opengis.net/gml']['_inherit'],
|
||||
function(node, obj, container) {
|
||||
// SRSReferenceGroup attributes
|
||||
var dim = parseInt(node.getAttribute('srsDimension'), 10) ||
|
||||
(container && container.srsDimension);
|
||||
if (dim) {
|
||||
obj.srsDimension = dim;
|
||||
}
|
||||
}),
|
||||
'featureMembers': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'Curve': function(node, container) {
|
||||
var coordinates = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, coordinates, container]);
|
||||
this.readChildNodes(node, coordinates);
|
||||
var linestring = {
|
||||
type: ol.geom.GeometryType.LINE_STRING,
|
||||
coordinates: coordinates[0]
|
||||
};
|
||||
// in the case of a multi geometry this is parts
|
||||
if (goog.isArray(container)) {
|
||||
container.push(linestring);
|
||||
} else {
|
||||
container.geometry = linestring;
|
||||
}
|
||||
},
|
||||
'segments': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'LineStringSegment': function(node, container) {
|
||||
var coordinates = [];
|
||||
this.readChildNodes(node, coordinates);
|
||||
container.push(coordinates[0]);
|
||||
},
|
||||
'pos': function(node, obj) {
|
||||
var str = this.getChildValue(node).replace(
|
||||
this.regExes.trimSpace, '');
|
||||
var coords = goog.array.map(str.split(this.regExes.splitSpace),
|
||||
parseFloat);
|
||||
if (this.axisOrientation.substr(0, 2) === 'en') {
|
||||
obj.push([coords]);
|
||||
} else {
|
||||
if (coords.length === 2) {
|
||||
obj.push([coords.reverse()]);
|
||||
} else if (coords.length === 3) {
|
||||
obj.push([[coords[1], coords[0], coords[2]]]);
|
||||
}
|
||||
}
|
||||
},
|
||||
'posList': function(node, obj) {
|
||||
var str = this.getChildValue(node).replace(
|
||||
this.regExes.trimSpace, '');
|
||||
var coords = str.split(this.regExes.splitSpace);
|
||||
// The "dimension" attribute is from the GML 3.0.1 spec.
|
||||
var dim = obj.srsDimension ||
|
||||
parseInt(node.getAttribute('srsDimension') ||
|
||||
node.getAttribute('dimension'), 10) || 2;
|
||||
var x, y, z;
|
||||
var numPoints = coords.length / dim;
|
||||
var points = new Array(numPoints);
|
||||
for (var i = 0, ii = coords.length; i < ii; i += dim) {
|
||||
x = parseFloat(coords[i]);
|
||||
y = parseFloat(coords[i + 1]);
|
||||
var xy = this.axisOrientation.substr(0, 2) === 'en';
|
||||
if (dim === 3) {
|
||||
if (xy) {
|
||||
points[i / dim] = [x, y, parseFloat(coords[i + 2])];
|
||||
} else {
|
||||
points[i / dim] = [y, x, parseFloat(coords[i + 2])];
|
||||
}
|
||||
} else if (dim === 2) {
|
||||
if (xy) {
|
||||
points[i / dim] = [x, y];
|
||||
} else {
|
||||
points[i / dim] = [y, x];
|
||||
}
|
||||
}
|
||||
}
|
||||
obj.push(points);
|
||||
},
|
||||
'Surface': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'patches': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'PolygonPatch': function(node, obj) {
|
||||
this.readers[this.defaultNamespaceURI]['Polygon'].apply(this,
|
||||
[node, obj]);
|
||||
},
|
||||
'exterior': function(node, container) {
|
||||
var coordinates = [];
|
||||
this.readChildNodes(node, coordinates);
|
||||
container.outer = coordinates[0][0];
|
||||
},
|
||||
'interior': function(node, container) {
|
||||
var coordinates = [];
|
||||
this.readChildNodes(node, coordinates);
|
||||
container.inner.push(coordinates[0][0]);
|
||||
},
|
||||
'MultiCurve': function(node, container) {
|
||||
var parts = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, parts, container]);
|
||||
this.readChildNodes(node, parts);
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.MULTI_LINE_STRING,
|
||||
parts: parts
|
||||
};
|
||||
},
|
||||
'curveMember': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'MultiSurface': function(node, container) {
|
||||
var parts = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, parts, container]);
|
||||
this.readChildNodes(node, parts);
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.MULTI_POLYGON,
|
||||
parts: parts
|
||||
};
|
||||
},
|
||||
'surfaceMember': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'surfaceMembers': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'pointMembers': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'lineStringMembers': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'polygonMembers': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'geometryMembers': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'Envelope': function(node, container) {
|
||||
var coordinates = [];
|
||||
this.readers[this.defaultNamespaceURI]['_inherit'].apply(this,
|
||||
[node, coordinates, container]);
|
||||
this.readChildNodes(node, coordinates);
|
||||
container.projection = node.getAttribute('srsName');
|
||||
container.bounds = [
|
||||
coordinates[0][0], coordinates[0][1],
|
||||
coordinates[1][0], coordinates[1][1]
|
||||
];
|
||||
},
|
||||
'lowerCorner': function(node, envelope) {
|
||||
var coordinates = [];
|
||||
this.readers[this.defaultNamespaceURI]['pos'].apply(this,
|
||||
[node, coordinates]);
|
||||
envelope.push(coordinates[0][0]);
|
||||
},
|
||||
'upperCorner': function(node, envelope) {
|
||||
var coordinates = [];
|
||||
this.readers[this.defaultNamespaceURI]['pos'].apply(this,
|
||||
[node, coordinates]);
|
||||
envelope.push(coordinates[0][0]);
|
||||
}
|
||||
});
|
||||
goog.object.extend(this.writers['http://www.opengis.net/gml'], {
|
||||
'featureMembers': function(features) {
|
||||
var node = this.createElementNS('gml:featureMembers');
|
||||
for (var i = 0, ii = features.length; i < ii; ++i) {
|
||||
this.writeNode('_typeName', features[i], this.featureNS, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'Point': function(geometry) {
|
||||
var node = this.createElementNS('gml:Point');
|
||||
this.writeNode('pos', geometry.getCoordinates(), null, node);
|
||||
return node;
|
||||
},
|
||||
'pos': function(point) {
|
||||
// only 2d for simple features profile
|
||||
var pos;
|
||||
if (this.axisOrientation.substr(0, 2) === 'en') {
|
||||
pos = (point[0] + ' ' + point[1]);
|
||||
} else {
|
||||
pos = (point[1] + ' ' + point[0]);
|
||||
}
|
||||
var node = this.createElementNS('gml:pos');
|
||||
node.appendChild(this.createTextNode(pos));
|
||||
return node;
|
||||
},
|
||||
'LineString': function(geometry) {
|
||||
var node = this.createElementNS('gml:LineString');
|
||||
this.writeNode('posList', geometry.getCoordinates(), null, node);
|
||||
return node;
|
||||
},
|
||||
'Curve': function(geometry) {
|
||||
var node = this.createElementNS('gml:Curve');
|
||||
this.writeNode('segments', geometry, null, node);
|
||||
return node;
|
||||
},
|
||||
'segments': function(geometry) {
|
||||
var node = this.createElementNS('gml:segments');
|
||||
this.writeNode('LineStringSegment', geometry, null, node);
|
||||
return node;
|
||||
},
|
||||
'LineStringSegment': function(geometry) {
|
||||
var node = this.createElementNS('gml:LineStringSegment');
|
||||
this.writeNode('posList', geometry.getCoordinates(), null, node);
|
||||
return node;
|
||||
},
|
||||
'posList': function(points) {
|
||||
// only 2d for simple features profile
|
||||
var len = points.length;
|
||||
var parts = new Array(len);
|
||||
var point;
|
||||
for (var i = 0; i < len; ++i) {
|
||||
point = points[i];
|
||||
if (this.axisOrientation.substr(0, 2) === 'en') {
|
||||
parts[i] = point[0] + ' ' + point[1];
|
||||
} else {
|
||||
parts[i] = point[1] + ' ' + point[0];
|
||||
}
|
||||
}
|
||||
var node = this.createElementNS('gml:posList');
|
||||
node.appendChild(this.createTextNode(parts.join(' ')));
|
||||
return node;
|
||||
},
|
||||
'Surface': function(geometry) {
|
||||
var node = this.createElementNS('gml:Surface');
|
||||
this.writeNode('patches', geometry, null, node);
|
||||
return node;
|
||||
},
|
||||
'patches': function(geometry) {
|
||||
var node = this.createElementNS('gml:patches');
|
||||
this.writeNode('PolygonPatch', geometry, null, node);
|
||||
return node;
|
||||
},
|
||||
'PolygonPatch': function(geometry) {
|
||||
var node = this.createElementNS('gml:PolygonPatch');
|
||||
node.setAttribute('interpolation', 'planar');
|
||||
var coordinates = geometry.getCoordinates();
|
||||
this.writeNode('exterior', coordinates[0].reverse(), null, node);
|
||||
for (var i = 1, len = coordinates.length; i < len; ++i) {
|
||||
this.writeNode('interior', coordinates[i].reverse(), null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'Polygon': function(geometry) {
|
||||
var node = this.createElementNS('gml:Polygon');
|
||||
var coordinates = geometry.getCoordinates();
|
||||
/**
|
||||
* Though there continues to be ambiguity around this, GML references
|
||||
* ISO 19107, which says polygons have counter-clockwise exterior rings
|
||||
* and clockwise interior rings. The ambiguity comes because the
|
||||
* the Simple Feature Access - SQL spec (ISO 19125-2) says that no
|
||||
* winding order is enforced. Anyway, we write out counter-clockwise
|
||||
* exterior and clockwise interior here but accept either when reading.
|
||||
*/
|
||||
this.writeNode('exterior', coordinates[0].reverse(), null, node);
|
||||
for (var i = 1, len = coordinates.length; i < len; ++i) {
|
||||
this.writeNode('interior', coordinates[i].reverse(), null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'exterior': function(ring) {
|
||||
var node = this.createElementNS('gml:exterior');
|
||||
this.writeNode('LinearRing', ring, null, node);
|
||||
return node;
|
||||
},
|
||||
'interior': function(ring) {
|
||||
var node = this.createElementNS('gml:interior');
|
||||
this.writeNode('LinearRing', ring, null, node);
|
||||
return node;
|
||||
},
|
||||
'LinearRing': function(ring) {
|
||||
var node = this.createElementNS('gml:LinearRing');
|
||||
this.writeNode('posList', ring, null, node);
|
||||
return node;
|
||||
},
|
||||
'MultiCurve': function(geometry) {
|
||||
var node = this.createElementNS('gml:MultiCurve');
|
||||
var components = geometry.getComponents();
|
||||
for (var i = 0, len = components.length; i < len; ++i) {
|
||||
this.writeNode('curveMember', components[i], null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'curveMember': function(geometry) {
|
||||
var node = this.createElementNS('gml:curveMember');
|
||||
if (this.curve) {
|
||||
this.writeNode('Curve', geometry, null, node);
|
||||
} else {
|
||||
this.writeNode('LineString', geometry, null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'MultiSurface': function(geometry) {
|
||||
var node = this.createElementNS('gml:MultiSurface');
|
||||
var components = geometry.getComponents();
|
||||
for (var i = 0, len = components.length; i < len; ++i) {
|
||||
this.writeNode('surfaceMember', components[i], null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'surfaceMember': function(polygon) {
|
||||
var node = this.createElementNS('gml:surfaceMember');
|
||||
if (this.surface) {
|
||||
this.writeNode('Surface', polygon, null, node);
|
||||
} else {
|
||||
this.writeNode('Polygon', polygon, null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'Envelope': function(bounds) {
|
||||
var node = this.createElementNS('gml:Envelope');
|
||||
this.writeNode('lowerCorner', bounds, null, node);
|
||||
this.writeNode('upperCorner', bounds, null, node);
|
||||
// srsName attribute is required for gml:Envelope
|
||||
if (goog.isDef(this.srsName)) {
|
||||
node.setAttribute('srsName', this.srsName);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'lowerCorner': function(bounds) {
|
||||
// only 2d for simple features profile
|
||||
var pos;
|
||||
if (this.axisOrientation.substr(0, 2) === 'en') {
|
||||
pos = (bounds[0] + ' ' + bounds[1]);
|
||||
} else {
|
||||
pos = (bounds[1] + ' ' + bounds[0]);
|
||||
}
|
||||
var node = this.createElementNS('gml:lowerCorner');
|
||||
node.appendChild(this.createTextNode(pos));
|
||||
return node;
|
||||
},
|
||||
'upperCorner': function(bounds) {
|
||||
// only 2d for simple features profile
|
||||
var pos;
|
||||
if (this.axisOrientation.substr(0, 2) === 'en') {
|
||||
pos = (bounds[2] + ' ' + bounds[3]);
|
||||
} else {
|
||||
pos = (bounds[3] + ' ' + bounds[2]);
|
||||
}
|
||||
var node = this.createElementNS('gml:upperCorner');
|
||||
node.appendChild(this.createTextNode(pos));
|
||||
return node;
|
||||
}
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.GML_v3, ol.parser.ogc.GML);
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.parser.ReadFeaturesResult} obj Object structure to write out as
|
||||
* XML.
|
||||
* @param {olx.parser.GMLWriteOptions=} opt_options Write options.
|
||||
* @return {string} An string representing the XML document.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.parser.ogc.GML_v3.prototype.write = function(obj, opt_options) {
|
||||
this.applyWriteOptions(obj, opt_options);
|
||||
var root = this.writeNode('featureMembers', obj.features);
|
||||
this.setAttributeNS(
|
||||
root, 'http://www.w3.org/2001/XMLSchema-instance',
|
||||
'xsi:schemaLocation', this.schemaLocation);
|
||||
var gml = this.serialize(root);
|
||||
delete this.srsName;
|
||||
delete this.axisOrientation;
|
||||
return gml;
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
@exportSymbol ol.parser.ogc.WFS
|
||||
@exportProperty ol.parser.ogc.WFS_v1.prototype.writeGetFeature
|
||||
@exportProperty ol.parser.ogc.WFS_v1.prototype.writeTransaction
|
||||
@@ -1,37 +0,0 @@
|
||||
goog.require('ol.parser.ogc.Versioned');
|
||||
goog.provide('ol.parser.ogc.WFS');
|
||||
goog.require('ol.parser.ogc.WFS_v1_0_0');
|
||||
goog.require('ol.parser.ogc.WFS_v1_1_0');
|
||||
|
||||
|
||||
/**
|
||||
* @define {boolean} Whether to enable OGC WFS version 1.0.0.
|
||||
*/
|
||||
ol.ENABLE_WFS_1_0_0 = true;
|
||||
|
||||
|
||||
/**
|
||||
* @define {boolean} Whether to enable OGC WFS version 1.1.0.
|
||||
*/
|
||||
ol.ENABLE_WFS_1_1_0 = true;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object=} opt_options Options which will be set on this object.
|
||||
* @extends {ol.parser.ogc.Versioned}
|
||||
*/
|
||||
ol.parser.ogc.WFS = function(opt_options) {
|
||||
var options = opt_options || {};
|
||||
options['defaultVersion'] = '1.0.0';
|
||||
this.parsers = {};
|
||||
if (ol.ENABLE_WFS_1_0_0) {
|
||||
this.parsers['v1_0_0'] = ol.parser.ogc.WFS_v1_0_0;
|
||||
}
|
||||
if (ol.ENABLE_WFS_1_1_0) {
|
||||
this.parsers['v1_1_0'] = ol.parser.ogc.WFS_v1_1_0;
|
||||
}
|
||||
goog.base(this, options);
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WFS, ol.parser.ogc.Versioned);
|
||||
@@ -1,366 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.WFS_v1');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('ol.expr.Call');
|
||||
goog.require('ol.expr.Identifier');
|
||||
goog.require('ol.expr.Literal');
|
||||
goog.require('ol.geom.Geometry');
|
||||
goog.require('ol.parser.XML');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.parser.XML}
|
||||
* @param {Object=} opt_options Options which will be set on this object.
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1 = function(opt_options) {
|
||||
this.defaultNamespaceURI = 'http://www.opengis.net/wfs';
|
||||
|
||||
// TODO set errorProperty
|
||||
this.readers = {};
|
||||
this.readers[this.defaultNamespaceURI] = {
|
||||
'FeatureCollection': function(node, obj) {
|
||||
obj.features = [];
|
||||
this.readChildNodes(node, obj);
|
||||
}
|
||||
};
|
||||
this.writers = {};
|
||||
this.writers[this.defaultNamespaceURI] = {
|
||||
/**
|
||||
* @param {olx.parser.WFSWriteGetFeatureOptions} options Options.
|
||||
* @return {{node: Node,
|
||||
* options: olx.parser.WFSWriteGetFeatureOptions}} Object.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
'GetFeature': function(options) {
|
||||
var node = this.createElementNS('wfs:GetFeature');
|
||||
node.setAttribute('service', 'WFS');
|
||||
node.setAttribute('version', this.version);
|
||||
if (goog.isDef(options)) {
|
||||
if (goog.isDef(options.handle)) {
|
||||
node.setAttribute('handle', options.handle);
|
||||
}
|
||||
if (goog.isDef(options.outputFormat)) {
|
||||
node.setAttribute('outputFormat', options.outputFormat);
|
||||
}
|
||||
if (goog.isDef(options.maxFeatures)) {
|
||||
node.setAttribute('maxFeatures', options.maxFeatures);
|
||||
}
|
||||
if (goog.isDef(options.srsName)) {
|
||||
this.setSrsName(options.srsName);
|
||||
}
|
||||
}
|
||||
for (var i = 0, ii = options.featureTypes.length; i < ii; i++) {
|
||||
options.featureType = options.featureTypes[i];
|
||||
this.writeNode('Query', options, null, node);
|
||||
}
|
||||
this.setAttributeNS(
|
||||
node, 'http://www.w3.org/2001/XMLSchema-instance',
|
||||
'xsi:schemaLocation', this.schemaLocation);
|
||||
return {node: node, options: options};
|
||||
},
|
||||
/**
|
||||
* @param {{inserts: Array.<ol.Feature>,
|
||||
* updates: Array.<ol.Feature>,
|
||||
* deletes: Array.<ol.Feature>,
|
||||
* options: olx.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* @return {Element} Node.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
'Transaction': function(obj) {
|
||||
var options = obj.options;
|
||||
this.setFeatureType(options.featureType);
|
||||
this.setFeatureNS(options.featureNS);
|
||||
if (goog.isDef(options.srsName)) {
|
||||
this.setSrsName(options.srsName);
|
||||
}
|
||||
var node = this.createElementNS('wfs:Transaction');
|
||||
node.setAttribute('service', 'WFS');
|
||||
node.setAttribute('version', this.version);
|
||||
if (goog.isDef(options.handle)) {
|
||||
node.setAttribute('handle', options.handle);
|
||||
}
|
||||
var i, ii, features, feature;
|
||||
var operations = {
|
||||
'Insert': obj.inserts,
|
||||
'Update': obj.updates,
|
||||
'Delete': obj.deletes
|
||||
};
|
||||
for (var name in operations) {
|
||||
features = operations[name];
|
||||
if (!goog.isNull(features)) {
|
||||
// TODO implement multi option for geometry types
|
||||
for (i = 0, ii = features.length; i < ii; ++i) {
|
||||
feature = features[i];
|
||||
this.writeNode(name, {feature: feature, options: options}, null,
|
||||
node);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (goog.isDef(options.nativeElements)) {
|
||||
for (i = 0, ii = options.nativeElements.length; i < ii; ++i) {
|
||||
this.writeNode('Native', options.nativeElements[i], null, node);
|
||||
}
|
||||
}
|
||||
return node;
|
||||
},
|
||||
/**
|
||||
* @param {{vendorId: string, safeToIgnore: boolean, value: string}}
|
||||
* nativeElement Native element.
|
||||
* @return {Node} Node.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
'Native': function(nativeElement) {
|
||||
var node = this.createElementNS('wfs:Native');
|
||||
node.setAttribute('vendorId', nativeElement.vendorId);
|
||||
node.setAttribute('safeToIgnore', nativeElement.safeToIgnore);
|
||||
node.appendChild(this.createTextNode(nativeElement.value));
|
||||
return node;
|
||||
},
|
||||
/**
|
||||
* @param {{feature: ol.Feature,
|
||||
* options: olx.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* @return {Element} Node.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
'Insert': function(obj) {
|
||||
var feature = obj.feature;
|
||||
var options = obj.options;
|
||||
var node = this.createElementNS('wfs:Insert');
|
||||
if (goog.isDef(options) && goog.isDef(options.handle)) {
|
||||
this.setAttributeNS(node, this.defaultNamespaceURI, 'handle',
|
||||
options.handle);
|
||||
}
|
||||
if (goog.isDef(options.srsName)) {
|
||||
this.setSrsName(options.srsName);
|
||||
}
|
||||
this.writeNode('_typeName', feature, options.featureNS, node);
|
||||
return node;
|
||||
},
|
||||
/**
|
||||
* @param {{feature: ol.Feature,
|
||||
* options: olx.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* @return {Element} Node.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
'Update': function(obj) {
|
||||
var feature = obj.feature;
|
||||
var options = obj.options;
|
||||
var node = this.createElementNS('wfs:Update');
|
||||
this.setAttributeNS(node, this.defaultNamespaceURI, 'typeName',
|
||||
(goog.isDef(options.featureNS) ? options.featurePrefix + ':' : '') +
|
||||
options.featureType);
|
||||
if (goog.isDef(options.handle)) {
|
||||
this.setAttributeNS(node, this.defaultNamespaceURI, 'handle',
|
||||
options.handle);
|
||||
}
|
||||
|
||||
// add in fields
|
||||
var attributes = feature.getAttributes();
|
||||
var attribute;
|
||||
for (var key in attributes) {
|
||||
attribute = attributes[key];
|
||||
// TODO Only add geometries whose values have changed
|
||||
if (goog.isDef(attribute)) {
|
||||
this.writeNode('Property', {name: key, value: attribute}, null, node);
|
||||
}
|
||||
}
|
||||
|
||||
// add feature id filter
|
||||
var fid = feature.getId();
|
||||
goog.asserts.assert(goog.isDef(fid));
|
||||
this.writeNode('Filter', new ol.expr.Call(new ol.expr.Identifier(
|
||||
ol.expr.functions.FID), [new ol.expr.Literal(fid)]),
|
||||
'http://www.opengis.net/ogc', node);
|
||||
|
||||
return node;
|
||||
},
|
||||
'Property': function(obj) {
|
||||
var node = this.createElementNS('wfs:Property');
|
||||
this.writeNode('Name', obj.name, null, node);
|
||||
if (!goog.isNull(obj.value)) {
|
||||
this.writeNode('Value', obj.value, null, node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
/**
|
||||
* @param {string} name Name.
|
||||
* @return {Element} Node.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
'Name': function(name) {
|
||||
var node = this.createElementNS('wfs:Name');
|
||||
node.appendChild(this.createTextNode(name));
|
||||
return node;
|
||||
},
|
||||
/**
|
||||
* @param {string|number|ol.geom.Geometry} obj Object.
|
||||
* @return {Element} Node.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
'Value': function(obj) {
|
||||
var node;
|
||||
if (obj instanceof ol.geom.Geometry) {
|
||||
node = this.createElementNS('wfs:Value');
|
||||
node.appendChild(
|
||||
this.getFilterParser().getGmlParser().writeGeometry(obj));
|
||||
} else {
|
||||
node = this.createElementNS('wfs:Value');
|
||||
node.appendChild(this.createTextNode(/** @type {string} */ (obj)));
|
||||
}
|
||||
return node;
|
||||
},
|
||||
/**
|
||||
* @param {{feature: ol.Feature,
|
||||
* options: olx.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* @return {Element} Node.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
'Delete': function(obj) {
|
||||
var feature = obj.feature;
|
||||
var options = obj.options;
|
||||
var node = this.createElementNS('wfs:Delete');
|
||||
this.setAttributeNS(node, this.defaultNamespaceURI, 'typeName',
|
||||
(goog.isDef(options.featureNS) ? options.featurePrefix + ':' : '') +
|
||||
options.featureType);
|
||||
if (goog.isDef(options.handle)) {
|
||||
this.setAttributeNS(node, this.defaultNamespaceURI, 'handle',
|
||||
options.handle);
|
||||
}
|
||||
var fid = feature.getId();
|
||||
goog.asserts.assert(goog.isDef(fid));
|
||||
this.writeNode('Filter', new ol.expr.Call(new ol.expr.Identifier(
|
||||
ol.expr.functions.FID), [new ol.expr.Literal(fid)]),
|
||||
'http://www.opengis.net/ogc', node);
|
||||
return node;
|
||||
}
|
||||
};
|
||||
goog.base(this);
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WFS_v1, ol.parser.XML);
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.parser.ogc.Filter_v1_0_0|ol.parser.ogc.Filter_v1_1_0}
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1.prototype.getFilterParser = function() {
|
||||
return this.filter_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.parser.ogc.Filter_v1_0_0|ol.parser.ogc.Filter_v1_1_0} filter The
|
||||
* Filter parser to use.
|
||||
* @protected
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1.prototype.setFilterParser = function(filter) {
|
||||
this.filter_ = filter;
|
||||
if (goog.isDefAndNotNull(this.featureNS)) {
|
||||
filter.setFeatureNS(this.featureNS);
|
||||
}
|
||||
var uri, key;
|
||||
for (uri in this.filter_.readers) {
|
||||
for (key in this.filter_.readers[uri]) {
|
||||
if (!goog.isDef(this.readers[uri])) {
|
||||
this.readers[uri] = {};
|
||||
}
|
||||
// do not overwrite any readers
|
||||
if (!goog.isDef(this.readers[uri][key])) {
|
||||
this.readers[uri][key] = goog.bind(this.filter_.readers[uri][key],
|
||||
this.filter_);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (uri in this.filter_.writers) {
|
||||
for (key in this.filter_.writers[uri]) {
|
||||
if (!goog.isDef(this.writers[uri])) {
|
||||
this.writers[uri] = {};
|
||||
}
|
||||
// do not overwrite any writers
|
||||
if (!goog.isDef(this.writers[uri][key])) {
|
||||
this.writers[uri][key] = goog.bind(this.filter_.writers[uri][key],
|
||||
this.filter_);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} featureType Feature type.
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1.prototype.setFeatureType = function(featureType) {
|
||||
this.featureType = featureType;
|
||||
if (goog.isDefAndNotNull(this.filter_)) {
|
||||
this.filter_.setFeatureType(featureType);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} featureNS Feature namespace.
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1.prototype.setFeatureNS = function(featureNS) {
|
||||
this.featureNS = featureNS;
|
||||
if (goog.isDefAndNotNull(this.filter_)) {
|
||||
this.setFilterParser(this.filter_);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} srsName SRS name.
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1.prototype.setSrsName = function(srsName) {
|
||||
this.srsName = srsName;
|
||||
if (goog.isDefAndNotNull(this.filter_)) {
|
||||
this.filter_.setSrsName(this.srsName);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string|Document|Element} data Data to read.
|
||||
* @return {Object} An object representing the document.
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1.prototype.read = function(data) {
|
||||
if (goog.isString(data)) {
|
||||
data = goog.dom.xml.loadXml(data);
|
||||
}
|
||||
if (data && data.nodeType == 9) {
|
||||
data = data.documentElement;
|
||||
}
|
||||
var obj = {};
|
||||
this.readNode(data, obj);
|
||||
return obj;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {olx.parser.WFSWriteGetFeatureOptions} options Options.
|
||||
* @return {string} A serialized WFS GetFeature query.
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1.prototype.writeGetFeature = function(options) {
|
||||
var root = this.writers[this.defaultNamespaceURI]['GetFeature']
|
||||
.call(this, options);
|
||||
return this.serialize(root);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<ol.Feature>} inserts The features to insert.
|
||||
* @param {Array.<ol.Feature>} updates The features to update.
|
||||
* @param {Array.<ol.Feature>} deletes The features to delete.
|
||||
* @param {olx.parser.WFSWriteTransactionOptions} options Write options.
|
||||
* @return {string} A serialized WFS transaction.
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1.prototype.writeTransaction =
|
||||
function(inserts, updates, deletes, options) {
|
||||
var root = this.writeNode('Transaction', {inserts: inserts,
|
||||
updates: updates, deletes: deletes, options: options});
|
||||
this.setAttributeNS(
|
||||
root, 'http://www.w3.org/2001/XMLSchema-instance',
|
||||
'xsi:schemaLocation', this.schemaLocation);
|
||||
return this.serialize(root);
|
||||
};
|
||||
@@ -1,78 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.WFS_v1_0_0');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.functions');
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.parser.ogc.Filter_v1_0_0');
|
||||
goog.require('ol.parser.ogc.WFS_v1');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.parser.ogc.WFS_v1}
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1_0_0 = function() {
|
||||
goog.base(this);
|
||||
this.version = '1.0.0';
|
||||
this.schemaLocation = this.defaultNamespaceURI + ' ' +
|
||||
'http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd';
|
||||
goog.object.extend(this.readers[this.defaultNamespaceURI], {
|
||||
'WFS_TransactionResponse': function(node, obj) {
|
||||
obj.insertIds = [];
|
||||
obj.success = false;
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'InsertResult': function(node, container) {
|
||||
var obj = {fids: []};
|
||||
this.readChildNodes(node, obj);
|
||||
for (var key in obj.fids) {
|
||||
container.insertIds.push(key);
|
||||
}
|
||||
},
|
||||
'TransactionResult': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'Status': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'SUCCESS': function(node, obj) {
|
||||
obj.success = true;
|
||||
}
|
||||
});
|
||||
goog.object.extend(this.writers[this.defaultNamespaceURI], {
|
||||
'GetFeature': goog.functions.compose(
|
||||
function(obj) {
|
||||
return obj.node;
|
||||
},
|
||||
this.writers['http://www.opengis.net/wfs']['GetFeature']
|
||||
),
|
||||
'Query': function(options) {
|
||||
var prefix = goog.isDef(options.featurePrefix) ? options.featurePrefix +
|
||||
':' : '';
|
||||
var node = this.createElementNS('wfs:Query');
|
||||
node.setAttribute('typeName', prefix + options.featureType);
|
||||
if (goog.isDef(options.srsNameInQuery) && goog.isDef(options.srsName)) {
|
||||
node.setAttribute('srsName', options.srsName);
|
||||
}
|
||||
if (goog.isDef(options.featureNS)) {
|
||||
node.setAttribute('xmlns:' + options.featurePrefix, options.featureNS);
|
||||
}
|
||||
if (goog.isDef(options.propertyNames)) {
|
||||
for (var i = 0, ii = options.propertyNames.length; i < ii; i++) {
|
||||
this.writeNode('PropertyName', options.propertyNames[i],
|
||||
'http://www.opengis.net/ogc', node);
|
||||
}
|
||||
}
|
||||
if (goog.isDef(options.filter)) {
|
||||
this.writeNode('Filter', options.filter,
|
||||
'http://www.opengis.net/ogc', node);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
});
|
||||
var filter = new ol.parser.ogc.Filter_v1_0_0();
|
||||
this.setFilterParser(filter);
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WFS_v1_0_0,
|
||||
ol.parser.ogc.WFS_v1);
|
||||
@@ -1,101 +0,0 @@
|
||||
goog.provide('ol.parser.ogc.WFS_v1_1_0');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.functions');
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.expr.Identifier');
|
||||
goog.require('ol.parser.ogc.Filter_v1_1_0');
|
||||
goog.require('ol.parser.ogc.WFS_v1');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.parser.ogc.WFS_v1}
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1_1_0 = function() {
|
||||
goog.base(this);
|
||||
this.version = '1.1.0';
|
||||
this.schemaLocation = this.defaultNamespaceURI + ' ' +
|
||||
'http://schemas.opengis.net/wfs/1.1.0/wfs.xsd';
|
||||
goog.object.extend(this.readers[this.defaultNamespaceURI], {
|
||||
'FeatureCollection': goog.functions.sequence(
|
||||
function(node, obj) {
|
||||
var numberOfFeatures = node.getAttribute('numberOfFeatures');
|
||||
if (!goog.isNull(numberOfFeatures)) {
|
||||
obj.numberOfFeatures = parseInt(numberOfFeatures, 10);
|
||||
}
|
||||
},
|
||||
this.readers['http://www.opengis.net/wfs']['FeatureCollection']
|
||||
),
|
||||
'TransactionResponse': function(node, obj) {
|
||||
obj.insertIds = [];
|
||||
obj.success = false;
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'TransactionSummary': function(node, obj) {
|
||||
// this is a limited test of success
|
||||
obj.success = true;
|
||||
},
|
||||
'InsertResults': function(node, obj) {
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
'Feature': function(node, container) {
|
||||
var obj = {};
|
||||
this.readChildNodes(node, obj);
|
||||
for (var key in obj.fids) {
|
||||
container.insertIds.push(key);
|
||||
}
|
||||
}
|
||||
});
|
||||
goog.object.extend(this.writers[this.defaultNamespaceURI], {
|
||||
'GetFeature': goog.functions.compose(
|
||||
function(obj) {
|
||||
var options = obj.options;
|
||||
var node = obj.node;
|
||||
if (goog.isDef(options)) {
|
||||
if (goog.isDef(options.resultType)) {
|
||||
node.setAttribute('resultType', options.resultType);
|
||||
}
|
||||
if (goog.isDef(options.startIndex)) {
|
||||
node.setAttribute('startIndex', options.startIndex);
|
||||
}
|
||||
if (goog.isDef(options.count)) {
|
||||
node.setAttribute('count', options.count);
|
||||
}
|
||||
}
|
||||
return node;
|
||||
},
|
||||
this.writers['http://www.opengis.net/wfs']['GetFeature']
|
||||
),
|
||||
'Query': function(options) {
|
||||
var prefix = goog.isDef(options.featurePrefix) ? options.featurePrefix +
|
||||
':' : '';
|
||||
var node = this.createElementNS('wfs:Query');
|
||||
node.setAttribute('typeName', prefix + options.featureType);
|
||||
node.setAttribute('srsName', options.srsName);
|
||||
if (goog.isDef(options.featureNS)) {
|
||||
node.setAttribute('xmlns:' + options.featurePrefix, options.featureNS);
|
||||
}
|
||||
if (goog.isDef(options.propertyNames)) {
|
||||
for (var i = 0, ii = options.propertyNames.length; i < ii; i++) {
|
||||
this.writeNode('PropertyName', options.propertyNames[i], null, node);
|
||||
}
|
||||
}
|
||||
if (goog.isDef(options.filter)) {
|
||||
this.writeNode('Filter', options.filter,
|
||||
'http://www.opengis.net/ogc', node);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
'PropertyName': function(obj) {
|
||||
goog.asserts.assertInstanceof(obj, ol.expr.Identifier);
|
||||
var node = this.createElementNS('wfs:PropertyName');
|
||||
node.appendChild(this.createTextNode(obj.getName()));
|
||||
return node;
|
||||
}
|
||||
});
|
||||
this.setFilterParser(new ol.parser.ogc.Filter_v1_1_0());
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WFS_v1_1_0,
|
||||
ol.parser.ogc.WFS_v1);
|
||||
@@ -1,342 +0,0 @@
|
||||
goog.provide('ol.test.parser.gml_v2');
|
||||
|
||||
describe('ol.parser.gml_v2', function() {
|
||||
|
||||
var parser = new ol.parser.ogc.GML_v2();
|
||||
|
||||
describe('Test GML v2 parser', function() {
|
||||
it('Point read correctly from coord', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/point-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('Point');
|
||||
expect(obj.geometry.coordinates).to.eql([1, 2]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Point read / written correctly from coordinates', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/point-coordinates.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
parser.applyWriteOptions(obj);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('Point');
|
||||
expect(obj.geometry.coordinates).to.eql([1, 2]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiPoint read correctly from coord', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/multipoint-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiPoint');
|
||||
expect(obj.geometry.parts.length).to.eql(3);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Point');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
|
||||
expect(obj.geometry.parts[1].coordinates).to.eql([2, 3]);
|
||||
expect(obj.geometry.parts[2].coordinates).to.eql([3, 4]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiPoint read / written correctly from coordinates', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/multipoint-coordinates.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiPoint');
|
||||
expect(obj.geometry.parts.length).to.eql(3);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Point');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
|
||||
expect(obj.geometry.parts[1].coordinates).to.eql([2, 3]);
|
||||
expect(obj.geometry.parts[2].coordinates).to.eql([3, 4]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('LineString read correctly from coord', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/linestring-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('LineString');
|
||||
expect(obj.geometry.coordinates.length).to.eql(2);
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('LineString read / written correctly from coordinates', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/linestring-coordinates.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('LineString');
|
||||
expect(obj.geometry.coordinates.length).to.eql(2);
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiLineString read correctly from coord', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/multilinestring-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
|
||||
expect(obj.geometry.parts[1].coordinates).to.eql([[3, 4], [4, 5]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiLineString read / written correctly from coords', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/multilinestring-coordinates.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
|
||||
expect(obj.geometry.parts[1].coordinates).to.eql([[3, 4], [4, 5]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Polygon read correctly from coord', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/polygon-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('Polygon');
|
||||
expect(obj.geometry.coordinates.length).to.eql(3);
|
||||
expect(obj.geometry.coordinates[0].length).to.eql(4);
|
||||
expect(obj.geometry.coordinates[0]).to.eql([[1, 2], [3, 4],
|
||||
[5, 6], [1, 2]]);
|
||||
expect(obj.geometry.coordinates[1]).to.eql([[2, 3], [4, 5],
|
||||
[6, 7], [2, 3]]);
|
||||
expect(obj.geometry.coordinates[2]).to.eql([[3, 4], [5, 6],
|
||||
[7, 8], [3, 4]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Polygon read / written correctly from coordinates', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/polygon-coordinates.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiPolygon read correctly from coord', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/multipolygon-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiPolygon read / written from coordinates', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/multipolygon-coordinates.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('GeometryCollection r / w correctly from coordinates', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/' +
|
||||
'geometrycollection-coordinates.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.GML_v2({featureNS: 'http://foo'});
|
||||
var obj = p.read(xml);
|
||||
var geom = p.createGeometry({geometry: obj.geometry});
|
||||
p.applyWriteOptions(obj);
|
||||
var node = p.featureNSWriters_['_geometry'].apply(p,
|
||||
[{value: geom}]).firstChild;
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('GeometryCollection');
|
||||
expect(obj.geometry.parts.length).to.eql(3);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Point');
|
||||
expect(obj.geometry.parts[1].type).to.eql('LineString');
|
||||
expect(obj.geometry.parts[2].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Box read correctly from coord', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/box-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.bounds).to.eql([1, 2, 3, 4]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Box read correctly from coordinates', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/box-coordinates.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.bounds).to.eql([1, 2, 3, 4]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('LinearRing read correctly from coord', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/linearring-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('LinearRing');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4], [5, 6],
|
||||
[1, 2]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('LinearRing read / written correctly from coordinates', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/linearring-coordinates.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('LinearRing');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4], [5, 6],
|
||||
[1, 2]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('FeatureCollection read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/topp-states.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var schemaLoc = 'http://www.openplans.org/topp ' +
|
||||
'http://demo.opengeo.org/geoserver/wfs?service=WFS&version=' +
|
||||
'1.0.0&request=DescribeFeatureType&typeName=topp:states ' +
|
||||
'http://www.opengis.net/wfs http://demo.opengeo.org/' +
|
||||
'geoserver/schemas/wfs/1.0.0/WFS-basic.xsd';
|
||||
var p = new ol.parser.ogc.GML_v2({
|
||||
featureType: 'states',
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
schemaLocation: schemaLoc});
|
||||
// overwrite the axis orientation of the projection, since WFS 1.0.0
|
||||
// always uses enu
|
||||
var obj = p.read(xml, {axisOrientation: 'enu'});
|
||||
var output = p.write(obj, {axisOrientation: 'enu'});
|
||||
expect(goog.dom.xml.loadXml(output)).to.xmleql(xml);
|
||||
expect(obj.features.length).to.eql(3);
|
||||
var feature = obj.features[0];
|
||||
expect(feature.getGeometry() instanceof
|
||||
ol.geom.MultiPolygon).to.be.ok();
|
||||
var attributes = feature.getAttributes();
|
||||
expect(feature.getId()).to.eql('states.1');
|
||||
expect(attributes['STATE_NAME']).to.eql('Illinois');
|
||||
expect(attributes['STATE_FIPS']).to.eql('17');
|
||||
expect(attributes['SUB_REGION']).to.eql('E N Cen');
|
||||
expect(attributes['STATE_ABBR']).to.eql('IL');
|
||||
expect(attributes['LAND_KM']).to.eql('143986.61');
|
||||
expect(ol.proj.get(obj.metadata.projection) instanceof ol.proj.EPSG4326)
|
||||
.to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Auto configure works correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/topp-states.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.GML_v2();
|
||||
var obj = p.read(xml);
|
||||
expect(obj.features.length).to.eql(3);
|
||||
expect(obj.features[0].getGeometry() instanceof
|
||||
ol.geom.MultiPolygon).to.be.ok();
|
||||
expect(p.featureType).to.eql('states');
|
||||
expect(p.featureNS).to.eql('http://www.openplans.org/topp');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Test multiple typeNames', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/multipletypenames.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
// we should not go through autoConfig so specify featureNS
|
||||
var p = new ol.parser.ogc.GML_v2({
|
||||
featureNS: 'http://mapserver.gis.umn.edu/mapserver',
|
||||
featureType: ['LKUNSTWERK', 'PKUNSTWERK', 'VKUNSTWERK']});
|
||||
var obj = p.read(xml);
|
||||
var features = obj.features;
|
||||
expect(features.length).to.eql(3);
|
||||
expect(features[0].getGeometry() instanceof
|
||||
ol.geom.MultiPolygon).to.be.ok();
|
||||
expect(features[1].getGeometry() instanceof
|
||||
ol.geom.MultiLineString).to.be.ok();
|
||||
expect(features[2].getGeometry() instanceof
|
||||
ol.geom.MultiPoint).to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Test no geometry', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/nogeom.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.features.length).to.eql(2);
|
||||
var feature = obj.features[0];
|
||||
expect(feature.getGeometry() === null).to.be.ok();
|
||||
// TODO test bounds on feature
|
||||
// see https://github.com/openlayers/ol3/issues/566
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Test boundedBy', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/boundedBy.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
parser.read(xml);
|
||||
// TODO test bounds on feature
|
||||
// see https://github.com/openlayers/ol3/issues/566
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('goog.dom.xml');
|
||||
|
||||
goog.require('ol.parser.ogc.GML_v2');
|
||||
goog.require('ol.geom.MultiLineString');
|
||||
goog.require('ol.geom.MultiPoint');
|
||||
goog.require('ol.geom.MultiPolygon');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.proj.EPSG4326');
|
||||
@@ -1,393 +0,0 @@
|
||||
goog.provide('ol.test.parser.gml_v3');
|
||||
|
||||
describe('ol.parser.gml_v3', function() {
|
||||
|
||||
var parser = new ol.parser.ogc.GML_v3();
|
||||
|
||||
describe('Test GML v3 parser', function() {
|
||||
it('Envelope read correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/envelope.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.bounds).to.eql([1, 2, 3, 4]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('LinearRing read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/linearring.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('LinearRing');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4], [5, 6],
|
||||
[1, 2]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Linestring read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/linestring.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('LineString');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Linestring 3D read correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/linestring3d.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
// no write test since simple features only does 2D
|
||||
expect(obj.geometry.type).to.eql('LineString');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2, 3], [4, 5, 6]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Curve read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/curve.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.GML_v3({curve: true});
|
||||
var obj = p.read(xml);
|
||||
var geom = p.createGeometry({geometry: obj.geometry});
|
||||
p.applyWriteOptions(obj);
|
||||
var node = p.featureNSWriters_['_geometry'].apply(p,
|
||||
[{value: geom}]).firstChild;
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('LineString');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiLineString plural read correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multilinestring-plural.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
// no write test for plural, we only write singular
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiLineString singular read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multilinestring-singular.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.GML_v3({multiCurve: false});
|
||||
var obj = p.read(xml);
|
||||
var geom = p.createGeometry({geometry: obj.geometry});
|
||||
p.applyWriteOptions(obj);
|
||||
var node = p.featureNSWriters_['_geometry'].apply(p,
|
||||
[{value: geom}]).firstChild;
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiCurve singular read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multicurve-singular.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiCurve curve read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multicurve-curve.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.GML_v3({curve: true});
|
||||
var obj = p.read(xml);
|
||||
var geom = p.createGeometry({geometry: obj.geometry});
|
||||
p.applyWriteOptions(obj);
|
||||
var node = p.featureNSWriters_['_geometry'].apply(p,
|
||||
[{value: geom}]).firstChild;
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiPoint plural read correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multipoint-plural.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiPoint');
|
||||
expect(obj.geometry.parts.length).to.eql(3);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Point');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiPoint singular read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multipoint-singular.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiPoint');
|
||||
expect(obj.geometry.parts.length).to.eql(3);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Point');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiPolygon plural read correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multipolygon-plural.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiPolygon singular read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multipolygon-singular.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.GML_v3({multiSurface: false});
|
||||
var obj = p.read(xml);
|
||||
var geom = p.createGeometry({geometry: obj.geometry});
|
||||
p.applyWriteOptions(obj);
|
||||
var node = p.featureNSWriters_['_geometry'].apply(p,
|
||||
[{value: geom}]).firstChild;
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiSurface plural read correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multisurface-plural.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiSurface singular read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multisurface-singular.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('MultiSurface surface read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multisurface-surface.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.GML_v3({surface: true});
|
||||
var obj = p.read(xml);
|
||||
var geom = p.createGeometry({geometry: obj.geometry});
|
||||
p.applyWriteOptions(obj);
|
||||
var node = p.featureNSWriters_['_geometry'].apply(p,
|
||||
[{value: geom}]).firstChild;
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Point read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/point.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('Point');
|
||||
expect(obj.geometry.coordinates).to.eql([1, 2]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Polygon read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/polygon.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var geom = parser.createGeometry({geometry: obj.geometry});
|
||||
parser.applyWriteOptions(obj);
|
||||
var node = parser.featureNSWriters_['_geometry'].apply(parser,
|
||||
[{value: geom}]).firstChild;
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Surface read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/surface.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.GML_v3({surface: true});
|
||||
var obj = p.read(xml);
|
||||
var geom = p.createGeometry({geometry: obj.geometry});
|
||||
p.applyWriteOptions(obj, {srsName: 'foo'});
|
||||
var node = p.featureNSWriters_['_geometry'].apply(p,
|
||||
[{value: geom}]).firstChild;
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('FeatureCollection from GML read / written correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/topp-states-gml.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var schemaLoc = 'http://www.openplans.org/topp ' +
|
||||
'http://demo.opengeo.org/geoserver/wfs?service=WFS&version=' +
|
||||
'1.1.0&request=DescribeFeatureType&typeName=topp:states ' +
|
||||
'http://www.opengis.net/gml ' +
|
||||
'http://schemas.opengis.net/gml/3.2.1/gml.xsd';
|
||||
var p = new ol.parser.ogc.GML_v3({schemaLocation: schemaLoc});
|
||||
var obj = p.read(xml);
|
||||
var output = p.write(obj);
|
||||
expect(goog.dom.xml.loadXml(output)).to.xmleql(xml);
|
||||
expect(obj.features.length).to.eql(10);
|
||||
var feature = obj.features[0];
|
||||
expect(feature.getGeometry() instanceof
|
||||
ol.geom.MultiPolygon).to.be.ok();
|
||||
var attributes = feature.getAttributes();
|
||||
expect(feature.getId()).to.eql('states.1');
|
||||
expect(attributes['STATE_NAME']).to.eql('Illinois');
|
||||
expect(attributes['STATE_FIPS']).to.eql('17');
|
||||
expect(attributes['SUB_REGION']).to.eql('E N Cen');
|
||||
expect(attributes['STATE_ABBR']).to.eql('IL');
|
||||
expect(attributes['LAND_KM']).to.eql('143986.61');
|
||||
expect(ol.proj.get(obj.metadata.projection) instanceof ol.proj.EPSG4326)
|
||||
.to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('FeatureCollection from WFS read correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/topp-states-wfs.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.features.length).to.eql(3);
|
||||
var feature = obj.features[0];
|
||||
expect(feature.getGeometry() instanceof
|
||||
ol.geom.MultiPolygon).to.be.ok();
|
||||
var attributes = feature.getAttributes();
|
||||
expect(feature.getId()).to.eql('states.1');
|
||||
expect(attributes['STATE_NAME']).to.eql('Illinois');
|
||||
expect(attributes['STATE_FIPS']).to.eql('17');
|
||||
expect(attributes['SUB_REGION']).to.eql('E N Cen');
|
||||
expect(attributes['STATE_ABBR']).to.eql('IL');
|
||||
expect(attributes['LAND_KM']).to.eql('143986.61');
|
||||
expect(ol.proj.get(obj.metadata.projection) instanceof ol.proj.EPSG4326)
|
||||
.to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Read autoConfig', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/topp-states-wfs.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
parser.read(xml);
|
||||
expect(parser.featureType).to.eql('states');
|
||||
expect(parser.featureNS).to.eql('http://www.openplans.org/topp');
|
||||
expect(parser.autoConfig === true).to.be.ok();
|
||||
parser.autoConfig = false;
|
||||
parser.read(xml);
|
||||
expect(parser.autoConfig === false).to.be.ok();
|
||||
parser.autoConfig = true;
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Empty attribute', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/empty-attribute.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.features.length).to.eql(1);
|
||||
var attr = obj.features[0].getAttributes();
|
||||
expect(attr['name']).to.eql('Aflu');
|
||||
expect(attr['foo']).to.eql(undefined);
|
||||
expect(attr['empty']).to.eql('');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('Repeated name', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/repeated-name.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.features.length).to.eql(1);
|
||||
var atts = obj.features[0].getAttributes();
|
||||
expect(atts['zoning']).to.eql('I-L');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('More than one geometry', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/more-geoms.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
var feature = obj.features[0];
|
||||
expect(feature.get('center')).to.be.a(ol.geom.Point);
|
||||
expect(feature.get('the_geom')).to.be.a(ol.geom.MultiPolygon);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.geom.MultiPolygon');
|
||||
goog.require('ol.parser.ogc.GML_v3');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.proj.EPSG4326');
|
||||
@@ -1,122 +0,0 @@
|
||||
goog.provide('ol.test.parser.ogc.WFS_v1');
|
||||
|
||||
describe('ol.parser.ogc.WFS', function() {
|
||||
|
||||
var parser = new ol.parser.ogc.WFS();
|
||||
|
||||
describe('reading and writing', function() {
|
||||
|
||||
it('handles read of FeatureCollection', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1/FeatureCollection.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.features.length).to.equal(1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing out GetFeature with a handle', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1/GetFeature.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_0_0();
|
||||
var output = p.writeGetFeature({
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
featureTypes: ['states'],
|
||||
featurePrefix: 'topp',
|
||||
handle: 'handle_g',
|
||||
maxFeatures: 1,
|
||||
outputFormat: 'json'
|
||||
});
|
||||
expect(goog.dom.xml.loadXml(output)).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing out Transaction with a handle', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1/Transaction.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_0_0();
|
||||
var output = p.writeTransaction(null, null, null, {handle: 'handle_t'});
|
||||
expect(goog.dom.xml.loadXml(output)).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing out transactions', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1/TransactionMulti.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var parser = new ol.parser.ogc.WFS_v1_0_0();
|
||||
|
||||
var insertFeature = new ol.Feature({
|
||||
the_geom: new ol.geom.MultiPoint([[1, 2]]),
|
||||
foo: 'bar',
|
||||
nul: null
|
||||
});
|
||||
var inserts = [insertFeature];
|
||||
var updateFeature = new ol.Feature({
|
||||
the_geom: new ol.geom.MultiPoint([[1, 2]]),
|
||||
foo: 'bar',
|
||||
// null value gets Property element with no Value
|
||||
nul: null,
|
||||
// undefined value means don't create a Property element
|
||||
unwritten: undefined
|
||||
});
|
||||
updateFeature.setId('fid.42');
|
||||
var updates = [updateFeature];
|
||||
|
||||
var deleteFeature = new ol.Feature();
|
||||
deleteFeature.setId('fid.37');
|
||||
var deletes = [deleteFeature];
|
||||
|
||||
var output = parser.writeTransaction(inserts, updates, deletes, {
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
featureType: 'states',
|
||||
featurePrefix: 'topp'
|
||||
});
|
||||
expect(goog.dom.xml.loadXml(output)).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing out Native', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1/Native.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_1_0();
|
||||
var output = p.writeTransaction(null, null, null, {nativeElements: [{
|
||||
vendorId: 'ORACLE',
|
||||
safeToIgnore: true,
|
||||
value: 'ALTER SESSION ENABLE PARALLEL DML'
|
||||
}, {
|
||||
vendorId: 'ORACLE',
|
||||
safeToIgnore: false,
|
||||
value: 'Another native line goes here'
|
||||
}]});
|
||||
expect(goog.dom.xml.loadXml(output)).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing out GetFeature with > 1 typename', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1/GetFeatureMultiple.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_0_0();
|
||||
var output = p.writeGetFeature({
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
featureTypes: ['states', 'cities'],
|
||||
featurePrefix: 'topp'
|
||||
});
|
||||
expect(goog.dom.xml.loadXml(output)).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.geom.MultiPoint');
|
||||
goog.require('ol.parser.ogc.WFS');
|
||||
goog.require('ol.parser.ogc.WFS_v1_0_0');
|
||||
goog.require('ol.parser.ogc.WFS_v1_1_0');
|
||||
@@ -1,72 +0,0 @@
|
||||
goog.provide('ol.test.parser.ogc.WFS_v1_0_0');
|
||||
|
||||
describe('ol.parser.ogc.WFS_v1_0_0', function() {
|
||||
|
||||
var parser = new ol.parser.ogc.WFS();
|
||||
|
||||
describe('reading and writing', function() {
|
||||
|
||||
it('handles read of transaction response', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1_0_0/Transaction_Response.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.insertIds.length).to.equal(2);
|
||||
expect(obj.insertIds[0]).to.equal('parcelle.40');
|
||||
expect(obj.insertIds[1]).to.equal('parcelle.41');
|
||||
expect(obj.version).to.equal('1.0.0');
|
||||
expect(obj.success).to.be(true);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing Query with BBOX Filter', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1_0_0/query0.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_0_0();
|
||||
var filter = new ol.expr.Call(
|
||||
new ol.expr.Identifier(ol.expr.functions.EXTENT),
|
||||
[new ol.expr.Literal(1), new ol.expr.Literal(2),
|
||||
new ol.expr.Literal(3), new ol.expr.Literal(4),
|
||||
undefined,
|
||||
new ol.expr.Identifier('the_geom')]);
|
||||
p.getFilterParser().getGmlParser().axisOrientation = 'enu';
|
||||
var output = p.writers[p.defaultNamespaceURI]['Query'].apply(
|
||||
p, [{
|
||||
filter: filter,
|
||||
featureType: 'states',
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
featurePrefix: 'topp'
|
||||
}]);
|
||||
expect(goog.dom.xml.loadXml(p.serialize(output))).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing GetFeature with PropertyName', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1_0_0/getfeature0.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_0_0();
|
||||
var output = p.writers[p.defaultNamespaceURI]['GetFeature'].apply(
|
||||
p, [{
|
||||
propertyNames: [new ol.expr.Identifier('STATE_NAME'),
|
||||
new ol.expr.Identifier('STATE_FIPS'),
|
||||
new ol.expr.Identifier('STATE_ABBR')],
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
featurePrefix: 'topp',
|
||||
featureTypes: ['states']
|
||||
}]);
|
||||
expect(goog.dom.xml.loadXml(p.serialize(output))).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('ol.expr.Call');
|
||||
goog.require('ol.expr.Identifier');
|
||||
goog.require('ol.expr.Literal');
|
||||
goog.require('ol.parser.ogc.WFS');
|
||||
goog.require('ol.parser.ogc.WFS_v1_0_0');
|
||||
@@ -1,122 +0,0 @@
|
||||
goog.provide('ol.test.parser.ogc.WFS_v1_1_0');
|
||||
|
||||
describe('ol.parser.ogc.WFS_v1_1_0', function() {
|
||||
|
||||
var parser = new ol.parser.ogc.WFS();
|
||||
|
||||
describe('reading and writing', function() {
|
||||
|
||||
it('handles read of transaction response', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1_1_0/TransactionResponse.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.insertIds.length).to.equal(2);
|
||||
expect(obj.insertIds[0]).to.equal('parcelle.40');
|
||||
expect(obj.insertIds[1]).to.equal('parcelle.41');
|
||||
expect(obj.version).to.equal('1.1.0');
|
||||
expect(obj.success).to.be(true);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles read of number of features', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1_1_0/NumberOfFeatures.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
// the XML does not contain a version attribute on the root node
|
||||
var p = new ol.parser.ogc.WFS_v1_1_0();
|
||||
var obj = p.read(xml);
|
||||
expect(obj.numberOfFeatures).to.equal(625);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles read of boundedBy on the FeatureCollection', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1_1_0/boundedBy.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
// the XML does not contain a version attribute on the root node
|
||||
var p = new ol.parser.ogc.WFS_v1_1_0();
|
||||
var obj = p.read(xml);
|
||||
expect(obj.bounds[0]).to.equal(3197.88);
|
||||
expect(obj.bounds[1]).to.equal(306457.313);
|
||||
expect(obj.bounds[2]).to.equal(280339.156);
|
||||
expect(obj.bounds[3]).to.equal(613850.438);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing Query with BBOX Filter', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1_1_0/query0.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_1_0();
|
||||
var srs = 'urn:ogc:def:crs:EPSG::4326';
|
||||
var filter = new ol.expr.Call(
|
||||
new ol.expr.Identifier(ol.expr.functions.EXTENT),
|
||||
[new ol.expr.Literal(1), new ol.expr.Literal(2),
|
||||
new ol.expr.Literal(3), new ol.expr.Literal(4),
|
||||
new ol.expr.Literal(srs),
|
||||
new ol.expr.Identifier('the_geom')]);
|
||||
p.getFilterParser().getGmlParser().axisOrientation =
|
||||
ol.proj.get(srs).getAxisOrientation();
|
||||
var output = p.writers[p.defaultNamespaceURI]['Query'].apply(
|
||||
p, [{
|
||||
srsName: srs,
|
||||
filter: filter,
|
||||
featureType: 'states',
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
featurePrefix: 'topp'
|
||||
}]);
|
||||
expect(goog.dom.xml.loadXml(p.serialize(output))).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
it('handles writing GetFeature with resultType hits', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1_1_0/getfeature0.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_1_0();
|
||||
var output = p.writers[p.defaultNamespaceURI]['GetFeature'].apply(
|
||||
p, [{
|
||||
resultType: 'hits',
|
||||
srsName: 'urn:ogc:def:crs:EPSG::4326',
|
||||
propertyNames: [new ol.expr.Identifier('STATE_NAME'),
|
||||
new ol.expr.Identifier('STATE_FIPS'),
|
||||
new ol.expr.Identifier('STATE_ABBR')],
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
featurePrefix: 'topp',
|
||||
featureTypes: ['states']
|
||||
}]);
|
||||
expect(goog.dom.xml.loadXml(p.serialize(output))).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing GetFeature with paging info', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1_1_0/getfeature1.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_1_0();
|
||||
var output = p.writers[p.defaultNamespaceURI]['GetFeature'].apply(
|
||||
p, [{
|
||||
count: 10,
|
||||
startIndex: 20,
|
||||
srsName: 'urn:ogc:def:crs:EPSG::4326',
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
featurePrefix: 'topp',
|
||||
featureTypes: ['states']
|
||||
}]);
|
||||
expect(goog.dom.xml.loadXml(p.serialize(output))).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('ol.expr.Call');
|
||||
goog.require('ol.expr.Identifier');
|
||||
goog.require('ol.expr.Literal');
|
||||
goog.require('ol.parser.ogc.WFS');
|
||||
goog.require('ol.parser.ogc.WFS_v1_1_0');
|
||||
goog.require('ol.proj');
|
||||
@@ -1,37 +0,0 @@
|
||||
goog.provide('ol.test.parser.ogc.WMSCapabilities_v1_0_0');
|
||||
|
||||
|
||||
/**
|
||||
* @define {boolean} Whether to enable WMS Capabilities version 1.0.0.
|
||||
*/
|
||||
ol.ENABLE_WMSCAPS_1_0_0 = true;
|
||||
|
||||
describe('ol.parser.ogc.wmscapabilities_v1_0_0', function() {
|
||||
|
||||
var parser = new ol.parser.ogc.WMSCapabilities();
|
||||
|
||||
describe('test read', function() {
|
||||
it('Test read', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_0_0.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj;
|
||||
obj = parser.read(xml);
|
||||
expect(obj.service.keywords.length).to.eql(2);
|
||||
expect(obj.service.keywords[0]['value']).to.eql('BGDI');
|
||||
expect(obj.service.href).to.eql('https://wms.geo.admin.ch/?');
|
||||
var url = 'https://wms.geo.admin.ch/?';
|
||||
var getmap = obj.capability.request.getmap;
|
||||
expect(getmap.get.href).to.eql(url);
|
||||
expect(getmap.post.href).to.eql(url);
|
||||
expect(getmap.formats.length).to.eql(4);
|
||||
expect(getmap.formats[0]).to.eql('GIF');
|
||||
expect(obj.capability.layers[64].keywords.length).to.eql(2);
|
||||
expect(obj.capability.layers[64].keywords[0].value).to.eql('Geometer');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.parser.ogc.WMSCapabilities');
|
||||
@@ -1,259 +0,0 @@
|
||||
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() {
|
||||
it('Error reported correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/' +
|
||||
'exceptionsample.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(!!obj.error).to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('test read', function() {
|
||||
it('Test read', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj, capability, getmap, describelayer, getfeatureinfo, layer;
|
||||
obj = parser.read(xml);
|
||||
capability = obj.capability;
|
||||
getmap = capability.request.getmap;
|
||||
describelayer = capability.request.describelayer;
|
||||
getfeatureinfo = capability.request.getfeatureinfo;
|
||||
layer = capability.layers[2];
|
||||
expect(capability).to.be.ok();
|
||||
expect(getmap.formats.length).to.eql(28);
|
||||
var get = 'http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&';
|
||||
expect(getmap.get.href).to.eql(get);
|
||||
expect(getmap.post).to.be(undefined);
|
||||
get = 'http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&';
|
||||
expect(describelayer.get.href).to.eql(get);
|
||||
expect(describelayer.post).to.be(undefined);
|
||||
get = 'http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&';
|
||||
expect(getfeatureinfo.get.href).to.eql(get);
|
||||
var post = 'http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&';
|
||||
expect(getfeatureinfo.post.href).to.eql(post);
|
||||
expect(capability.layers).to.be.ok();
|
||||
expect(capability.layers.length).to.eql(22);
|
||||
var infoFormats =
|
||||
['text/plain', 'text/html', 'application/vnd.ogc.gml'];
|
||||
expect(layer.infoFormats).to.eql(infoFormats);
|
||||
expect(layer.name).to.eql('tiger:tiger_roads');
|
||||
expect(layer.prefix).to.eql('tiger');
|
||||
expect(layer.title).to.eql('Manhattan (NY) roads');
|
||||
var abstr = 'Highly simplified road layout of Manhattan in New York..';
|
||||
expect(layer['abstract']).to.eql(abstr);
|
||||
var bbox = [
|
||||
-74.08769307536667, 40.660618924633326,
|
||||
-73.84653192463333, 40.90178007536667
|
||||
];
|
||||
expect(layer.llbbox).to.eql(bbox);
|
||||
expect(layer.styles.length).to.eql(1);
|
||||
expect(layer.styles[0].name).to.eql('tiger_roads');
|
||||
var legend = '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).to.eql(legend);
|
||||
expect(layer.styles[0].legend.format).to.eql('image/png');
|
||||
expect(layer.queryable).to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('test layers', function() {
|
||||
it('Test layers', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj, capability, layers = {}, rootlayer, identifiers, authorities;
|
||||
var featurelist;
|
||||
obj = parser.read(xml);
|
||||
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;
|
||||
expect(rootlayer.srs).to.eql({'EPSG:4326': true});
|
||||
var srs = {'EPSG:4326': true, 'EPSG:26986': true};
|
||||
expect(layers['ROADS_RIVERS'].srs).to.eql(srs);
|
||||
expect(layers['Temperature'].srs).to.eql({'EPSG:4326': true});
|
||||
var bbox = layers['ROADS_RIVERS'].bbox['EPSG:26986'];
|
||||
expect(bbox.bbox).to.eql([189000, 834000, 285000, 962000]);
|
||||
expect(bbox.res).to.eql({x: 1, y: 1});
|
||||
bbox = layers['ROADS_RIVERS'].bbox['EPSG:4326'];
|
||||
expect(bbox.bbox).to.eql([-71.63, 41.75, -70.78, 42.90]);
|
||||
expect(bbox.res).to.eql({x: 0.01, y: 0.01});
|
||||
bbox = layers['ROADS_1M'].bbox['EPSG:26986'];
|
||||
expect(bbox.bbox).to.eql([189000, 834000, 285000, 962000]);
|
||||
expect(bbox.res).to.eql({x: 1, y: 1});
|
||||
expect(identifiers).to.be.ok();
|
||||
expect('DIF_ID' in identifiers).to.be.ok();
|
||||
expect(identifiers['DIF_ID']).to.eql('123456');
|
||||
expect('DIF_ID' in authorities).to.be.ok();
|
||||
var url = 'http://gcmd.gsfc.nasa.gov/difguide/whatisadif.html';
|
||||
expect(authorities['DIF_ID']).to.eql(url);
|
||||
expect(featurelist).to.be.ok();
|
||||
expect(featurelist.format).to.eql('application/vnd.ogc.se_xml');
|
||||
url = 'http://www.university.edu/data/roads_rivers.gml';
|
||||
expect(featurelist.href).to.eql(url);
|
||||
expect(layers['Pressure'].queryable).to.be.ok();
|
||||
expect(layers['ozone_image'].queryable).to.not.be();
|
||||
expect(layers['population'].cascaded).to.eql(1);
|
||||
expect(layers['ozone_image'].fixedWidth).to.eql(512);
|
||||
expect(layers['ozone_image'].fixedHeight).to.eql(256);
|
||||
expect(layers['ozone_image'].opaque).to.be.ok();
|
||||
expect(layers['ozone_image'].noSubsets).to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('test dimensions', function() {
|
||||
it('Test dimensions', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj, capability, layers = {}, time, elevation;
|
||||
obj = parser.read(xml);
|
||||
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;
|
||||
expect(time['default']).to.eql('2000-08-22');
|
||||
expect(time.values.length).to.eql(1);
|
||||
expect(time.values[0]).to.eql('1999-01-01/2000-08-22/P1D');
|
||||
expect(elevation.units).to.eql('EPSG:5030');
|
||||
expect(elevation['default']).to.eql('0');
|
||||
expect(elevation.nearestVal).to.be.ok();
|
||||
expect(elevation.multipleVal).to.not.be();
|
||||
expect(elevation.values).to.eql(
|
||||
['0', '1000', '3000', '5000', '10000']);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('test contact info', function() {
|
||||
it('Test contact info', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/' +
|
||||
'ogcsample.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj, service, contactinfo, personPrimary, addr;
|
||||
obj = parser.read(xml);
|
||||
service = obj.service;
|
||||
contactinfo = service.contactInformation;
|
||||
personPrimary = contactinfo.personPrimary;
|
||||
addr = contactinfo.contactAddress;
|
||||
expect(contactinfo).to.be.ok();
|
||||
expect(personPrimary).to.be.ok();
|
||||
expect(personPrimary.person).to.eql('Jeff deLaBeaujardiere');
|
||||
expect(personPrimary.organization).to.eql('NASA');
|
||||
expect(contactinfo.position).to.eql('Computer Scientist');
|
||||
expect(addr).to.be.ok();
|
||||
expect(addr.type).to.eql('postal');
|
||||
var address = 'NASA Goddard Space Flight Center, Code 933';
|
||||
expect(addr.address).to.eql(address);
|
||||
expect(addr.city).to.eql('Greenbelt');
|
||||
expect(addr.stateOrProvince).to.eql('MD');
|
||||
expect(addr.postcode).to.eql('20771');
|
||||
expect(addr.country).to.eql('USA');
|
||||
expect(contactinfo.phone).to.eql('+1 301 286-1569');
|
||||
expect(contactinfo.fax).to.eql('+1 301 286-1777');
|
||||
expect(contactinfo.email).to.eql('delabeau@iniki.gsfc.nasa.gov');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Test fees and constraints', function() {
|
||||
it('Test fees and constraints', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj, service;
|
||||
obj = parser.read(xml);
|
||||
service = obj.service;
|
||||
expect('fees' in service).to.not.be();
|
||||
expect('accessConstraints' in service).to.not.be();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Test requests', function() {
|
||||
it('Test requests', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj, request, exception, userSymbols;
|
||||
obj = parser.read(xml);
|
||||
request = obj.capability.request;
|
||||
exception = obj.capability.exception;
|
||||
userSymbols = obj.capability.userSymbols;
|
||||
expect(request).to.be.ok();
|
||||
expect('getmap' in request).to.be.ok();
|
||||
expect('getfeatureinfo' in request).to.be.ok();
|
||||
var formats = ['text/plain', 'text/html', 'application/vnd.ogc.gml'];
|
||||
expect(request.getfeatureinfo.formats).to.eql(formats);
|
||||
expect('describelayer' in request).to.be.ok();
|
||||
expect('getlegendgraphic' in request).to.be.ok();
|
||||
expect(exception).to.be.ok();
|
||||
expect(exception.formats).to.eql(['application/vnd.ogc.se_xml']);
|
||||
expect(userSymbols).to.be.ok();
|
||||
expect(userSymbols.supportSLD).to.be.ok();
|
||||
expect(userSymbols.userLayer).to.be.ok();
|
||||
expect(userSymbols.userStyle).to.be.ok();
|
||||
expect(userSymbols.remoteWFS).to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('test ogc', function() {
|
||||
it('Test ogc', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj, capability, attribution, keywords, metadataURLs;
|
||||
obj = parser.read(xml);
|
||||
capability = obj.capability;
|
||||
attribution = capability.layers[2].attribution;
|
||||
keywords = capability.layers[0].keywords;
|
||||
metadataURLs = capability.layers[0].metadataURLs;
|
||||
expect(attribution.title).to.eql('State College University');
|
||||
expect(attribution.href).to.eql('http://www.university.edu/');
|
||||
var url = 'http://www.university.edu/icons/logo.gif';
|
||||
expect(attribution.logo.href).to.eql(url);
|
||||
expect(attribution.logo.format).to.eql('image/gif');
|
||||
expect(attribution.logo.width).to.eql('100');
|
||||
expect(attribution.logo.height).to.eql('100');
|
||||
expect(keywords.length).to.eql(3);
|
||||
expect(keywords[0].value).to.eql('road');
|
||||
expect(metadataURLs.length).to.eql(2);
|
||||
expect(metadataURLs[0].type).to.eql('FGDC');
|
||||
expect(metadataURLs[0].format).to.eql('text/plain');
|
||||
var href = 'http://www.university.edu/metadata/roads.txt';
|
||||
expect(metadataURLs[0].href).to.eql(href);
|
||||
expect(Math.round(capability.layers[0].minScale)).to.eql(250000);
|
||||
expect(Math.round(capability.layers[0].maxScale)).to.eql(1000);
|
||||
expect(capability.layers[1].minScale).to.be(undefined);
|
||||
expect(capability.layers[1].maxScale).to.be(undefined);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.parser.ogc.WMSCapabilities');
|
||||
@@ -1,60 +0,0 @@
|
||||
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() {
|
||||
it('Test read', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1_WMSC/wmsc.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj, tilesets, tileset;
|
||||
obj = parser.read(xml);
|
||||
tilesets = obj.capability.vendorSpecific.tileSets;
|
||||
tileset = tilesets[0];
|
||||
expect(tilesets.length).to.eql(2);
|
||||
var bbox = [
|
||||
-13697515.466796875, 5165920.118906248,
|
||||
-13619243.94984375, 5244191.635859374
|
||||
];
|
||||
expect(tileset.bbox['EPSG:900913'].bbox).to.eql(bbox);
|
||||
expect(tileset.format).to.eql('image/png');
|
||||
expect(tileset.height).to.eql(256);
|
||||
expect(tileset.width).to.eql(256);
|
||||
expect(tileset.layers).to.eql('medford:hydro');
|
||||
expect(tileset.srs['EPSG:900913']).to.be.ok();
|
||||
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).to.eql(resolutions);
|
||||
expect(tileset.styles).to.eql('');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('test fallback', function() {
|
||||
it('Test fallback', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1_WMSC/' +
|
||||
'fallback.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj;
|
||||
obj = parser.read(xml);
|
||||
expect(obj.capability.layers.length).to.eql(2);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.parser.ogc.WMSCapabilities');
|
||||
@@ -1,141 +0,0 @@
|
||||
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();
|
||||
|
||||
describe('test read exception', function() {
|
||||
it('Error reported correctly', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_3_0/' +
|
||||
'exceptionsample.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var result;
|
||||
result = parser.read(xml);
|
||||
expect(!!result.error).to.be(true);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('test read', function() {
|
||||
it('Test read', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_3_0/ogcsample.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj, capability, layers = {}, rootlayer, identifiers, authorities;
|
||||
var featurelist, time, elevation, service, contactinfo, personPrimary,
|
||||
addr, request, exception, attribution, keywords, metadataURLs;
|
||||
obj = parser.read(xml);
|
||||
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;
|
||||
expect(rootlayer.srs).to.eql({'CRS:84': true});
|
||||
var srs = {'CRS:84': true, 'EPSG:26986': true};
|
||||
expect(layers['ROADS_RIVERS'].srs).to.eql(srs);
|
||||
expect(layers['Temperature'].srs).to.eql({'CRS:84': true});
|
||||
var infoFormats = ['text/xml', 'text/plain', 'text/html'];
|
||||
expect(layers['Temperature'].infoFormats).to.eql(infoFormats);
|
||||
var bbox = layers['ROADS_RIVERS'].bbox['EPSG:26986'];
|
||||
expect(bbox.bbox).to.eql([189000, 834000, 285000, 962000]);
|
||||
expect(bbox.res).to.eql({x: 1, y: 1});
|
||||
bbox = layers['ROADS_RIVERS'].bbox['CRS:84'];
|
||||
expect(bbox.bbox).to.eql([-71.63, 41.75, -70.78, 42.90]);
|
||||
expect(bbox.res).to.eql({x: 0.01, y: 0.01});
|
||||
bbox = layers['ROADS_1M'].bbox['EPSG:26986'];
|
||||
expect(bbox.bbox).to.eql([189000, 834000, 285000, 962000]);
|
||||
expect(bbox.res).to.eql({x: 1, y: 1});
|
||||
expect(identifiers).to.be.ok();
|
||||
expect('DIF_ID' in identifiers).to.be.ok();
|
||||
expect(identifiers['DIF_ID']).to.eql('123456');
|
||||
expect('DIF_ID' in authorities).to.be.ok();
|
||||
var url = 'http://gcmd.gsfc.nasa.gov/difguide/whatisadif.html';
|
||||
expect(authorities['DIF_ID']).to.eql(url);
|
||||
expect(featurelist).to.be.ok();
|
||||
expect(featurelist.format).to.eql('XML');
|
||||
url = 'http://www.university.edu/data/roads_rivers.gml';
|
||||
expect(featurelist.href).to.eql(url);
|
||||
expect(layers['Pressure'].queryable).to.be.ok();
|
||||
expect(layers['ozone_image'].queryable).to.not.be();
|
||||
expect(layers['population'].cascaded).to.eql(1);
|
||||
expect(layers['ozone_image'].fixedWidth).to.eql(512);
|
||||
expect(layers['ozone_image'].fixedHeight).to.eql(256);
|
||||
expect(layers['ozone_image'].opaque).to.be.ok();
|
||||
expect(layers['ozone_image'].noSubsets).to.be.ok();
|
||||
expect(time['default']).to.eql('2000-08-22');
|
||||
expect(time.values.length).to.eql(1);
|
||||
expect(time.values[0]).to.eql('1999-01-01/2000-08-22/P1D');
|
||||
expect(elevation.units).to.eql('CRS:88');
|
||||
expect(elevation['default']).to.eql('0');
|
||||
expect(elevation.nearestVal).to.be.ok();
|
||||
expect(elevation.multipleVal).to.not.be();
|
||||
expect(elevation.values).to.eql(
|
||||
['0', '1000', '3000', '5000', '10000']);
|
||||
expect(contactinfo).to.be.ok();
|
||||
expect(personPrimary).to.be.ok();
|
||||
expect(personPrimary.person).to.eql('Jeff Smith');
|
||||
expect(personPrimary.organization).to.eql('NASA');
|
||||
expect(contactinfo.position).to.eql('Computer Scientist');
|
||||
expect(addr).to.be.ok();
|
||||
expect(addr.type).to.eql('postal');
|
||||
expect(addr.address).to.eql('NASA Goddard Space Flight Center');
|
||||
expect(addr.city).to.eql('Greenbelt');
|
||||
expect(addr.stateOrProvince).to.eql('MD');
|
||||
expect(addr.postcode).to.eql('20771');
|
||||
expect(addr.country).to.eql('USA');
|
||||
expect(contactinfo.phone).to.eql('+1 301 555-1212');
|
||||
expect(contactinfo.email).to.eql('user@host.com');
|
||||
expect('fees' in service).to.not.be();
|
||||
expect('accessConstraints' in service).to.not.be();
|
||||
expect(request).to.be.ok();
|
||||
expect('getmap' in request).to.be.ok();
|
||||
expect('getfeatureinfo' in request).to.be.ok();
|
||||
var formats = ['text/xml', 'text/plain', 'text/html'];
|
||||
expect(request.getfeatureinfo.formats).to.eql(formats);
|
||||
expect(exception).to.be.ok();
|
||||
formats = ['XML', 'INIMAGE', 'BLANK'];
|
||||
expect(exception.formats).to.eql(formats);
|
||||
expect(attribution.title).to.eql('State College University');
|
||||
expect(attribution.href).to.eql('http://www.university.edu/');
|
||||
url = 'http://www.university.edu/icons/logo.gif';
|
||||
expect(attribution.logo.href).to.eql(url);
|
||||
expect(attribution.logo.format).to.eql('image/gif');
|
||||
expect(attribution.logo.width).to.eql('100');
|
||||
expect(attribution.logo.height).to.eql('100');
|
||||
expect(keywords.length).to.eql(3);
|
||||
expect(keywords[0].value).to.eql('road');
|
||||
expect(metadataURLs.length).to.eql(2);
|
||||
expect(metadataURLs[0].type).to.eql('FGDC:1998');
|
||||
expect(metadataURLs[0].format).to.eql('text/plain');
|
||||
url = 'http://www.university.edu/metadata/roads.txt';
|
||||
expect(metadataURLs[0].href).to.eql(url);
|
||||
var minScale = 250000;
|
||||
expect(capability.layers[0].minScale).to.eql(minScale.toPrecision(16));
|
||||
var maxScale = 1000;
|
||||
expect(capability.layers[0].maxScale).to.eql(maxScale.toPrecision(16));
|
||||
expect(obj.service.layerLimit).to.eql(16);
|
||||
expect(obj.service.maxHeight).to.eql(2048);
|
||||
expect(obj.service.maxWidth).to.eql(2048);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('ol.parser.ogc.WMSCapabilities');
|
||||
@@ -1,16 +0,0 @@
|
||||
<?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>
|
||||
File diff suppressed because one or more lines are too long
@@ -1,10 +0,0 @@
|
||||
<gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:Box>
|
||||
@@ -1,3 +0,0 @@
|
||||
<gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,4</gml:coordinates>
|
||||
</gml:Box>
|
||||
@@ -1,31 +0,0 @@
|
||||
<gml:GeometryCollection xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:geometryMember>
|
||||
<gml:Point srsName="foo">
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2</gml:coordinates>
|
||||
</gml:Point>
|
||||
</gml:geometryMember>
|
||||
<gml:geometryMember>
|
||||
<gml:LineString srsName="foo">
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,4</gml:coordinates>
|
||||
</gml:LineString>
|
||||
</gml:geometryMember>
|
||||
<gml:geometryMember>
|
||||
<gml:Polygon srsName="foo">
|
||||
<gml:outerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,2 3,4 1,2</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
</gml:outerBoundaryIs>
|
||||
<gml:innerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">2,3 2,5 4,5 2,3</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
</gml:innerBoundaryIs>
|
||||
<gml:innerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">3,4 3,6 5,6 3,4</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
</gml:innerBoundaryIs>
|
||||
</gml:Polygon>
|
||||
</gml:geometryMember>
|
||||
</gml:GeometryCollection>
|
||||
@@ -1,18 +0,0 @@
|
||||
<gml:LinearRing xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>5</gml:X>
|
||||
<gml:Y>6</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:LinearRing>
|
||||
@@ -1,3 +0,0 @@
|
||||
<gml:LinearRing xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,4 5,6 1,2</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
@@ -1,10 +0,0 @@
|
||||
<gml:LineString xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:LineString>
|
||||
@@ -1,3 +0,0 @@
|
||||
<gml:LineString xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,4</gml:coordinates>
|
||||
</gml:LineString>
|
||||
@@ -1,26 +0,0 @@
|
||||
<gml:MultiLineString xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:lineStringMember>
|
||||
<gml:LineString>
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>2</gml:X>
|
||||
<gml:Y>3</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:LineString>
|
||||
</gml:lineStringMember>
|
||||
<gml:lineStringMember>
|
||||
<gml:LineString>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>4</gml:X>
|
||||
<gml:Y>5</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:LineString>
|
||||
</gml:lineStringMember>
|
||||
</gml:MultiLineString>
|
||||
@@ -1,12 +0,0 @@
|
||||
<gml:MultiLineString xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:lineStringMember>
|
||||
<gml:LineString>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2 2,3</gml:coordinates>
|
||||
</gml:LineString>
|
||||
</gml:lineStringMember>
|
||||
<gml:lineStringMember>
|
||||
<gml:LineString>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">3,4 4,5</gml:coordinates>
|
||||
</gml:LineString>
|
||||
</gml:lineStringMember>
|
||||
</gml:MultiLineString>
|
||||
@@ -1 +0,0 @@
|
||||
<?xml version='1.0' encoding="ISO-8859-1" ?><wfs:FeatureCollection xmlns:rws="http://mapserver.gis.umn.edu/mapserver" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://mapserver.gis.umn.edu/mapserver http://intranet.rijkswaterstaat.nl/services/geoservices/kerngisnat_utre?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=VKUNSTWERK,LKUNSTWERK,PKUNSTWERK&OUTPUTFORMAT=XMLSCHEMA"> <gml:boundedBy> <gml:Box srsName="EPSG:28992"> <gml:coordinates>134503.789000,455332.337000 135149.909000,455893.926000</gml:coordinates> </gml:Box> </gml:boundedBy> <gml:featureMember> <rws:VKUNSTWERK fid="VKUNSTWERK.16"> <gml:boundedBy> <gml:Box srsName="EPSG:28992"> <gml:coordinates>134949.571000,455438.845000 134978.799000,455471.762000</gml:coordinates> </gml:Box> </gml:boundedBy> <rws:geometry> <gml:MultiPolygon srsName="EPSG:28992"> <gml:polygonMember> <gml:Polygon> <gml:outerBoundaryIs> <gml:LinearRing> <gml:coordinates>134974.191000,455471.587000 134973.974000,455471.762000 134973.558000,455471.248000 134973.579000,455471.230000 134963.143000,455458.768000 134962.787000,455458.653000 134960.514000,455456.003000 134960.440000,455455.539000 134950.207000,455443.320000 134950.158000,455443.360000 134949.571000,455442.638000 134949.810000,455442.462000 134951.417000,455441.223000 134951.435000,455441.209000 134954.158000,455439.108000 134954.507000,455438.845000 134955.000000,455439.420000 134954.954000,455439.458000 134965.046000,455451.520000 134965.568000,455451.606000 134968.159000,455454.642000 134968.120000,455455.195000 134978.294000,455467.355000 134978.330000,455467.326000 134978.799000,455467.881000 134978.598000,455468.042000 134975.885000,455470.224000 134974.191000,455471.587000 </gml:coordinates> </gml:LinearRing> </gml:outerBoundaryIs> <gml:innerBoundaryIs> <gml:LinearRing> <gml:coordinates>134960.590000,455455.163000 134963.589000,455458.755000 134973.756000,455470.929000 134973.836000,455471.019000 134974.216000,455471.445000 134975.807000,455470.163000 134978.485000,455468.005000 134978.077000,455467.534000 134978.015000,455467.462000 134967.969000,455455.479000 134964.782000,455451.678000 134954.705000,455439.660000 134954.622000,455439.561000 134954.271000,455439.152000 134951.498000,455441.284000 134949.973000,455442.456000 134950.452000,455443.023000 134950.501000,455443.081000 134960.590000,455455.163000 </gml:coordinates> </gml:LinearRing> </gml:innerBoundaryIs> </gml:Polygon> </gml:polygonMember> </gml:MultiPolygon> </rws:geometry> <rws:OBJECTID>16</rws:OBJECTID> <rws:OBJECTSUBCATEGORIE>31</rws:OBJECTSUBCATEGORIE> </rws:VKUNSTWERK> </gml:featureMember> <gml:featureMember> <rws:LKUNSTWERK fid="LKUNSTWERK.14"> <gml:boundedBy> <gml:Box srsName="EPSG:28992"> <gml:coordinates>135080.966000,455332.337000 135149.909000,455390.384000</gml:coordinates> </gml:Box> </gml:boundedBy> <rws:geometry> <gml:MultiLineString srsName="EPSG:28992"> <gml:lineStringMember> <gml:LineString> <gml:coordinates>135080.966000,455390.384000 135096.654000,455377.009000 135109.082000,455366.755000 135122.769000,455355.276000 135141.565000,455339.633000 135149.909000,455332.337000 </gml:coordinates> </gml:LineString> </gml:lineStringMember> </gml:MultiLineString> </rws:geometry> <rws:OBJECTID>14</rws:OBJECTID> <rws:OBJECTSUBCATEGORIE>30</rws:OBJECTSUBCATEGORIE> </rws:LKUNSTWERK> </gml:featureMember> <gml:featureMember> <rws:PKUNSTWERK fid="PKUNSTWERK.29"> <gml:boundedBy> <gml:Box srsName="EPSG:28992"> <gml:coordinates>134832.017000,455596.187000 134832.017000,455596.187000</gml:coordinates> </gml:Box> </gml:boundedBy> <rws:geometry> <gml:MultiPoint srsName="EPSG:28992"> <gml:pointMember> <gml:Point> <gml:coordinates>134832.017000,455596.187000</gml:coordinates> </gml:Point> </gml:pointMember> </gml:MultiPoint> </rws:geometry> <rws:OBJECTID>29</rws:OBJECTID> <rws:OBJECTSUBCATEGORIE>30</rws:OBJECTSUBCATEGORIE> </rws:PKUNSTWERK> </gml:featureMember></wfs:FeatureCollection>
|
||||
@@ -1,26 +0,0 @@
|
||||
<gml:MultiPoint xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:pointMember>
|
||||
<gml:Point>
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:Point>
|
||||
</gml:pointMember>
|
||||
<gml:pointMember>
|
||||
<gml:Point>
|
||||
<gml:coord>
|
||||
<gml:X>2</gml:X>
|
||||
<gml:Y>3</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:Point>
|
||||
</gml:pointMember>
|
||||
<gml:pointMember>
|
||||
<gml:Point>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:Point>
|
||||
</gml:pointMember>
|
||||
</gml:MultiPoint>
|
||||
@@ -1,17 +0,0 @@
|
||||
<gml:MultiPoint xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:pointMember>
|
||||
<gml:Point>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2</gml:coordinates>
|
||||
</gml:Point>
|
||||
</gml:pointMember>
|
||||
<gml:pointMember>
|
||||
<gml:Point>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">2,3</gml:coordinates>
|
||||
</gml:Point>
|
||||
</gml:pointMember>
|
||||
<gml:pointMember>
|
||||
<gml:Point>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">3,4</gml:coordinates>
|
||||
</gml:Point>
|
||||
</gml:pointMember>
|
||||
</gml:MultiPoint>
|
||||
@@ -1,90 +0,0 @@
|
||||
<gml:MultiPolygon xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:polygonMember>
|
||||
<gml:Polygon>
|
||||
<gml:outerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:LinearRing>
|
||||
</gml:outerBoundaryIs>
|
||||
<gml:innerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coord>
|
||||
<gml:X>2</gml:X>
|
||||
<gml:Y>3</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>2</gml:X>
|
||||
<gml:Y>5</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>4</gml:X>
|
||||
<gml:Y>5</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>2</gml:X>
|
||||
<gml:Y>3</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:LinearRing>
|
||||
</gml:innerBoundaryIs>
|
||||
<gml:innerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>6</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>5</gml:X>
|
||||
<gml:Y>6</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:LinearRing>
|
||||
</gml:innerBoundaryIs>
|
||||
</gml:Polygon>
|
||||
</gml:polygonMember>
|
||||
<gml:polygonMember>
|
||||
<gml:Polygon>
|
||||
<gml:outerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:LinearRing>
|
||||
</gml:outerBoundaryIs>
|
||||
</gml:Polygon>
|
||||
</gml:polygonMember>
|
||||
</gml:MultiPolygon>
|
||||
@@ -1,30 +0,0 @@
|
||||
<gml:MultiPolygon xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:polygonMember>
|
||||
<gml:Polygon>
|
||||
<gml:outerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,2 3,4 1,2</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
</gml:outerBoundaryIs>
|
||||
<gml:innerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">2,3 2,5 4,5 2,3</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
</gml:innerBoundaryIs>
|
||||
<gml:innerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">3,4 3,6 5,6 3,4</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
</gml:innerBoundaryIs>
|
||||
</gml:Polygon>
|
||||
</gml:polygonMember>
|
||||
<gml:polygonMember>
|
||||
<gml:Polygon>
|
||||
<gml:outerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,2 3,4 1,2</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
</gml:outerBoundaryIs>
|
||||
</gml:Polygon>
|
||||
</gml:polygonMember>
|
||||
</gml:MultiPolygon>
|
||||
@@ -1 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><wfs:FeatureCollection xmlns="http://www.opengis.net/wfs" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:loc="http://server.fr/geoserver/loc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://server.fr:80/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd http://server.fr/geoserver/loc http://server.fr:80/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=loc:DEPARTEMENT"><gml:boundedBy><gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#2154"><gml:coordinates xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts=" ">199373,6704170 337568,6885985</gml:coordinates></gml:Box></gml:boundedBy><gml:featureMember><loc:DEPARTEMENT fid="DEPARTEMENT.1"><gml:boundedBy><gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#2154"><gml:coordinates xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts=" ">209565,6785323 337568,6885985</gml:coordinates></gml:Box></gml:boundedBy><loc:NOM_DEPT>COTES-D'ARMOR</loc:NOM_DEPT></loc:DEPARTEMENT></gml:featureMember><gml:featureMember><loc:DEPARTEMENT fid="DEPARTEMENT.3"><gml:boundedBy><gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#2154"><gml:coordinates xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts=" ">199373,6704170 323518,6807542</gml:coordinates></gml:Box></gml:boundedBy><loc:NOM_DEPT>MORBIHAN</loc:NOM_DEPT></loc:DEPARTEMENT></gml:featureMember></wfs:FeatureCollection>
|
||||
@@ -1,6 +0,0 @@
|
||||
<gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="FOO">
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:Point>
|
||||
@@ -1,3 +0,0 @@
|
||||
<gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2</gml:coordinates>
|
||||
</gml:Point>
|
||||
@@ -1,62 +0,0 @@
|
||||
<gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:outerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>5</gml:X>
|
||||
<gml:Y>6</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>1</gml:X>
|
||||
<gml:Y>2</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:LinearRing>
|
||||
</gml:outerBoundaryIs>
|
||||
<gml:innerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coord>
|
||||
<gml:X>2</gml:X>
|
||||
<gml:Y>3</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>4</gml:X>
|
||||
<gml:Y>5</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>6</gml:X>
|
||||
<gml:Y>7</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>2</gml:X>
|
||||
<gml:Y>3</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:LinearRing>
|
||||
</gml:innerBoundaryIs>
|
||||
<gml:innerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>5</gml:X>
|
||||
<gml:Y>6</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>7</gml:X>
|
||||
<gml:Y>8</gml:Y>
|
||||
</gml:coord>
|
||||
<gml:coord>
|
||||
<gml:X>3</gml:X>
|
||||
<gml:Y>4</gml:Y>
|
||||
</gml:coord>
|
||||
</gml:LinearRing>
|
||||
</gml:innerBoundaryIs>
|
||||
</gml:Polygon>
|
||||
@@ -1,17 +0,0 @@
|
||||
<gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:outerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2 5,2 5,6 1,2</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
</gml:outerBoundaryIs>
|
||||
<gml:innerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">2,3 2,5 4,5 2,3</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
</gml:innerBoundaryIs>
|
||||
<gml:innerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">3,4 3,6 5,6 3,4</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
</gml:innerBoundaryIs>
|
||||
</gml:Polygon>
|
||||
File diff suppressed because one or more lines are too long
@@ -1,7 +0,0 @@
|
||||
<gml:Curve xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:segments>
|
||||
<gml:LineStringSegment>
|
||||
<gml:posList>1 2 3 4</gml:posList>
|
||||
</gml:LineStringSegment>
|
||||
</gml:segments>
|
||||
</gml:Curve>
|
||||
@@ -1,15 +0,0 @@
|
||||
<gml:featureMembers xmlns:gml="http://www.opengis.net/gml">
|
||||
<topp:gnis_pop gml:id="gnis_pop.148604" xmlns:topp="http://www.openplans.org/topp">
|
||||
<gml:name>Aflu</gml:name>
|
||||
<topp:the_geom>
|
||||
<gml:Point srsName="urn:x-ogc:def:crs:EPSG:4326">
|
||||
<gml:pos>34.12 2.09</gml:pos>
|
||||
</gml:Point>
|
||||
</topp:the_geom>
|
||||
<topp:population>84683</topp:population>
|
||||
<topp:country>Algeria</topp:country>
|
||||
<topp:type>place</topp:type>
|
||||
<topp:name>Aflu</topp:name>
|
||||
<topp:empty></topp:empty>
|
||||
</topp:gnis_pop>
|
||||
</gml:featureMembers>
|
||||
@@ -1,4 +0,0 @@
|
||||
<gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:lowerCorner>1 2</gml:lowerCorner>
|
||||
<gml:upperCorner>3 4</gml:upperCorner>
|
||||
</gml:Envelope>
|
||||
@@ -1,3 +0,0 @@
|
||||
<gml:LinearRing xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
@@ -1,3 +0,0 @@
|
||||
<gml:LineString xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:posList>1 2 3 4</gml:posList>
|
||||
</gml:LineString>
|
||||
@@ -1,3 +0,0 @@
|
||||
<gml:LineString xmlns:gml="http://www.opengis.net/gml" srsName="foo" srsDimension="3">
|
||||
<gml:posList>1 2 3 4 5 6</gml:posList>
|
||||
</gml:LineString>
|
||||
@@ -1,20 +0,0 @@
|
||||
<gml:MultiCurve xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:curveMember>
|
||||
<gml:Curve>
|
||||
<gml:segments>
|
||||
<gml:LineStringSegment>
|
||||
<gml:posList>1 2 2 3</gml:posList>
|
||||
</gml:LineStringSegment>
|
||||
</gml:segments>
|
||||
</gml:Curve>
|
||||
</gml:curveMember>
|
||||
<gml:curveMember>
|
||||
<gml:Curve>
|
||||
<gml:segments>
|
||||
<gml:LineStringSegment>
|
||||
<gml:posList>3 4 4 5</gml:posList>
|
||||
</gml:LineStringSegment>
|
||||
</gml:segments>
|
||||
</gml:Curve>
|
||||
</gml:curveMember>
|
||||
</gml:MultiCurve>
|
||||
@@ -1,12 +0,0 @@
|
||||
<gml:MultiCurve xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:curveMember>
|
||||
<gml:LineString>
|
||||
<gml:posList>1 2 2 3</gml:posList>
|
||||
</gml:LineString>
|
||||
</gml:curveMember>
|
||||
<gml:curveMember>
|
||||
<gml:LineString>
|
||||
<gml:posList>3 4 4 5</gml:posList>
|
||||
</gml:LineString>
|
||||
</gml:curveMember>
|
||||
</gml:MultiCurve>
|
||||
@@ -1,10 +0,0 @@
|
||||
<gml:MultiLineString xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:lineStringMembers>
|
||||
<gml:LineString>
|
||||
<gml:posList>1 2 2 3</gml:posList>
|
||||
</gml:LineString>
|
||||
<gml:LineString>
|
||||
<gml:posList>3 4 4 5</gml:posList>
|
||||
</gml:LineString>
|
||||
</gml:lineStringMembers>
|
||||
</gml:MultiLineString>
|
||||
@@ -1,12 +0,0 @@
|
||||
<gml:MultiLineString xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:lineStringMember>
|
||||
<gml:LineString>
|
||||
<gml:posList>1 2 2 3</gml:posList>
|
||||
</gml:LineString>
|
||||
</gml:lineStringMember>
|
||||
<gml:lineStringMember>
|
||||
<gml:LineString>
|
||||
<gml:posList>3 4 4 5</gml:posList>
|
||||
</gml:LineString>
|
||||
</gml:lineStringMember>
|
||||
</gml:MultiLineString>
|
||||
@@ -1,13 +0,0 @@
|
||||
<gml:MultiPoint xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:pointMembers>
|
||||
<gml:Point>
|
||||
<gml:pos>1 2</gml:pos>
|
||||
</gml:Point>
|
||||
<gml:Point>
|
||||
<gml:pos>2 3</gml:pos>
|
||||
</gml:Point>
|
||||
<gml:Point>
|
||||
<gml:pos>3 4</gml:pos>
|
||||
</gml:Point>
|
||||
</gml:pointMembers>
|
||||
</gml:MultiPoint>
|
||||
@@ -1,17 +0,0 @@
|
||||
<gml:MultiPoint xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:pointMember>
|
||||
<gml:Point>
|
||||
<gml:pos>1 2</gml:pos>
|
||||
</gml:Point>
|
||||
</gml:pointMember>
|
||||
<gml:pointMember>
|
||||
<gml:Point>
|
||||
<gml:pos>2 3</gml:pos>
|
||||
</gml:Point>
|
||||
</gml:pointMember>
|
||||
<gml:pointMember>
|
||||
<gml:Point>
|
||||
<gml:pos>3 4</gml:pos>
|
||||
</gml:Point>
|
||||
</gml:pointMember>
|
||||
</gml:MultiPoint>
|
||||
@@ -1,28 +0,0 @@
|
||||
<gml:MultiPolygon xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:polygonMembers>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
</gml:Polygon>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:polygonMembers>
|
||||
</gml:MultiPolygon>
|
||||
@@ -1,30 +0,0 @@
|
||||
<gml:MultiPolygon xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:polygonMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
</gml:Polygon>
|
||||
</gml:polygonMember>
|
||||
<gml:polygonMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:polygonMember>
|
||||
</gml:MultiPolygon>
|
||||
@@ -1,28 +0,0 @@
|
||||
<gml:MultiSurface xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:surfaceMembers>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
</gml:Polygon>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMembers>
|
||||
</gml:MultiSurface>
|
||||
@@ -1,30 +0,0 @@
|
||||
<gml:MultiSurface xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
</gml:MultiSurface>
|
||||
@@ -1,38 +0,0 @@
|
||||
<gml:MultiSurface xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:surfaceMember>
|
||||
<gml:Surface>
|
||||
<gml:patches>
|
||||
<gml:PolygonPatch interpolation="planar">
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
</gml:PolygonPatch>
|
||||
</gml:patches>
|
||||
</gml:Surface>
|
||||
</gml:surfaceMember>
|
||||
<gml:surfaceMember>
|
||||
<gml:Surface>
|
||||
<gml:patches>
|
||||
<gml:PolygonPatch interpolation="planar">
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:PolygonPatch>
|
||||
</gml:patches>
|
||||
</gml:Surface>
|
||||
</gml:surfaceMember>
|
||||
</gml:MultiSurface>
|
||||
@@ -1,3 +0,0 @@
|
||||
<gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:pos>1 2</gml:pos>
|
||||
</gml:Point>
|
||||
@@ -1,17 +0,0 @@
|
||||
<gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
</gml:Polygon>
|
||||
@@ -1,21 +0,0 @@
|
||||
<gml:Surface xmlns:gml="http://www.opengis.net/gml" srsName="foo">
|
||||
<gml:patches>
|
||||
<gml:PolygonPatch interpolation="planar">
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
<gml:interior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:interior>
|
||||
</gml:PolygonPatch>
|
||||
</gml:patches>
|
||||
</gml:Surface>
|
||||
@@ -1,41 +0,0 @@
|
||||
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs" xmlns:topp="http://www.openplans.org/topp" xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:featureMember>
|
||||
<topp:states fid="states.3">
|
||||
<topp:the_geom>
|
||||
<gml:MultiPolygon srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
|
||||
<gml:polygonMember>
|
||||
<gml:Polygon>
|
||||
<gml:outerBoundaryIs>
|
||||
<gml:LinearRing>
|
||||
<gml:coordinates decimal="." cs="," ts=" ">-75.70742,38.557476 -75.71106,38.649551 -75.724937,38.83017 -75.752922,39.141548 -75.761658,39.247753 -75.764664,39.295849 -75.772697,39.383007 -75.791435,39.723755 -75.775269,39.724442 -75.745934,39.774818 -75.695114,39.820347 -75.644341,39.838196 -75.583794,39.840008 -75.470345,39.826435 -75.42083,39.79887 -75.412117,39.789658 -75.428009,39.77813 -75.460754,39.763248 -75.475128,39.741718 -75.476334,39.719971 -75.489639,39.714745 -75.610725,39.612793 -75.562996,39.566723 -75.590187,39.463768 -75.515572,39.36694 -75.402481,39.257637 -75.397728,39.073036 -75.324852,39.012386 -75.307899,38.945911 -75.190941,38.80867 -75.083138,38.799812 -75.045998,38.44949 -75.068298,38.449963 -75.093094,38.450451 -75.350204,38.455208 -75.69915,38.463066 -75.70742,38.557476</gml:coordinates>
|
||||
</gml:LinearRing>
|
||||
</gml:outerBoundaryIs>
|
||||
</gml:Polygon>
|
||||
</gml:polygonMember>
|
||||
</gml:MultiPolygon>
|
||||
</topp:the_geom>
|
||||
<topp:STATE_NAME>Delaware</topp:STATE_NAME>
|
||||
<topp:STATE_FIPS>10</topp:STATE_FIPS>
|
||||
<topp:SUB_REGION>S Atl</topp:SUB_REGION>
|
||||
<topp:STATE_ABBR>DE</topp:STATE_ABBR>
|
||||
<topp:LAND_KM>5062.456</topp:LAND_KM>
|
||||
<topp:WATER_KM>1385.022</topp:WATER_KM>
|
||||
<topp:PERSONS>666168.0</topp:PERSONS>
|
||||
<topp:FAMILIES>175867.0</topp:FAMILIES>
|
||||
<topp:HOUSHOLD>247497.0</topp:HOUSHOLD>
|
||||
<topp:MALE>322968.0</topp:MALE>
|
||||
<topp:FEMALE>343200.0</topp:FEMALE>
|
||||
<topp:WORKERS>247566.0</topp:WORKERS>
|
||||
<topp:DRVALONE>258087.0</topp:DRVALONE>
|
||||
<topp:CARPOOL>42968.0</topp:CARPOOL>
|
||||
<topp:PUBTRANS>8069.0</topp:PUBTRANS>
|
||||
<topp:EMPLOYED>335147.0</topp:EMPLOYED>
|
||||
<topp:UNEMPLOY>13945.0</topp:UNEMPLOY>
|
||||
<topp:SERVICE>87973.0</topp:SERVICE>
|
||||
<topp:MANUAL>44140.0</topp:MANUAL>
|
||||
<topp:P_MALE>0.485</topp:P_MALE>
|
||||
<topp:P_FEMALE>0.515</topp:P_FEMALE>
|
||||
<topp:SAMP_POP>102776.0</topp:SAMP_POP>
|
||||
</topp:states>
|
||||
</gml:featureMember>
|
||||
</wfs:FeatureCollection>
|
||||
@@ -1,3 +0,0 @@
|
||||
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" handle="handle_g" outputFormat="json" maxFeatures="1" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<wfs:Query typeName="topp:states" xmlns:topp="http://www.openplans.org/topp"/>
|
||||
</wfs:GetFeature>
|
||||
@@ -1 +0,0 @@
|
||||
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" service="WFS" version="1.0.0" handle="handle_t" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"/>
|
||||
@@ -1,11 +0,0 @@
|
||||
<wfs:WFS_TransactionResponse version="1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc">
|
||||
<wfs:InsertResult>
|
||||
<ogc:FeatureId fid="parcelle.40"/>
|
||||
<ogc:FeatureId fid="parcelle.41"/>
|
||||
</wfs:InsertResult>
|
||||
<wfs:TransactionResult>
|
||||
<wfs:Status>
|
||||
<wfs:SUCCESS/>
|
||||
</wfs:Status>
|
||||
</wfs:TransactionResult>
|
||||
</wfs:WFS_TransactionResponse>
|
||||
@@ -1,11 +0,0 @@
|
||||
<wfs:GetFeature service="WFS" version="1.0.0" xmlns:topp="http://www.openplans.org/topp"
|
||||
xmlns:wfs="http://www.opengis.net/wfs"
|
||||
xmlns:ogc="http://www.opengis.net/ogc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd">
|
||||
<wfs:Query xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" xmlns:topp="http://www.openplans.org/topp">
|
||||
<ogc:PropertyName>STATE_NAME</ogc:PropertyName>
|
||||
<ogc:PropertyName>STATE_FIPS</ogc:PropertyName>
|
||||
<ogc:PropertyName>STATE_ABBR</ogc:PropertyName>
|
||||
</wfs:Query>
|
||||
</wfs:GetFeature>
|
||||
@@ -1,10 +0,0 @@
|
||||
<wfs:Query xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" xmlns:topp="http://www.openplans.org/topp">
|
||||
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
|
||||
<ogc:BBOX>
|
||||
<ogc:PropertyName>the_geom</ogc:PropertyName>
|
||||
<gml:Box xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,4</gml:coordinates>
|
||||
</gml:Box>
|
||||
</ogc:BBOX>
|
||||
</ogc:Filter>
|
||||
</wfs:Query>
|
||||
@@ -1,11 +0,0 @@
|
||||
<wfs:GetFeature service="WFS" version="1.1.0" resultType="hits" xmlns:topp="http://www.openplans.org/topp"
|
||||
xmlns:wfs="http://www.opengis.net/wfs"
|
||||
xmlns:ogc="http://www.opengis.net/ogc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
|
||||
<wfs:Query xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" srsName="urn:ogc:def:crs:EPSG::4326" xmlns:topp="http://www.openplans.org/topp">
|
||||
<wfs:PropertyName>STATE_NAME</wfs:PropertyName>
|
||||
<wfs:PropertyName>STATE_FIPS</wfs:PropertyName>
|
||||
<wfs:PropertyName>STATE_ABBR</wfs:PropertyName>
|
||||
</wfs:Query>
|
||||
</wfs:GetFeature>
|
||||
@@ -1,8 +0,0 @@
|
||||
<wfs:GetFeature service="WFS" version="1.1.0" startIndex="20" count="10" xmlns:topp="http://www.openplans.org/topp"
|
||||
xmlns:wfs="http://www.opengis.net/wfs"
|
||||
xmlns:ogc="http://www.opengis.net/ogc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
|
||||
<wfs:Query xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" srsName="urn:ogc:def:crs:EPSG::4326" xmlns:topp="http://www.openplans.org/topp">
|
||||
</wfs:Query>
|
||||
</wfs:GetFeature>
|
||||
@@ -1,11 +0,0 @@
|
||||
<wfs:Query xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" srsName="urn:ogc:def:crs:EPSG::4326" xmlns:topp="http://www.openplans.org/topp">
|
||||
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
|
||||
<ogc:BBOX>
|
||||
<ogc:PropertyName>the_geom</ogc:PropertyName>
|
||||
<gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="urn:ogc:def:crs:EPSG::4326">
|
||||
<gml:lowerCorner>1 2</gml:lowerCorner>
|
||||
<gml:upperCorner>3 4</gml:upperCorner>
|
||||
</gml:Envelope>
|
||||
</ogc:BBOX>
|
||||
</ogc:Filter>
|
||||
</wfs:Query>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +0,0 @@
|
||||
<?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>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,283 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,124 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,178 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user