Subject: [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: 2017-08-25 21:04:11
#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
Keywords: |
------------------------------------------+----------------------------
''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
}}}
-- Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13179> 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 : 2017-08-25 21:10:46 UTC