If you're using OpenLayers, you ought to be able to take advantage of the
"intersects" functionality of OL vectors.
So not sure what you mean by "set a region using OSM", but assuming you mean
create the polygon as an OpenLayers vector feature, then you can just do
something like
mypolygon.geometry.intersects(myopenlayerspointfeature.geometry) which will
return true/false.

See for example
http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Geometry/Polygon-js.html#OpenLayers.Geometry.Polygon.intersects

 -Josh


On Wed, Sep 16, 2009 at 7:23 AM, William J. Spat <[email protected]> wrote:

> 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
>
>
> _______________________________________________
> Geowanking mailing list
> [email protected]
> http://geowanking.org/mailman/listinfo/geowanking_geowanking.org
>
_______________________________________________
Geowanking mailing list
[email protected]
http://geowanking.org/mailman/listinfo/geowanking_geowanking.org

Reply via email to