<run>
  <precisionModel scale="10" offsetx="0.0" offsety="0.0"/>

<case>
  <desc>makevalid/point/already_valid</desc>
  <a>POINT(0 0)</a>
  <test>
    <op name="makevalid" arg1="a">
        POINT(0 0)
    </op>
  </test>
</case>

<case>
  <desc>makevalid/point/empty</desc>
  <a>POINT EMPTY</a>
  <test>
    <op name="makevalid" arg1="a">
        POINT EMPTY
    </op>
  </test>
</case>

<case>
  <desc>makevalid/linestring/already_valid</desc>
  <a>LINESTRING(0 0,1 1)</a>
  <test>
    <op name="makevalid" arg1="a">
        LINESTRING(0 0,1 1)
    </op>
  </test>
</case>

<case>
  <desc>makevalid/linestring/invalid_result_point</desc>
  <a>LINESTRING(0 0,0 0)</a>
  <test>
    <op name="makevalid" arg1="a">
        POINT (0.0 0.0)
    </op>
  </test>
</case>

<case>
  <desc>makevalid/linestring/empty</desc>
  <a>LINESTRING EMPTY</a>
  <test>
    <op name="makevalid" arg1="a">
        LINESTRING EMPTY
    </op>
  </test>
</case>

<case>
  <desc>makevalid/mulilinestring/empty</desc>
  <a>MULTILINESTRING EMPTY</a>
  <test>
    <op name="makevalid" arg1="a">
        MULTILINESTRING EMPTY
    </op>
  </test>
</case>

<case>
  <desc>makevalid/mulilinestring/case1</desc>
  <a>MULTILINESTRING((0 0,0 0),(1 1,2 2))</a>
  <test>
    <op name="makevalid" arg1="a">
        GEOMETRYCOLLECTION (LINESTRING (1.0 1.0, 2.0 2.0), POINT (0.0 0.0))
    </op>
  </test>
</case>

<case>
  <desc>makevalid/mulilinestring/case2</desc>
  <a>MULTILINESTRING((0 0,0 0),(1 1,2 2),(2 2,3 3))</a>
  <test>
    <op name="makevalid" arg1="a">
        GEOMETRYCOLLECTION (MULTILINESTRING ((2.0 2.0, 3.0 3.0), (1.0 1.0, 2.0 2.0)), POINT (0.0 0.0))
    </op>
  </test>
</case>

<case>
  <desc>makevalid/mulilinestring/case2</desc>
  <a>MULTILINESTRING((0 0,0 0),(1 1,2 2),(2 2,3 3),(4 4,4 4))</a>
  <test>
    <op name="makevalid" arg1="a">
        GEOMETRYCOLLECTION (MULTILINESTRING ((2.0 2.0, 3.0 3.0), (1.0 1.0, 2.0 2.0)), MULTIPOINT (4.0 4.0, 0.0 0.0))
    </op>
  </test>
</case>

<case>
  <desc>makevalid/polygon/already_valid</desc>
  <a>POLYGON((0 0,0 1,1 1,0 0))</a>
  <test>
    <op name="makevalid" arg1="a">
        POLYGON((0 0,0 1,1 1,0 0))
    </op>
  </test>
</case>

<case>
  <desc>makevalid/polygon/crossing</desc>
  <a>POLYGON((0 0,1 1,0 1,1 0,0 0))</a>
  <test>
    <op name="makevalid" arg1="a">
        MULTIPOLYGON (((0.0 1.0, 1.0 1.0, 0.5 0.5, 0.0 1.0)), ((0.0 0.0, 0.5 0.5, 1.0 0.0, 0.0 0.0)))
    </op>
  </test>
</case>

<case>
  <desc>makevalid/polygon/hole_touching_two_places</desc>
  <a>POLYGON((0 0,0 1,1 1,1 0,0 0),(0 0.5,0.5 0.1,1 0.5,0 0.5))</a>
  <test>
    <op name="makevalid" arg1="a">
        MULTIPOLYGON (((0.0 0.0, 0.0 0.5, 0.5 0.1, 1.0 0.5, 1.0 0.0, 0.0 0.0)), ((0.0 0.5, 0.0 1.0, 1.0 1.0, 1.0 0.5, 0.0 0.5)))
    </op>
  </test>
</case>


<!-- not completely sure I would expect this result -->
<case>
  <desc>makevalid/multipolygon/second_part_overlapping</desc>
  <a>MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)),((0.8 0.1,2 0.1,2 0.9,0.8 0.9,0.8 0.1)))</a>
  <test>
    <op name="makevalid" arg1="a">
        MULTIPOLYGON (((0.0 0.0, 0.0 1.0, 1.0 1.0, 1.0 0.9, 0.8 0.9, 0.8 0.1, 1.0 0.1, 1.0 0.0, 0.0 0.0)), ((1.0 0.1, 1.0 0.9, 2.0 0.9, 2.0 0.1, 1.0 0.1)))
    </op>
  </test>
</case>


<case>
  <desc>makevalid/multipolygon/first_part_crossing_second_part_overlapping</desc>
  <a>MULTIPOLYGON(((0 0,1 1,0 1,1 0,0 0)),((0.8 0.1,2 0.1,2 0.9,0.8 0.9,0.8 0.1)))</a>
  <test>
    <op name="makevalid" arg1="a">
        GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0.5 0.5,0.8 0.2,0.8 0.8,0.9 0.9,2 0.9,2 0.1,0.9 0.1,1 0,0 0)),((0 1,1 1,0.9 0.9,0.8 0.9,0.8 0.8,0.5 0.5,0 1))),MULTILINESTRING((0.8 0.1,0.9 0.1),(0.8 0.1,0.8 0.2)))
    </op>
  </test>
</case>

<case>
    <desc>makevalid/geometry_collection</desc>
  <a>GEOMETRYCOLLECTION(POINT EMPTY,LINESTRING EMPTY,POLYGON((0 0,0 1,1 1,1 0,0 0),(0 0.5,0.5 0.1,1 0.5,0 0.5)))</a>
  <test>
    <op name="makevalid" arg1="a">
        GEOMETRYCOLLECTION (MULTIPOLYGON (((0.0 0.0, 0.0 0.5, 0.5 0.1, 1.0 0.5, 1.0 0.0, 0.0 0.0)), ((0.0 0.5, 0.0 1.0, 1.0 1.0, 1.0 0.5, 0.0 0.5))),LINESTRING EMPTY, POINT EMPTY)
    </op>
  </test>
</case>

</run>
