Re: [Boost-bugs] [Boost C++ Libraries] #13179: geometry::covered_by and geometry::within not working for certain values

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #13179: geometry::covered_by and geometry::within not working for certain values
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-06-12 20:09:08


#13179: geometry::covered_by and geometry::within not working for certain values
-------------------------------------------+----------------------------
  Reporter: Stanley <stanley.foerster@…> | Owner: Barend Gehrels
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: geometry
   Version: Boost 1.65.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------------------+----------------------------

Comment (by anonymous):

 Replying to [ticket:13179 Stanley <stanley.foerster@…>]:
> ''covered_by'' and ''within'' return false even if the point is
 obviously located within the polygon, as the following code demonstrates:
>
> {{{
> #!c++
> #include <iostream>
>
> #include <boost/version.hpp>
>
> #include <boost/geometry.hpp>
> #include <boost/geometry/geometries/point_xy.hpp>
> #include <boost/geometry/geometries/polygon.hpp>
>
> typedef boost::geometry::model::d2::point_xy<double> Point;
> typedef boost::geometry::model::polygon<Point> Polygon;
>
> int main() {
> std::cout << "Running Boost in version " << BOOST_VERSION <<
 std::endl;
>
> Polygon polygon;
> std::vector<Point> points;
>
> points.emplace_back(Point(68.3, 35.5));
> points.emplace_back(Point(68.3, 35.6));
> points.emplace_back(Point(70.3, 35.9));
> points.emplace_back(Point(70.3, 35.8));
> Point point(69.2, 35.7);
>
> boost::geometry::assign_points(polygon, points);
>
> std::cout << "Point is covered by polygon: " <<
 boost::geometry::covered_by(point, polygon) << std::endl;
> std::cout << "Point is within by polygon: " <<
 boost::geometry::within(point, polygon) << std::endl;
>
> return 0;
> }
> }}}
>
> which gives:
>
> {{{
> Running Boost in version 106500
> Point is covered by polygon: 0
> Point is within by polygon: 0
> }}}
 Did you ever find a work around for this? I'm testing the boost rtree,
 and it appears that "remove" is not properly drilling down because of the
 geometry::covered_by.. so even in boost version 1.67 (the latest), I'm
 stuck using my custom r-tree as boost does not remove all values. NOTE
 the intersection tests always work (so it seems anyways), as its simply I
 cannot remove certain values out of the rtree, and my guess is its related
 to this bug here that you documented.

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13179#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2018-06-12 20:14:45 UTC