There is a table in MySQL with a variety of GPS coordinates in the form of latitude and longitude .
The task is to split the entire world map into many parts (grid with a certain step) and then be able to determine which cell (coordinates of its corners) any GPS point belongs to. For example:
$activeCellCoordinates = cellForCoordinates({10.055402736564236, 38.1005859375});
Then it will be necessary to record the coordinates of the corners of each such cell into the database (if any of the GPS points fall into it, or are near the edges), but this is no longer the case.
Actually, how is it more or less optimally implemented in php ? As we know, the boundaries of latitude are -90 and 90, and longitude : 180 and -180. And take, for example, a step of 0.01 - this is already 648,000,000 cells: (
Thanks in advance!