I am trying to query a MySQL database (version 5.7.15) to retrieve all locations that are within 300 meters from some coordinates (40.7542, -73.9961 in my case):
<
Note that in MySql the order of coordinates are: 1. POINT(lng, lat) - no SRID 2. ST_GeomFromText('POINT(lat lng)', 4326) - with SRID
POINT(lng, lat)
ST_GeomFromText('POINT(lat lng)', 4326)
select st_distance_sphere(POINT(-73.9949,40.7501), POINT( -73.9961,40.7542))
will return 466.9696023582369, as expected, and 466.9696023582369 > 300 of course