Distance calculation query
Good morning, fellow MySQL users.
I use GIS software and develop my spatial queries inside those software. But, I am trying to learn how to do it directly in MySQL.
I want to ask if the spatial extensions of MySQL can do the following, and if possibel, can some one give me an example query to understand the concepts and structure.
Example:
I have 2 point layers. One called customers, and another one called datalog.
The datalog point layer, is a track made of points (lat/lon) coordinates, downloaded form a GPS datalogger, which is carried by delivery trucks.
What we want to do, is verify is the delivery stops at the customers location.
I have done this in several GIS, using queries like Select All points from customer locations within a 15 meters radius (distance query) . Or by doing a buffer zone around customer locations of 15 meters wide, and Selecting all point in that area, using "touches or containing". This works well.
But, I would like to do it in MySQL directly, without using a GIS.
Can anybody, help me out.
Just for your information, these is part of a fleet monitoring system. (passive tracking)
Also, if you have done similar work, please let me know. There is probably a better way to do it.
Thank you very much, have a nice day.
Tomas
P.S. ¿PostgreSQL with PostGIS, is it a better option than MySQL with Spatial extensions?