To calculate the distance to the nearest objects from another object, you need to store the coordinates in MySQL. After reading other topics, I realized that it is best to use the POINT type and create a SPATIAL index to speed up the search.
How to create a query, which of the objects table (having the coord field of the POINT type) select, for example, the 5 nearest objects to another point and calculate the distances for them?
And the second question is how to calculate the distance from the objects to the Black Sea (more precisely, to its nearest coast). So far, I realized that I need to describe his polygon.

