Modify

Opened 4 months ago

Closed 3 months ago

Last modified 3 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:

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;
}

Attachments (0)

Change History (2)

comment:2 Changed 3 months ago by awulkiew

Milestone: To Be DeterminedBoost 1.65.0

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Barend Gehrels.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.