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

View File

@@ -755,6 +755,10 @@ ol.parser.KML = function(opt_options) {
return node;
},
'Polygon': function(geometry) {
/**
* KML doesn't specify the winding order of coordinates in linear
* rings. So we keep them as they are in the geometries.
*/
var node = this.createElementNS('Polygon');
var coordinates = geometry.getCoordinates();
this.writeNode('outerBoundaryIs', coordinates[0], null, node);