I have a PHP endpoint/service that receives Lat/Long data from a 3rd party. The data is then processed in PHP code and saved into a MySQL database. This process works fine without any issues.
I need to run some spatial queries against the data, like does the source point fall inside a polygon (polygon source is GeoJSON), what is the distance from the point to a line (line source is GeoJSON) and distance to the end of a line (following the line segments).
I found TurfJS can cover all these queries, BUT TurfJS is obviously client side JavaScript functions, so I'm unable to call the Turf functions from PHP, retrieve the output values to save it in MySQL.
Any suggestions?