[mapserver-users] Point inside or outside polygon???

Jan Hartmann jhart at frw.uva.nl
Thu Aug 1 03:30:39 PDT 2002


Steve Lime wrote:
>  You can use a point query against the mapinfo data using the normal
>  query or nquery modes. One thing to be aware of it that MapServer's
>  point in polygon routine works fine if the point in question is strictly
>  in/out of the polygon. It's indeterminate if the point is exactly on the
>  edge.

Any reason why this should be so? I saw a function msPointInPolygon() in
mapsearch.c, which looked like an optimized version of the classical
point-in-polygon algorithm (draw a horizontal line from the point and count
the intersections with the polygon. If odd, point is within polygon). Why
should the result be indeterminate if the point lies on an edge?

Jan Hartmann




More information about the MapServer-users mailing list