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

@@ -1,34 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/kml/2.2 http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd">
<Document>
<name>Polygon.kml</name>
<open>0</open>
<Placemark id="KML.Polygon">
<name>hollow box</name>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-122.366278,37.818844,30
-122.365248,37.819267,30
-122.36564,37.819861,30
-122.366669,37.819429,30
-122.366278,37.818844,30
</coordinates>
</LinearRing>
</outerBoundaryIs>
<innerBoundaryIs>
<LinearRing>
<coordinates>
-122.366212,37.818977,30
-122.365424,37.819294,30
-122.365704,37.819731,30
-122.366488,37.819402,30
-122.366212,37.818977,30
</coordinates>
</LinearRing>
</innerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>
<Document>
<name>Polygon.kml</name>
<open>0</open>
<Placemark id="KML.Polygon">
<name>hollow box</name>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>-30,-20,0 -30,20,0 30,20,0 30,-20,0 -30,-20,0</coordinates>
</LinearRing>
</outerBoundaryIs>
<innerBoundaryIs>
<LinearRing>
<coordinates>-15,-10,0 15,-10,0 15,10,0 -15,10,0 -15,-10,0</coordinates>
</LinearRing>
</innerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>