Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#255 closed defect (fixed)

Geodetic point-in-polygon breaking case

Reported by: pramsey Owned by: pramsey
Priority: medium Milestone: PostGIS 1.5.0
Component: postgis Version: master
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 (7)

comment:1 by pramsey, 14 years ago

Milestone: PostGIS 1.5.0PostGIS Future

This is v. low probability, deferring.

comment:2 by pramsey, 14 years ago

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

comment:3 by mcayland, 14 years ago

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.

comment:4 by nicklas, 14 years ago

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

comment:5 by pramsey, 14 years ago

Resolution: fixed
Status: newclosed

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

comment:6 by pramsey, 14 years ago

Milestone: PostGIS FuturePostGIS 1.5.0

comment:7 by pramsey, 14 years ago

See also #314.

Note: See TracTickets for help on using tickets.