How to verify if point of coordinates is inside polygon [Javascript] — boobo94

These days I had to implement a new feature working for RideSplash. Because we handle a lot of requests that involve geolocation operations I had to add a new functionality that on MongoDB responds in 3s. After implementing this logic on the server with the code attached bellow, the response time was ~300ms

/**
* Verify if point of coordinates (longitude, latitude) is polygon of coordinates
* https://github.com/substack/point-in-polygon/blob/master/index.js
* @param {number} latitude Latitude
*

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store