Adds srsDimension to the pos and posList nodes when writing a WFS transaction

The WFS transaction failed if the srsDimension was not present on the
geometries.
Unit tests have been changed to accomodate the srsDimension attribute.
This commit is contained in:
Joao Gouveia
2017-08-16 10:20:22 +02:00
parent 44558b7c89
commit 5fce1b0351
9 changed files with 97 additions and 62 deletions

View File

@@ -573,6 +573,8 @@ ol.format.GML3.prototype.SEGMENTS_PARSERS_ = {
ol.format.GML3.prototype.writePos_ = function(node, value, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsDimension = hasZ ? 3 : 2;
node.setAttribute('srsDimension', srsDimension);
var srsName = context['srsName'];
var axisOrientation = 'enu';
if (srsName) {
@@ -629,6 +631,8 @@ ol.format.GML3.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
ol.format.GML3.prototype.writePosList_ = function(node, value, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsDimension = hasZ ? 3 : 2;
node.setAttribute('srsDimension', srsDimension);
var srsName = context['srsName'];
// only 2d for simple features profile
var points = value.getCoordinates();