[Boost-bugs] [Boost C++ Libraries] #13057: Wrong result in intersection of linestrings

Subject: [Boost-bugs] [Boost C++ Libraries] #13057: Wrong result in intersection of linestrings
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-06-07 14:24:45


#13057: Wrong result in intersection of linestrings
------------------------------------------------+--------------------------
 Reporter: Vissarion Fisikopoulos <fisikop@…> | Owner:
                                                | barendgehrels
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
  Version: Boost 1.64.0 | Severity: Problem
 Keywords: |
------------------------------------------------+--------------------------
 The following piece of code returns wrong result for intersection of
 linestrings. In particular it returns false while the two linestrings have
 a common point.
 Produced on Ubuntu 14.04.3 with gcc 4.8.4

 {{{
 #include <iostream>
 #include <string>

 #include <boost/geometry.hpp>
 #include <boost/geometry/geometries/geometries.hpp>

 namespace bg = boost::geometry;

 int main()
 {
     typedef bg::model::point<double, 2,
             bg::cs::geographic<bg::radian> > point;

     typedef bg::model::linestring<point> linestring;

     linestring ls1, ls2;

     bg::read_wkt("LINESTRING(0
 -0.31415926535897897853,0.26179938779914918578 0,-0.034906585039886556254
 0.13962634015954622502,-0.12217304763960294689 0.12217304763960294689)",
 ls1);
     bg::read_wkt("LINESTRING(-0.034906585039886556254
 0.13962634015954622502,-0.26179938779914918578 0)", ls2);

     std::cout << bg::intersects(ls1, ls2) << std::endl;

     return 0;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/13057>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-06-07 14:28:26 UTC