Boost logo

Geometry :

Subject: Re: [geometry] intersects( polygon, box )
From: alzi (aZiegenhagel_at_[hidden])
Date: 2012-06-01 11:14:22


Barend wrote
>
> Indeed that was expected to be impossible. Do you happen to
> have a piece of source code or WKT which illustrates this problem?
>

I tried the intersections described by Volker.
I used the following code:

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/geometries/point_xy.hpp>

int main(int argc, char *argv[])
{
    typedef boost::geometry::model::d2::point_xy<double> PointType;
        
    boost::geometry::model::polygon<PointType> A, B2;
    boost::geometry::model::box<PointType> B1(PointType(1941,2066),
PointType(2055,2166));

    boost::geometry::read_wkt("POLYGON((1992 3240,1992 1440,3792 1800,3792
3240))", A);
    boost::geometry::read_wkt("POLYGON((1941 2066,2055 2066,2055 2166,1941
2166))", B2);

    std::cout << boost::geometry::intersects( A, B1 ) << std::endl;
    std::cout << boost::geometry::intersects( A, B2 ) << std::endl;
}

The output should be 1 and 1 but it is 0 and 1.

Regards,
Albert

--
View this message in context: http://boost-geometry.203548.n3.nabble.com/intersects-polygon-box-tp3751095p4024998.html
Sent from the Boost Geometry mailing list archive at Nabble.com.

Geometry list run by mateusz at loskot.net