<run>

<case>
  <desc>LL - disjoint, non-overlapping envelopes</desc>
  <a>
    LINESTRING(60 0, 20 80, 100 80, 80 120, 40 140)
  </a>
  <b>
    LINESTRING(140 300, 220 160, 260 200, 240 260)
  </b>
<test>
  <op name="relate" arg3="FF1FF0102" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - disjoint, overlapping envelopes</desc>
  <a>
    LINESTRING(60 0, 20 80, 100 80, 80 120, 40 140)
  </a>
  <b>
    LINESTRING(60 40, 140 40, 140 160, 0 160)
  </b>
<test>
  <op name="relate" arg3="FF1FF0102" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - disjoint, non-overlapping envelopes, B closed</desc>
  <a>
    LINESTRING(60 0, 20 80, 100 80, 80 120, 40 140)
  </a>
  <b>
    LINESTRING(140 280, 240 280, 240 180, 140 180, 140 280)
  </b>
<test>
  <op name="relate" arg3="FF1FF01F2" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - disjoint, overlapping envelopes, B closed</desc>
  <a>
    LINESTRING(140 0, 0 0, 40 60, 0 120, 60 200, 220 160, 220 40)
  </a>
  <b>
    LINESTRING(80 140, 180 100, 160 40, 100 40, 60 100, 80 140)
  </b>
<test>
  <op name="relate" arg3="FF1FF01F2" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>Line vs line - pointwise equal</desc>
  <a>
    LINESTRING(20 20, 80 80)
  </a>
  <b>
    LINESTRING(20 20, 80 80)
  </b>
<test>
  <op name="relate" arg3="1FFF0FFF2" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>Line vs line - pointwise equal</desc>
  <a>
    LINESTRING(40 40, 160 160, 200 60, 60 140)
  </a>
  <b>
    LINESTRING(40 40, 160 160, 200 60, 60 140)
  </b>
<test>
  <op name="relate" arg3="1FFF0FFF2" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>Line vs line - topologically equal</desc>
  <a>
    LINESTRING(40 40, 200 40)
  </a>
  <b>
    LINESTRING(200 40, 140 40, 40 40)
  </b>
<test>
  <op name="relate" arg3="1FFF0FFF2" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - topographically equal with self-intersection</desc>
  <a>
    LINESTRING(0 0, 110 0, 60 0)
  </a>
  <b>
    LINESTRING(0 0, 110 0)
  </b>
<test>
  <op name="relate" arg3="10F00FFF2" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LmL - topographically equal with no boundary</desc>
  <a>
    LINESTRING(0 0, 0 50, 50 50, 50 0, 0 0)
  </a>
  <b>
    MULTILINESTRING(
      (0 0, 0 50), 
      (0 50, 50 50), 
      (50 50, 50 0), 
      (50 0, 0 0))
  </b>
<test>
  <op name="relate" arg3="1FFFFFFF2" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LmL - topographically equal with self intersections</desc>
  <a>
    LINESTRING(0 0, 80 0, 80 60, 80 0, 170 0)
  </a>
  <b>
    MULTILINESTRING(
      (0 0, 170 0), 
      (80 0, 80 60))
  </b>
<test>
  <op name="relate" arg3="10FF0FFF2" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - A-IntNV = B-IntNV</desc>
  <a>
    LINESTRING(80 100, 180 200)
  </a>
  <b>
    LINESTRING(80 180, 180 120)
  </b>
<test>
  <op name="relate" arg3="0F1FF0102" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>intersect in Int NV</desc>
  <a>
    LINESTRING(40 40, 100 100, 160 160)
  </a>
  <b>
    LINESTRING(160 60, 100 100, 60 140)
  </b>
<test>
  <op name="relate" arg3="0F1FF0102" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - intersection: {A-Bdy, A-IntV} = B-IntNV</desc>
  <a>
    LINESTRING(40 40, 100 100, 180 100, 180 180, 100 180, 100 100)
  </a>
  <b>
    LINESTRING(140 60, 60 140)
  </b>
<test>
  <op name="relate" arg3="FF10F0102" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - intersection: {A-Bdy, A-IntNV} = B-IntNV</desc>
  <a>
    LINESTRING(40 40, 180 180, 100 180, 100 100)
  </a>
  <b>
    LINESTRING(140 60, 60 140)
  </b>
<test>
  <op name="relate" arg3="FF10F0102" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - intersection: A-IntNV = {B-Bdy, B-IntNV}</desc>
  <a>
    LINESTRING(20 110, 200 110)
  </a>
  <b>
    LINESTRING(200 200, 20 20, 200 20, 110 110, 20 200, 110 200, 110 110)
  </b>
<test>
  <op name="relate" arg3="F01FF0102" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - one segment overlapping, one distinct</desc>
  <a>
    LINESTRING(80 90, 50 50, 0 0)
  </a>
  <b>
    LINESTRING(0 0, 100 100)
  </b>
<test>
  <op name="relate" arg3="1F1F00102" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - A contained in B</desc>
  <a>
    LINESTRING(40 140, 240 140)
  </a>
  <b>
    LINESTRING(40 140, 100 140, 80 80, 120 60, 100 140, 160 140, 160 100, 200 100, 160 140, 
    240 140)
  </b>
<test>
  <op name="relate" arg3="1FFF0F1F2" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - simple overlapping lines</desc>
  <a>
    LINESTRING(20 20, 100 20, 20 20)
  </a>
  <b>
    LINESTRING(60 20, 200 20)
  </b>
<test>
  <op name="relate" arg3="101FFF102" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
  <desc>LL - A-spiral, B-contained</desc>
  <a>
    LINESTRING(40 60, 180 60, 180 140, 100 140, 100 60, 220 60, 220 180, 80 180, 80 60, 
    280 60)
  </a>
  <b>
    LINESTRING(140 60, 180 60, 220 60, 260 60)
  </b>
<test>
  <op name="relate" arg3="101FF0FF2" arg1="A" arg2="B">
    true
  </op>
</test>
</case>

<case>
<desc>test for LinearRing point location bug</desc>
  <a>
    LINEARRING(0 0, 0 5, 5 5, 5 0, 0 0)
  </a>
  <b>
    LINESTRING( 2 2, 4 4)
  </b>
  <test>
    <op name="relate" arg1="A" arg2="B" arg3="FF1FFF102">true</op>
  </test>
</case>

<case>
<desc>LL - closed multiline / empty line</desc>
  <a>
    MULTILINESTRING ((0 0, 0 1), (0 1, 1 1, 1 0, 0 0))
  </a>
  <b>
    LINESTRING EMPTY
  </b>
  <test>
    <op name="relate" arg1="A" arg2="B" arg3="FF1FFFFF2">true</op>
  </test>
</case>

<case>
<desc>LL - test intersection node computation (see https://github.com/locationtech/jts/issues/396)</desc>
  <a>
    LINESTRING (1 0, 0 2, 0 0, 2 2)
  </a>
  <b>
    LINESTRING (0 0, 2 2)
  </b>
  <test>
    <op name="relate" arg1="A" arg2="B" arg3="101F00FF2">true</op>
  </test>
  <test><op name="contains"   arg1="A" arg2="B"> true  </op></test>
  <test><op name="coveredBy"  arg1="A" arg2="B"> false </op></test>
  <test><op name="covers"     arg1="A" arg2="B"> true  </op></test>
  <test><op name="crosses"    arg1="A" arg2="B"> false </op></test>
  <test><op name="disjoint"   arg1="A" arg2="B"> false </op></test>
  <test><op name="equalsTopo" arg1="A" arg2="B"> false </op></test>
  <test><op name="intersects" arg1="A" arg2="B"> true  </op></test>
  <test><op name="overlaps"   arg1="A" arg2="B"> false </op></test>
  <test><op name="touches"    arg1="A" arg2="B"> false </op></test>
  <test><op name="within"     arg1="A" arg2="B"> false </op></test>
</case>

<case>
<desc>LL - test intersection node computation (see https://github.com/libgeos/geos/issues/933)</desc>
  <a>
    MULTILINESTRING ((0 0, 1 1), (0.5 0.5, 1 0.1, -1 0.1))
  </a>
  <b>
    LINESTRING (0 0, 1 1)
  </b>
  <test>
    <op name="relate" arg1="A" arg2="B" arg3="1F1000FF2">true</op>
  </test>
  <test><op name="contains"   arg1="A" arg2="B"> true  </op></test>
  <test><op name="coveredBy"  arg1="A" arg2="B"> false </op></test>
  <test><op name="covers"     arg1="A" arg2="B"> true  </op></test>
  <test><op name="crosses"    arg1="A" arg2="B"> false </op></test>
  <test><op name="disjoint"   arg1="A" arg2="B"> false </op></test>
  <test><op name="equalsTopo" arg1="A" arg2="B"> false </op></test>
  <test><op name="intersects" arg1="A" arg2="B"> true  </op></test>
  <test><op name="overlaps"   arg1="A" arg2="B"> false </op></test>
  <test><op name="touches"    arg1="A" arg2="B"> false </op></test>
  <test><op name="within"     arg1="A" arg2="B"> false </op></test>
</case>

</run>
