<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1276" name=GENERATOR>
<STYLE>@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=932484015-06052005>Kevin, 
List, strk:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=932484015-06052005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=932484015-06052005>I've 
made an enhancement to JTS (based on a suggestion by Kevin) which seems to solve 
the issue of computed intersection points lying outside the intersection of the 
segment envelopes.&nbsp; (This is simply one different function in 
RobustLineIntersector - it's an easy patch, strk).</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=932484015-06052005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=932484015-06052005>This 
still doesn't produce the ultimate desired result of computing intersections to 
the full 56 bits of double precision, however.&nbsp; We're working on a solution 
for that - will post it if and when it's done.&nbsp;</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=932484015-06052005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=932484015-06052005>Martin</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV align=center><FONT face=Arial size=2><STRONG>Martin Davis, Senior Technical 
Architect</STRONG><BR><STRONG><FONT color=#0000ff>Vivid Solutions 
Inc.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<I>www.vividsolutions.com</I></FONT></STRONG><BR></FONT><EM><FONT face=Arial 
size=2>Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5<BR>Phone: (250) 
385 6040 - Local 308 Fax: (250) 385 6046</FONT></EM></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT 
  face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> 
  geos-devel-bounces@geos.refractions.net 
  [mailto:geos-devel-bounces@geos.refractions.net] <B>On Behalf Of </B>Kevin 
  Wiebe<BR><B>Sent:</B> May 3, 2005 7:00 AM<BR><B>To:</B> 
  geos-devel@geos.refractions.net<BR><B>Subject:</B> [geos-devel] How robust is 
  GEOS?<BR><BR></FONT></DIV>
  <DIV class=Section1>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I&#8217;m asking for advice here:&nbsp; 
  What is the most robust (numerically stable) way to use GEOS?&nbsp; What are 
  its limitations?<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">For our purposes we need to use 
  code that is both as fast and accurate as possible.&nbsp; As you probably 
  know, when using a complex algorithm sometimes even small inaccuracies in 
  geometric computations can compound into drastically incorrect 
  results.<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Here is a concrete example from 
  real customer data:<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have created two simple 2-point 
  LINEs and used the GEOS call to get the spot where they 
  intersect:<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">point = 
  lineA.intersection(lineB);<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">lineA = from 
  (2089426.5233462777,1180182.3877339689) to 
  (2085646.6891757075,1195618.7333999649)<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">lineB = from 
  (1889281.8148903656,1997547.0560044837) to 
  (2259977.3672235999,483675.17050843034)<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">the intersection point I get back 
  is this:<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">point = 
  (2097408.2633752143,1144595.8008114607)<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This point is a significant 
  distance away from any part of lineA.&nbsp; If one were to place this 
  intersection point between the start and end points of lineA, the resulting 
  line would look ridiculous.<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">JTS returns the same 
  result.<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Depending on your explanations for 
  this I may have some technical advice.<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks for your 
  comments,<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">-Kevin-<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">----------------------------------------------------------------<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;Kevin 
  Wiebe&nbsp;&nbsp;&nbsp;&nbsp; Safe Software 
  Inc.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  kevin@safe.com<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Senior&nbsp;&nbsp;&nbsp;&nbsp; Surrey, BC, 
  CANADA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; phone: (604) 
  501-9985<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp; 
  Developer&nbsp;&nbsp;&nbsp;&nbsp; 
  http://www.safe.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fax: (604) 
  501-9965<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">----------------------------------------------------------------<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>