inside area

Abe Gillespie agillesp at VT.EDU
Sat Feb 5 18:03:49 EST 2005


Well I'm not sure if there is a PHP vector geometry library out there
somewhere ... but the general algorithm goes like this:

Create a line with one endpoint being the point in question, the other
endpoint outside the bounding box of the polygon.  Now test for
intersections of the created line and each line in the polygon.  If you
have and odd amount of intersections the point's inside; even amount of
intersections and the point's outside.

The above is true for complex polygons too (polygons with holes).

-Abe

On Feb 5, 2005, at 5:24 PM, joerg pfeiffer wrote:

> ehhhh, thanks for you answer, but I have to admit, I am posting a
> little
> bit off topic... I am asking for a non mapserver project this time,
> only
> php... so I have to build a function on my own...
>
> Joerg
>



More information about the mapserver-users mailing list