Skip to content

hopeonesource/polygon_filter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

polygon_filter

A simple library which filters an array of geo locations based on their existence inside a given polygon.

Use Case:

const { inside, outside } = pointsInPoly({ locations, polygon });

Inputs

  • locations
  • polygon

points

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.

polygon

An array of point objects.

Outputs

  • 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.

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%