[aprssig] filtering using shape files
Steve Dimse
steve at dimse.com
Sat Mar 10 16:12:08 CST 2007
On Mar 10, 2007, at 4:51 PM, Scott Miller wrote:
> I think you'd need to find a different solution for stream processing,
> though.
>
The algorithm is well known and it is easy to find code examples on
the internet. Distilled, the idea is to draw an imaginary line
segment between the point under test and an arbitrary distant point
(known to be outside the shape, e.g. the north pole), then check
mathematically to see if that imaginary line crosses each of the line
segments in the polygon under test. If the number of crossings is
odd, the point lies within the polygon. If the number of
intersections is zero or even, the point lies outside the polygon.
Steve K4HG
More information about the aprssig
mailing list