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

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -3,24 +3,24 @@
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
<gml:interior>
<gml:LinearRing>
<gml:posList>2 3 4 5 6 7 2 3</gml:posList>
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
</gml:LinearRing>
</gml:interior>
<gml:interior>
<gml:LinearRing>
<gml:posList>3 4 5 6 7 8 3 4</gml:posList>
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
</gml:LinearRing>
</gml:interior>
</gml:Polygon>
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>

View File

@@ -3,17 +3,17 @@
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
<gml:interior>
<gml:LinearRing>
<gml:posList>2 3 4 5 6 7 2 3</gml:posList>
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
</gml:LinearRing>
</gml:interior>
<gml:interior>
<gml:LinearRing>
<gml:posList>3 4 5 6 7 8 3 4</gml:posList>
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
</gml:LinearRing>
</gml:interior>
</gml:Polygon>
@@ -22,7 +22,7 @@
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>

View File

@@ -3,24 +3,24 @@
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
<gml:interior>
<gml:LinearRing>
<gml:posList>2 3 4 5 6 7 2 3</gml:posList>
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
</gml:LinearRing>
</gml:interior>
<gml:interior>
<gml:LinearRing>
<gml:posList>3 4 5 6 7 8 3 4</gml:posList>
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
</gml:LinearRing>
</gml:interior>
</gml:Polygon>
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>

View File

@@ -3,17 +3,17 @@
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
<gml:interior>
<gml:LinearRing>
<gml:posList>2 3 4 5 6 7 2 3</gml:posList>
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
</gml:LinearRing>
</gml:interior>
<gml:interior>
<gml:LinearRing>
<gml:posList>3 4 5 6 7 8 3 4</gml:posList>
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
</gml:LinearRing>
</gml:interior>
</gml:Polygon>
@@ -22,7 +22,7 @@
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>

View File

@@ -5,17 +5,17 @@
<gml:PolygonPatch interpolation="planar">
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
<gml:interior>
<gml:LinearRing>
<gml:posList>2 3 4 5 6 7 2 3</gml:posList>
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
</gml:LinearRing>
</gml:interior>
<gml:interior>
<gml:LinearRing>
<gml:posList>3 4 5 6 7 8 3 4</gml:posList>
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
</gml:LinearRing>
</gml:interior>
</gml:PolygonPatch>
@@ -28,7 +28,7 @@
<gml:PolygonPatch interpolation="planar">
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:PolygonPatch>

View File

@@ -1,17 +1,17 @@
<gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="foo">
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
<gml:interior>
<gml:LinearRing>
<gml:posList>2 3 4 5 6 7 2 3</gml:posList>
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
</gml:LinearRing>
</gml:interior>
<gml:interior>
<gml:LinearRing>
<gml:posList>3 4 5 6 7 8 3 4</gml:posList>
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
</gml:LinearRing>
</gml:interior>
</gml:interior>
</gml:Polygon>

View File

@@ -3,17 +3,17 @@
<gml:PolygonPatch interpolation="planar">
<gml:exterior>
<gml:LinearRing>
<gml:posList>1 2 3 4 5 6 1 2</gml:posList>
<gml:posList>1 2 3 2 3 4 1 2</gml:posList>
</gml:LinearRing>
</gml:exterior>
<gml:interior>
<gml:LinearRing>
<gml:posList>2 3 4 5 6 7 2 3</gml:posList>
<gml:posList>2 3 2 5 4 5 2 3</gml:posList>
</gml:LinearRing>
</gml:interior>
<gml:interior>
<gml:LinearRing>
<gml:posList>3 4 5 6 7 8 3 4</gml:posList>
<gml:posList>3 4 3 6 5 6 3 4</gml:posList>
</gml:LinearRing>
</gml:interior>
</gml:PolygonPatch>