The result is MySQL Stored Geo Functions, a small collection of MySQL stored function definitions for working with Lat,Long coordinates.
Currently there are three available operations:
- Buffering a point (by meters or miles)
- Calculating distance between two points (the Haversine function)
- Creating a line given a point, bearing and distance (in meters or miles)
Here’s a sample buffering result. The point in red has been buffered by 30 miles, producing a polygon with 8 points.
The generated polygon is also used in a query with a WHERE ST_INTERSECTS(polygon, point_geom) since MySQL doesn’t have ST_DWITHIN. The Marker is the result of the query.
If you’ve got MySQL spatial functions that you’d like to share, please submit a pull request! I’ll also continue to add any useful new functions I write.