<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    The DE-9IM model isn't designed to be able to distinguish between
    these two cases, so there's no way to compute this by using any of
    the named predicates, or even a custom relate matrix.  <br>
    <br>
    You could do this via some fairly straightforward custom code.  The
    algorithm is:<br>
    -  identify vertices in each linestring which are coincident<br>
    - build a simple "local topology" for the 4 incident line segments
    at each intersection<br>
    - examine the intersection to see if the segments alternate or are
    adjacent (you can do this by using the angles of the segments)<br>
    <br>
    On 5/30/2012 3:40 AM, Jasmin FORMONT wrote:
    <blockquote
cite="mid:4DDD462E988B52488DA728A04EF7C57454DEFDADC3@Eucles.Siradel.local"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 12 (filtered
        medium)">
      <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
      <div class="Section1">
        <p class="MsoNormal"><span lang="EN-US">Hi everyone<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">I can’t find a way to
            tell if two linestrings “really” cross each other.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">For instance if I have
            this linestring :<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Line1 : LINESTRING(0 0,
            1 1, 2 0)<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">How can I differentiate
            the relation of line 1 with one of the following :<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Line2 : LINESTRING(0 2,
            1 1, 2 2)    -> no “real” cross, just a contact point<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Line3 : LINESTRING(0 2,
            1 1, 1 0)    -> lines “really” cross each other<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">I can’t find a good
            combination of crosses, touches, etc… to differentiate these
            cases.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <br>
      </div>
    </blockquote>
  </body>
</html>