Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#9628 closed Bugs (fixed)

boost.geometry.within - not working for point in polygon

Reported by: adrian_brutus@… Owned by: awulkiew
Milestone: Boost 1.56.0 Component: geometry
Version: Boost 1.55.0 Severity: Showstopper
Keywords: Cc:

Description

If the point that is tested with within function is aligned with the first segment of the polygon the function fails..

   typedef boost::geometry::model::d2::point_xy<double> BoostPoint2d;
   typedef boost::geometry::model::polygon< BoostPoint2d > BoostPolygon2d;

   BoostPolygon2d oBoostPolygon2d;
   // Plygon points
//       -19155.669324773193,54820.312032458620
//       -13826.169324773080,54820.312032458627
//       -13826.169324773078,52720.312032458663
//       -12755.169324773129,52720.312032458663
//       -12755.169324773129,51087.312032458671
//       -12760.669324773080,51087.312032458671
//       -12760.669324773082,51070.312032458627
//       -19155.669324779392,51070.312032458620
//       -19155.669324773193,54820.312032458620

   boost::geometry::correct( oBoostPolygon2d );

   BoostPoint2d oPoint( -12260.669324773118, 54820.312032458634 );

   bool bWithin = boost::geometry::within( oPoint, oBoostPolygon2d );
   assert( bWithin == false );

This bug was reproduced with version 1.49 and 1.55 (maybe also with other versions...)

Change History (3)

comment:1 by awulkiew, 8 years ago

Owner: changed from Barend Gehrels to awulkiew
Status: newassigned

It also fails for this, simplified case:

ring r;
r.push_back(pt(-14155.6,54820.312032458620));
r.push_back(pt(-13826.1,54820.312032458625));
r.push_back(pt(-12155.6,53720.3));
r.push_back(pt(-14155.6,54820.312032458620));

pt p( -13826.0, 54820.312032458634 );

Fixing progress: https://github.com/boostorg/geometry/pull/95

comment:2 by awulkiew, 8 years ago

Resolution: fixed
Status: assignedclosed

Fixed in develop branch

comment:3 by awulkiew, 8 years ago

Milestone: To Be DeterminedBoost 1.56.0
Note: See TracTickets for help on using tickets.