polygon linestring intersection issue

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

polygon linestring intersection issue

sergei benkovich
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 mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
Reply | Threaded
Open this post in threaded view
|

Re: polygon linestring intersection issue

sergei benkovich
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 <[hidden email]> wrote:
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 mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry