I've been scouring the internet for days and have finally admitted defeat. I can't find any articles on geospatial distance queries using mysql that are newer than mid-2011. I've combed the mysql docs, googled for hours, done tag searches and text searches here in SO... nothing.
So the question stands: I need to make a pretty run-of-the-mill radius-based query on a mysql database. I'd prefer to use as few add-ons as possible, but I'll take what I can get. Here's a sample:
CREATE TABLE `test_locations` (
`location_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`locaiton_name` VARCHAR(32) NOT NULL,
`latlng` POINT NOT NULL
);
SELECT `location_name`, X(`latlng`) as `lat`, Y(`latlng`) as `lng`
FROM `test_locations`
WHERE DISTANCE(PointFromText('POINT(41.78231 -88.712151)'), latlng) < 15;
Yes, this is pseudo-code to a certain degree, because I haven't seen any reference to a (working) mysql native DISTANCE()
function yet, but I just can't imagine that in 2 whole years nothing has been done with this. I must be blind....
Thanks in advance for any insights.