Here is the problem,
Already made several researches about it, but did not find any clear and well explained solution about that. Some people are talking about functions like st_distance
or st_within
which refer to mysql/mariadb versions but these functions seem to have no real documentation and do not seem to fit my problem.
So what I'm tryin to do is :
Get ALL spatial POINTS (lat,ln)
which are within a circle with a defined RADIUS in KILOMETRES
.
User will give a radius, contained between 1 and 100 km, and will receive all database records that are within that radius.
"point
s" table looks like this :
ID -- POINT -- SOMETEXT
Point is the spatial type point used in mySql(>5.6) / mariaDb(5.5.40) (lat,lng)
so, the query should look like this :
"SELECT * FROM points WHERE (function... to get distance) <= definedDistance"
Thanks for help