Merge pull request #6620 from Jenselme/fix-gml2-desirializer-3D

Fix the parsing of flat coordinates in GML2 for 3D geometies
This commit is contained in:
Bart van den Eijnden
2017-03-31 11:45:18 +02:00
committed by GitHub
2 changed files with 23 additions and 23 deletions

View File

@@ -62,6 +62,17 @@ describe('ol.format.GML2', function() {
expect(g.getCoordinates()).to.eql([-180, -90, 0]);
});
it('can read a 3D point geometry', function() {
var text = '<gml:Point xmlns:gml="http://www.opengis.net/gml" ' +
' srsName="urn:x-ogc:def:crs:EPSG:4326">' +
' <gml:coordinates>-90,-180,42</gml:coordinates>' +
'</gml:Point>';
var g = readGeometry(format, text);
expect(g).to.be.an(ol.geom.Point);
expect(g.getCoordinates()).to.eql([-180, -90, 42]);
});
it('can read a box element', function() {
var text = '<gml:Box xmlns:gml="http://www.opengis.net/gml" ' +
'srsName="EPSG:4326">' +
@@ -86,17 +97,17 @@ describe('ol.format.GML2', function() {
' -0.768746,47.358268 ' +
' -0.574463,47.684285 -0.347374,47.854602 ' +
' -0.006740,47.925567 ' +
' 0.135191,47.726864 0.149384,47.599127 0.419052,' +
' 47.670092 0.532597,47.428810 ' +
' 0.305508,47.443003 0.475824,47.144948 0.064225,' +
' 47.201721 ' +
' 0.135191,47.726864 0.149384,47.599127 ' +
' 0.419052,47.670092 0.532597,47.428810 ' +
' 0.305508,47.443003 0.475824,47.144948 ' +
' 0.064225,47.201721 ' +
' -0.318987,47.003018 </gml:coordinates>' +
' </gml:LinearRing>' +
' </gml:outerBoundaryIs>' +
' <gml:innerBoundaryIs>' +
' <gml:LinearRing>' +
' <gml:coordinates>-0.035126,47.485582 -0.035126,' +
' 47.485582 ' +
' <gml:coordinates>-0.035126,47.485582 ' +
' -0.035126,47.485582 ' +
' -0.049319,47.641706 -0.233829,47.655899 ' +
' -0.375760,47.457196 ' +
' -0.276408,47.286879 -0.035126,47.485582 ' +