Hey Sorry for this there is no intersection here.was looking on in incorrect graph....

On Thu, Jun 23, 2016 at 4:53 PM, sergei benkovich <sergei1503@gmail.com> wrote:
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);