[postgis-users] Problem : Within() incorrectly returns 'false'

Mark Leslie mark at refractions.net
Wed Jan 10 16:48:11 PST 2007


Arnaud,
I've managed to track down the bug.  It seems that the algorithm
determines any point to be within a zero length segment, which your
polygon had a pair of.
I've made the fix and committed it.
Mark

Arnaud Lesauvage wrote:
> Paul Ramsey a écrit :
>> If this is a recent PostGIS, it's possible that our point-in-polygon
>> short-circuit test is returning a wrong answer, while the other tests
>> (distance, intersection) are independently returning the right answer.
>> Incidentally, what is the result of a relate(point,polygon)?
> 
> relate(point,polygon) = "0FFFFF212", so this is correct, right ?
> relate(pt, pg, 'T*F**F***') also returns true, so I think you got it
> right with the short-circuit being the source of the problem.
> 
> -- 
> Arnaud
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list