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
@@ -13,17 +13,17 @@
<gml:Polygon srsName="foo">
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,4 5,6 1,2</gml:coordinates>
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,2 3,4 1,2</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">2,3 4,5 6,7 2,3</gml:coordinates>
<gml:coordinates decimal="." cs="," ts=" ">2,3 2,5 4,5 2,3</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">3,4 5,6 7,8 3,4</gml:coordinates>
<gml:coordinates decimal="." cs="," ts=" ">3,4 3,6 5,6 3,4</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
</gml:Polygon>
@@ -9,11 +9,11 @@
</gml:coord>
<gml:coord>
<gml:X>3</gml:X>
<gml:Y>4</gml:Y>
<gml:Y>2</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>5</gml:X>
<gml:Y>6</gml:Y>
<gml:X>3</gml:X>
<gml:Y>4</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>1</gml:X>
@@ -28,12 +28,12 @@
<gml:Y>3</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>4</gml:X>
<gml:X>2</gml:X>
<gml:Y>5</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>6</gml:X>
<gml:Y>7</gml:Y>
<gml:X>4</gml:X>
<gml:Y>5</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>2</gml:X>
@@ -48,12 +48,12 @@
<gml:Y>4</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>5</gml:X>
<gml:X>3</gml:X>
<gml:Y>6</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>7</gml:X>
<gml:Y>8</gml:Y>
<gml:X>5</gml:X>
<gml:Y>6</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>3</gml:X>
@@ -73,11 +73,11 @@
</gml:coord>
<gml:coord>
<gml:X>3</gml:X>
<gml:Y>4</gml:Y>
<gml:Y>2</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>5</gml:X>
<gml:Y>6</gml:Y>
<gml:X>3</gml:X>
<gml:Y>4</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>1</gml:X>
@@ -3,17 +3,17 @@
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,4 5,6 1,2</gml:coordinates>
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,2 3,4 1,2</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">2,3 4,5 6,7 2,3</gml:coordinates>
<gml:coordinates decimal="." cs="," ts=" ">2,3 2,5 4,5 2,3</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">3,4 5,6 7,8 3,4</gml:coordinates>
<gml:coordinates decimal="." cs="," ts=" ">3,4 3,6 5,6 3,4</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
</gml:Polygon>
@@ -22,7 +22,7 @@
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,4 5,6 1,2</gml:coordinates>
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,2 3,4 1,2</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
@@ -1,17 +1,17 @@
<gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="foo">
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">1,2 3,4 5,6 1,2</gml:coordinates>
<gml:coordinates decimal="." cs="," ts=" ">1,2 5,2 5,6 1,2</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">2,3 4,5 6,7 2,3</gml:coordinates>
<gml:coordinates decimal="." cs="," ts=" ">2,3 2,5 4,5 2,3</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">3,4 5,6 7,8 3,4</gml:coordinates>
<gml:coordinates decimal="." cs="," ts=" ">3,4 3,6 5,6 3,4</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
</gml:Polygon>