There are points in the database indicating their longitude and latitude in decimal fractions of a degree, i.e. for example: 53.20498753072359,49.96120754474532.
The import of new points from csv is being developed. There is a condition a new point should not be closer than 150m to the existing one.
There is a function for calculating the distance between two points, but taking into account the large number of points (for example, now there are already 1000, you need to import another 5000) to sort through each new point the distance to each existing one is very laborious. There was an idea of optimization, for a start to pull out from the base all points that fall into a square with a side of 300m and a center in the new one being added. And already among them, to sort the distances (in most cases, such a filter and error will be enough. Actually the question is: how to determine the corner points of this square? 