Getting locations from coordinates?

I have a script to get the coordinates of the user when they go to a specific page, but I need a way to get the approximate location (city, state, country, etc.). Is there any way that I do this server side (preferably PHP)?

+4
source share
3 answers
+9
source

The options I've found so far

All of them provide simple HTTP endpoints for address extraction, depending on the particular lat / lng combination.

You can also download the geonames database and use the spatial extension of PostGIS or MySQL to create your own service. The advantage is that you don’t have to worry about bet limits. The disadvantage is that it will not be very accurate.

SimpleGeo has no speed limits, but the database is limited to the United States the last time I checked.

+3
source

Assuming you get lat / long coordinates, you can use something like SimpleGeo services: http://simplegeo.com/

I think the Google option is better, SimpleGeo sounds like more than you need.

0
source

Source: https://habr.com/ru/post/1344825/


All Articles