Ticket #255 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

Geodetic point-in-polygon breaking case

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

Description

If the stab line used for point-in-polygon calculation intersects a parallel edge on the way out of the polygon, it will trigger a double count, and will end up returning the wrong result.

Change History

Changed 4 years ago by pramsey

  • milestone changed from PostGIS 1.5.0 to PostGIS Future

This is v. low probability, deferring.

Changed 4 years ago by pramsey

As a task, should generate a test case that actually exercises this.

Changed 4 years ago by mcayland

Are you sure that this is low probability? It would be bad for people to blindly receive wrong answers - is there any way you can at least detect this condition and throw a warning/error?

ATB,

Mark.

Changed 4 years ago by nicklas

I'm not sure I understand this right but if I do, wouldn't it be a solution to do like this:

detect the fenomena; if this stabline intersects a paralell edge then the start and end of that edge have to be on the stabline too. So if both start and end intersects then the alarm should go.

then when we know it has happened, in't it possible to just give the stabline a new direction and give it a new try?

I haven't studied the code and have just understood the pricip of the process from your comments Paul, so if I missunderstand it all, I hope the world will continue rotating anyway.

/Nicklas

Changed 3 years ago by pramsey

  • status changed from new to closed
  • resolution set to fixed

OK, I've committed a fix for this, but it has raised again for me just how delicate my testing of edge intersection is (I keep jiggling the tolerance for the test tighter and looser around a sweet spot, it is *not* numerically robust, and eventually we'll find a case which doesn't work within the tolerance ranges required by all the other unit tests (thank goodness for unit tests).

r4865

Changed 3 years ago by pramsey

  • milestone changed from PostGIS Future to PostGIS 1.5.0

Changed 3 years ago by pramsey

See also #314.

Note: See TracTickets for help on using tickets.