Opened 5 years ago

Closed 5 years ago

Last modified 5 years 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:

Description

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 by awulkiew, 5 years ago

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