My question is, will the code given in http://pietschsoft.com/post/2008/07/Virtual-Earth-Polygon-Search-Is-Point-Within-Polygon.aspx work to find a point in one of areas mentioned in below file (page 7-9): http://www.weather.gov/directives/sym/pd01008006curr.pdf looking forward,
A:
A point-in-polygon algorithm usually just counts the number of times it crosses a line by "drawing" one out in any particular direction. It would then know if it's in the polygon or not by knowing how many times it crossed that line (even number it was outside, odd number it is inside). The code on that site looks like it just flips a boolean instead of adding to a counter but it's the same thing.
I must confess I have not read the PDF you linked too (too long!) but I've not come across an instance where the algorithm fails.
One tip might be to draw a rough square around the outermost extremeties of the polygon first and check whether it falls within that to avoid having to test each point).
Valerion
2009-06-09 14:23:44
Hello Valerion!thank you for your quick reply, you dont need to go through the whole pdf document, just go to page number 9 directly, you will see some stereographic projected areas, my question is just will this code be okay to use for that areas to check if a point is within any one of these areashttp://www.weather.gov/directives/sym/pd01008006curr.pdf go to page 9 of this document,
2009-06-09 14:35:49
Ok those are some large areas! Checking within a rectangle should be dead simple, but obviously the whole curvature-of-the-earth thing is maybe a bigger issue here.
Valerion
2009-06-09 16:23:23
Thank you Valerion, Yes exactly, you are right , Then in your opinion what could be the good solution to check if a particular point exists within any one of these these areas?looking forward
2009-06-16 15:21:12