<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin-top:0cm;
        margin-right:0cm;
        margin-bottom:10.0pt;
        margin-left:0cm;
        line-height:115%;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:10.0pt;
        margin-left:36.0pt;
        mso-add-space:auto;
        line-height:115%;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
        {mso-style-priority:34;
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        line-height:115%;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
        {mso-style-priority:34;
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        line-height:115%;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
        {mso-style-priority:34;
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:10.0pt;
        margin-left:36.0pt;
        mso-add-space:auto;
        line-height:115%;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></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]--></head><body lang=EN-IN link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>We are created polygon and line. After performing the intersection function we are getting different values. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>This is the sample code we have implemented using GEOS API (GEOS 3.7.2) .<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:black'>       </span><span lang=EN-US style='font-family:Consolas;color:black'>Rect = c1.createPolygon(10.78, 10.34, 18.89, 16.64);<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none'><span lang=EN-US style='font-family:Consolas;color:black'>      <o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none'><span lang=EN-US style='font-family:Consolas;color:black'>      line = c1.makeLine(</span><span lang=EN-US>10.78 , 12.34 ,18.89 , 12.34</span><span lang=EN-US style='font-family:Consolas;color:black'>);<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none'><span lang=EN-US style='font-family:Consolas;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas;color:black'>      point = Rect->intersection (line)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas;color:black'><o:p> </o:p></span></p><p class=MsoListParagraphCxSpFirst style='margin-left:0cm;mso-add-space:auto;text-align:justify;line-height:150%'><span lang=EN-US>1. If given line lies on the polygon we are getting the Expected result.<o:p></o:p></span></p><p class=MsoListParagraphCxSpMiddle style='margin-left:0cm;mso-add-space:auto;text-align:justify;line-height:150%'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraphCxSpLast style='margin-left:0cm;mso-add-space:auto;text-align:justify;line-height:150%'><b><span lang=EN-US style='font-family:Consolas;color:black'>Input</span></b><span lang=EN-US style='font-family:Consolas;color:black'>: Polygon(10.78, 10.34, 18.89, 16.64);</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><b><span lang=EN-US>Input:  </span></b><span lang=EN-US style='font-family:Consolas;color:black'>makeLine</span><span lang=EN-US> (10.78 , 12.34 ,18.89 , 12.34)<o:p></o:p></span></p><p class=MsoNormal><b><span lang=EN-US>Current  Output from </span></b><b><span lang=EN-US style='font-family:Consolas;color:black'>intersection API</span><span lang=EN-US> :</span></b><span lang=EN-US>  (10.78 , 12.34) (18.89 , 12.34)<o:p></o:p></span></p><p class=MsoNormal><b><span lang=EN-US>Expected Output :  </span></b><span lang=EN-US>(10.78 , 12.34) (18.89 , 12.34)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph style='margin-left:0cm;mso-add-space:auto'><span lang=EN-US style='color:black'>2.  </span><span lang=EN-US>If given line lies away the polygon we are getting the different result.<o:p></o:p></span></p><p class=MsoNormal><b><span lang=EN-US>Input:</span></b><span lang=EN-US>  </span><span lang=EN-US style='font-family:Consolas;color:black'>makeLine</span><span lang=EN-US> (8.78 , 12.34 ,20.89 , 12.34)<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:0cm;mso-add-space:auto'><b><span lang=EN-US>Current  Output from </span></b><b><span lang=EN-US style='font-family:Consolas;color:black'>intersection API</span><span lang=EN-US>:</span></b><span lang=EN-US>    <span style='background:yellow;mso-highlight:yellow'>(11 , 12.3.4) (19 , 12.34)</span><o:p></o:p></span></p><p class=MsoNormal><b><span lang=EN-US>Expected Output :  </span></b><span lang=EN-US>(10.78 , 12.34) (18.89 , 12.34)<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>Can you please suggest why this behaviour diffrence is there in API output.<o:p></o:p></span></p><p class=MsoNormal>Please let me know any additional information needed from my side.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal>Ritesh<o:p></o:p></p></div></body></html>