[Geowanking] Simple formula for calculating if points are included in an irregularly-shaped polygon Open Layers w/ Open Street Map?

William J. Spat wspat at ioto.ca
Wed Sep 16 07:23:47 PDT 2009


I wanted to pick the collective, dissociated geowanking brain on a problem
that has me stumped.

I need to set a region in Open Layers using Open Street Map, and then
automatically determine if a given point falls within that region.

I've come up with a simple formula that works with a quadrilateral-shaped
boxed region, but some possible regions are more complicated than that,
having more than four sides and not being exactly box shaped.

Does anyone have any suggestions for a more robust formula that would work
for a greater range of region shapes?  Or a clever work-around?

Thanks in advance,

Will




More information about the Geowanking mailing list