<run>
  <precisionModel type="FLOATING" />

  <case>
    <desc>P - single point</desc>
    <a>
POINT (10 10)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='10.0'>
POINT (10 10)
      </op>
    </test>
  </case>

  <case>
    <desc>P - empty point</desc>
    <a>
POINT EMPTY
    </a>
    <test>
      <op name="densify" arg1='A' arg2='10.0'>
POINT EMPTY
      </op>
    </test>
  </case>

  <case>
    <desc>mP - multi point</desc>
    <a>
MULTIPOINT ((10 10), (20 10))
    </a>
    <test>
      <op name="densify" arg1='A' arg2='10.0'>
MULTIPOINT ((10 10), (20 10))
      </op>
    </test>
  </case>

  <case>
    <desc>L - empty line</desc>
    <a>
LINESTRING EMPTY
    </a>
    <test>
      <op name="densify" arg1='A' arg2='10.0'>
LINESTRING EMPTY
      </op>
    </test>
  </case>

  <case>
    <desc>L - single segment with length equal to densify tolerance</desc>
    <a>
LINESTRING(10 10, 20 10)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='10.0'>
LINESTRING(10 10, 20 10)
      </op>
    </test>
  </case>

  <case>
    <desc>L - single segment with length less than densify tolerance</desc>
    <a>
LINESTRING(10 10, 15 10)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='10.0'>
LINESTRING(10 10, 15 10)
      </op>
    </test>
  </case>

  <case>
    <desc>L - single segment with length greater than densify tolerance</desc>
    <a>LINESTRING(10 10, 100 10)</a>
    <test>
      <op name="densify" arg1='A' arg2='10.0'>
	LINESTRING (10 10, 20 10, 30 10, 40 10, 50 10, 60 10, 70 10, 80 10, 90 10, 100 10)
      </op>
    </test>
  </case>

  <case>
    <desc>L - single segment with non-integer tolerance, result is evenly subdivided</desc>
    <a>LINESTRING (0 0, 0 6 )</a>
    <test>
      <op name="densify" arg1='A' arg2='2.999999'>
LINESTRING (0 0, 0 2, 0 4, 0 6)
      </op>
    </test>
  </case>

  <case>
    <desc>L - empty linear ring</desc>
    <a>LINEARRING EMPTY</a>
    <test>
      <op name="densify" arg1='A' arg2='6'>
LINEARRING EMPTY
      </op>
    </test>
  </case>

  <case>
    <desc>L - linear ring with segment lengths equal to densify tolerance</desc>
    <a>
LINEARRING (0 0, 0 6, 6 6, 6 0, 0 0)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='6'>
LINEARRING (0 0, 0 6, 6 6, 6 0, 0 0)
      </op>
    </test>
  </case>

  <case>
    <desc>L - linear ring with segment lengths equal to densify tolerance</desc>
    <a>
LINEARRING (0 0, 0 6, 6 6, 6 0, 0 0)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='6'>
LINEARRING (0 0, 0 6, 6 6, 6 0, 0 0)
      </op>
    </test>
  </case>

  <case>
    <desc>L - linear ring with segment lengths greater than densify tolerance</desc>
    <a>
LINEARRING (0 0, 0 6, 6 6, 6 0, 0 0)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='3'>
LINEARRING (0 0, 0 3, 0 6, 3 6, 6 6, 6 3, 6 0, 3 0, 0 0)
      </op>
    </test>
  </case>

  <case>
    <desc>L - linear ring with non-integer tolerance, result is evenly subdivided</desc>
    <a>
LINEARRING (0 0, 0 6, 6 6, 6 0, 0 0)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='2.999999'>
LINEARRING (0 0, 0 2, 0 4, 0 6, 2 6, 4 6, 6 6, 6 4, 6 2, 6 0, 4 0, 2 0, 0 0)
      </op>
    </test>
  </case>

  <case>
    <desc>mL - multiple lines with segment lengths equal to densify tolerance</desc>
    <a>
MULTILINESTRING ((0 0, 10 0), (20 0, 20 10))
    </a>
    <test>
      <op name="densify" arg1='A' arg2='10.0'>
MULTILINESTRING ((0 0, 10 0), (20 0, 20 10))
      </op>
    </test>
  </case>

  <case>
    <desc>mL - multiple lines with segment lengths greater than densify tolerance</desc>
    <a>
MULTILINESTRING ((0 0, 10 0), (20 0, 20 10))
    </a>
    <test>
      <op name="densify" arg1='A' arg2='5.0'>
MULTILINESTRING ((0 0, 5 0, 10 0), (20 0, 20 5, 20 10))
      </op>
    </test>
  </case>

  <case>
    <desc>mL - multiple lines with non-integer tolerance, result is evenly subdivided</desc>
    <a>
MULTILINESTRING ((0 0, 10 0), (20 0, 20 10))
    </a>
    <test>
      <op name="densify" arg1='A' arg2='2.999999'>
MULTILINESTRING ((20 0, 20 2.5, 20 5, 20 7.5, 20 10), (0 0, 2.5 0, 5 0, 7.5 0, 10 0))
      </op>
    </test>
  </case>

  <case>
    <desc>A - simple polygon with segment lengths equal to densify tolerance</desc>
    <a>
POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))
    </a>
    <test>
      <op name="densify" arg1='A' arg2='10.0'>
POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))
      </op>
    </test>
  </case>

  <case>
    <desc>A - simple polygon with segment lengths greater than densify tolerance</desc>
    <a>
POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))
    </a>
    <test>
      <op name="densify" arg1='A' arg2='5.0'>
POLYGON ((0 0, 0 5, 0 10, 5 10, 10 10, 10 5, 10 0, 5 0, 0 0))
      </op>
    </test>
  </case>

  <case>
    <desc>A - polygon with hole with segment lengths equal to densify tolerance</desc>
    <a>
POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0), (2 2, 2 8, 8 8, 8 2, 2 2))
    </a>
    <test>
      <op name="densify" arg1='A' arg2='10.0'>
POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0), (2 2, 2 8, 8 8, 8 2, 2 2))
      </op>
    </test>
  </case>

  <case>
    <desc>A - polygon with hole with segment lengths greater than densify tolerance</desc>
    <a>
POLYGON (
  (0 0, 0 10, 10 10, 10 0, 0 0),
  (2 2, 2 8, 8 8, 8 2, 2 2)
)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='5.0'>
POLYGON (
  (0 0, 0 5, 0 10, 5 10, 10 10, 10 5, 10 0, 5 0, 0 0),
  (2 2, 2 5, 2 8, 5 8, 8 8, 8 5, 8 2, 5 2, 2 2)
)
      </op>
    </test>
  </case>

  <case>
    <desc>A - polygon with hole with non-integer tolerance, result is evenly subdivided</desc>
    <a>
POLYGON (
  (0 0, 0 10, 10 10, 10 0, 0 0),
  (2 2, 2 8, 8 8, 8 2, 2 2)
)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='2.999999'>
POLYGON (
  (0 0, 0 2.5, 0 5, 0 7.5, 0 10, 2.5 10, 5 10, 7.5 10, 10 10, 10 7.5, 10 5, 10 2.5, 10 0, 7.5 0, 5 0, 2.5 0, 0 0),
  (2 2, 4 2, 6 2, 8 2, 8 4, 8 6, 8 8, 6 8, 4 8, 2 8, 2 6, 2 4, 2 2)
)
      </op>
    </test>
  </case>

  <case>
    <desc>mA - multipolygon with segment lengths equal to densify tolerance</desc>
    <a>
MULTIPOLYGON (
  ((0 0, 0 10, 10 10, 10 0, 0 0)),
  ((20 20, 20 30, 30 30, 30 20, 20 20))
)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='10.0'>
MULTIPOLYGON (
  ((0 0, 0 10, 10 10, 10 0, 0 0)),
  ((20 20, 20 30, 30 30, 30 20, 20 20))
)
      </op>
    </test>
  </case>

  <case>
    <desc>mA - multipolygon with segment lengths greater than densify tolerance</desc>
    <a>
MULTIPOLYGON (
  ((0 0, 0 10, 10 10, 10 0, 0 0)),
  ((20 20, 20 30, 30 30, 30 20, 20 20))
)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='5.0'>
MULTIPOLYGON (
  ((20 20, 20 25, 20 30, 25 30, 30 30, 30 25, 30 20, 25 20, 20 20)),
  ((0 0, 0 5, 0 10, 5 10, 10 10, 10 5, 10 0, 5 0, 0 0))
)
      </op>
    </test>
  </case>

  <case>
    <desc>mA - multipolygon with segment with non-integer tolerance, result is evenly subdivided</desc>
    <a>
MULTIPOLYGON (
  ((20 20, 20 30, 30 30, 30 20, 20 20)),
  ((0 0, 0 10, 10 10, 10 0, 0 0))
)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='2.999999'>
MULTIPOLYGON (
  ((20 20, 20 22.5, 20 25, 20 27.5, 20 30, 22.5 30, 25 30, 27.5 30, 30 30, 30 27.5, 30 25, 30 22.5, 30 20, 27.5 20, 25 20, 22.5 20, 20 20)),
  ((0 0, 0 2.5, 0 5, 0 7.5, 0 10, 2.5 10, 5 10, 7.5 10, 10 10, 10 7.5, 10 5, 10 2.5, 10 0, 7.5 0, 5 0, 2.5 0, 0 0))
)
      </op>
    </test>
  </case>

  <case>
    <desc>L - zero tolerance: exception</desc>
    <a>
LINESTRING(10 10, 20 10)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='0'>exception</op>
    </test>
  </case>

  <case>
    <desc>L - too small positive tolerance: exception</desc>
    <a>
LINESTRING(10 10, 20 10)
    </a>
    <test>
      <op name="densify" arg1='A' arg2='0.0000000000000001'>exception</op>
    </test>
  </case>

</run>
