M
M
Maxim Timofeev2016-07-27 16:46:59
PHP
Maxim Timofeev, 2016-07-27 16:46:59

How to calculate distance to coordinates?

There is a table in the database while there id, city_name, there will probably be more coords (string)
There are user coordinates.
It is necessary to find the city closest to the user.
I can’t understand how to calculate and most importantly how best to store the coordinates of the city for this.
It would be possible to get the city by api from google or yandex, but the list of cities is limited, there are 25 cities. Over time, there will be more of course, but not everything is accurate.
What do you advise?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2016-07-27
@webinar

https://www.google.ru/#q=%D0%BE%D0%BF%D1%80%D0%B5%...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question