Boost logo

Geometry :

Subject: [geometry] polygon linestring intersection issue
From: sergei benkovich (sergei1503_at_[hidden])
Date: 2016-06-23 09:53:33


Hey,
i'm trying to use bg::intersection to find the intersection between a line
segment and a polygon.
in some cases it works, but in others it doesn't.

there should be an intersection between these two geometries but i get
nothing in the result.
anyone knows of any issues regarding this type of intersections?

this is the test code i ran:

    bgPolygonType testPol;
    boost::geometry::read_wkt("POLYGON((1012 1621, 1013 1621, 1013 1622,
1012 1622, 1012 1621))", testPol);
    typedef bg::model::d2::point_xy<double, boost::geometry::cs::cartesian>
point_t;
    typedef bg::model::linestring<point_t> linestring_t;

    linestring_t ls;
    bg::append(ls, point_t(1011.4, 1621.64));
    bg::append(ls, point_t(1013.6, 1623.68));

    std::vector<point_t> res;
    bg::intersection(testPol, ls, res);

thanks
Sergei



Geometry list run by mateusz at loskot.net