Given a table,
+-----+---------+---------+---------+---------+---------+
| user| min_lat | max_lat | min_lng | max_lng |
+-----+---------+---------+---------+---------+---------+
| a | 46 | 407 | 6 | 367 |
| b | 226 | 227 | 186 | 188 |
And a Point(x, y) Find users where the point is within the min and max latitude and longitude ranges of users (where min and max long and lat = current position minus or plus radius).
Minimum values can be less than 0 and maximum values can be greater than 360, the query needs to take these into account.
E.g. filtering using Point(7,5) should also return user A, as 367-360=7.
Not sure if I'm getting this right, but hopefully somebody can give me some insight.