Opened 15 years ago

Closed 15 years ago

#314 closed defect (fixed)

Geographic point-in-polygon issue: stab line grazes vertex

Reported by: pramsey Owned by: pramsey
Priority: medium Milestone: PostGIS 1.5.0
Component: postgis Version: master
Keywords: Cc:

Description (last modified by pramsey)

While fixing the co-linear case (#255) I was reminded of another unhandled case. If the stab line grazes a vertex but does not actually cross, a crossing will still be counted.

http://trac.osgeo.org/postgis/browser/trunk/liblwgeom/cunit/cu_geodetic.c#L628

We could detect the condition and abort by running every test twice, with different stab lines.

Change History (2)

comment:1 by pramsey, 15 years ago

Description: modified (diff)

comment:2 by pramsey, 15 years ago

Milestone: PostGIS 2.0.0PostGIS 1.5.0
Resolution: fixed
Status: newclosed

Used Nicklas' suggestion to skip past end points on the stab line to fix both co-linear and grazing cases. Added a number more tests to confirm this approach and handled first-point-on-line case also. Code looks much nicer now, thanks Nicklas. r4872

Note: See TracTickets for help on using tickets.