Problem: Turfjs works well for client-side but I wanted to use it in server-sideRecently I had to check if a point lies inside of the polygon. Mysql provides way(ST_Contains and some other ways) to check if a point lies in a polygon.
I found turf.js was able to do this properly:Here’s I have used this with mapbox Here’s what I did to convert this code in php:- I manually wrote all the turf function I was using.
Note:You will have to manually edit some generated code and If you try to convert whole turf index.js sometimes it generates error