Opened 20 months ago

Closed 19 months ago

Last modified 19 months ago

#13057 closed Bugs (fixed)

Wrong result in intersection of linestrings

Reported by: Vissarion Fisikopoulos <fisikop@…> Owned by: Barend Gehrels
Milestone: Boost 1.65.0 Component: geometry
Version: Boost 1.64.0 Severity: Problem
Keywords: Cc:


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;

Change History (2)

comment:2 Changed 19 months ago by awulkiew

Milestone: To Be DeterminedBoost 1.65.0
Note: See TracTickets for help on using tickets.