Store rings so exerior is clockwise and interior is counter-clockwise

KML and WKT don't specify a winding order, so we write those out in CW/CCW order (for exterior/interior).  GML references ISO 19107 that specifies CCW/CW, so we serialize in that winding order.

Having hand generated all this GML data the first time around, I reserve the right to modify it for the tests.
This commit is contained in:
Tim Schaub
2013-06-24 17:46:36 -06:00
parent e292d8fa12
commit 99ba5a0da8
20 changed files with 150 additions and 121 deletions
-16
View File
@@ -247,14 +247,6 @@ describe('ol.parser.gml_v3', function() {
delete parser.srsName;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(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();
});
});
@@ -268,14 +260,6 @@ describe('ol.parser.gml_v3', function() {
[geom]).firstChild;
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(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();
});
});