A simple library which filters an array of geo locations based on their existence inside a given polygon.
const { inside, outside } = pointsInPoly({ locations, polygon });
locationspolygon
A single point object:
{
latitude: 38.899897,
longitude: -77.026484
}
A location object:
{
id: <locationId>
latitude: 38.899897,
longitude: -77.026484
}
points is an array of the location objects shown above.
An array of point objects.
inside- locationIds of points that are inside the polygon, including the points which overlaps with one of the edges of the polygon.outside- locationIds of points that are outside the polygon.