I have got a list of points and a fixed range (10m). So what I have to do is for each point I have to find all the points present in a table with the 10m range of the given point.

For example: Let say I have following list of points:
P1, P2, P3, P4, P5, P6

Now I have to loop through each point. First I'll get P1 and I need all points (in a table) present inside the circle where radius is 10m and center is P1. Similarly I'll do for all other points from P2 to P6. My result will be all the outcome points in each loop.

I am not sure whether I have explained well or not. But I can clarify if you can comment.

I also need to improve the solution; where I can calculate the outcome points one at time (by creating a polygon maybe) and then somehow consider the range.


  • Do you want to achieve this using software or scripting? How are your points currently stored? – Matt Mar 6 '14 at 21:00
  • I want to achieve this by script. I am using mysql. So I am storing my points as Point datatype provided by mysql spatial. – Ansuman Bebarta Mar 6 '14 at 21:35

I'm not to familiar with the MySQL spatial functions but from a quick look at the docs you should be able to to buffer your original points by 10m to create a new geometries and then use the st_within function to find the points which lie within the 10m radius of the original point.

  • 1
    Is using the ST_Buffer() Function in MySQL the most efficient way of finding points within a certain radius with LARGE datasets? Or is it better to store your points as floats? – Jethro Dec 27 '15 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.