Opened 8 years ago
Closed 8 years ago
#10643 closed Bugs (fixed)
point_on_surface bug, computed point isn't on the surface of polygon
| Reported by: | Owned by: | Barend Gehrels | |
|---|---|---|---|
| Milestone: | Boost 1.57.0 | Component: | geometry |
| Version: | Boost 1.56.0 | Severity: | Problem |
| Keywords: | Cc: |
Description
The attached test program demonstrates this bug.
Change History (2)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
| Milestone: | To Be Determined → Boost 1.57.0 |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

I do not have permission to add attachments. Code is below in this comment.
#include <boost/geometry.hpp> #include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/polygon.hpp> #include <assert.h> void test_point_on_surface() { typedef boost::geometry::model::point<double, 2, boost::geometry::cs::cartesian> Point; boost::geometry::model::polygon<Point> poly; boost::geometry::read_wkt("POLYGON((1074699.93 703064.65, 1074702.10 703054.62, 1074704.53 703061.40, 1074703.90 703064.58, 1074699.93 703064.65))",poly); boost::geometry::correct(poly); Point point; boost::geometry::point_on_surface(poly,point); //computed point isn't on the surface of polygon //[0] 1074839.1013086310 double //[1] 703154.77900308778 double bool res = boost::geometry::within(point,poly); assert(res==true); // res is false :-( } int main(int argc, char* argv[]) { test_point_on_surface(); return 0; }