Opened 4 years ago

Closed 13 months ago

#9162 closed Bugs (fixed)

intersects returns incorrect result in spherical equatorial

Reported by: hujie.eagle@… Owned by: barendgehrels
Milestone: Boost 1.61.0 Component: geometry
Version: Boost 1.54.0 Severity: Problem
Keywords: within, intersects, spherical Cc:



The intersects does not return the correct result for point in polygon with spherical equatorial. These are two cases:

  1. a polygon with pole (north/south) in it

assume polygon PL: POLYGON((0 80,-90 80, -180 80, 90 80, 0 80)) a point P: POINT(0 90)

boost::geometry::intersects(P, PL)

should return TRUE, but return false in boost 1.54.

  1. point in the opposite side of the polygon

assume polygon PL: POLYGON((30 0,30 30,90 30, 90 0, 30 0)) a point P: POINT(-120 21)

boost::geometry::intersects(P, PL)

should return FALSE, but return true in boost 1.54.

The issue may be caused by the spherical_side_formula can not handle this two cases.

Attachment is the test case for these two issues.

Attachments (1)

intersectstest.cpp (899 bytes) - added by anonymous 4 years ago.
Sample test

Download all attachments as: .zip

Change History (2)

Changed 4 years ago by anonymous

Sample test

comment:1 Changed 13 months ago by awulkiew

  • Keywords within intersects spherical added
  • Milestone changed from To Be Determined to Boost 1.61.0
  • Resolution set to fixed
  • Status changed from new to closed

Thanks! The bug was located in winding strategy which was "scanning" segments using the second coordinate (latitude). In cartesian CS this is ok but in spherical and geographic it isn't. Fixed in Boost 1.61.

Last edited 13 months ago by awulkiew (previous) (diff)

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain barendgehrels.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.