Search code examples
androidpoint-in-polygon

Point in polygon algortim using location class in android?


I've a a set of location that forms a closed path (similar to polygon). Is there any possible way to check if a certain latitude and longitude is inside the closed path?


Solution

  • You need a ray-casting algorithm. Good for you that someone already did this: ;-)

    Point in Polygon Algorithm

    And for a little background knowledge:

    https://en.wikipedia.org/wiki/Point_in_polygon