Latitude and longitude detection simultaneously

I have a long list of cities and towns, and I would like to add information on the latitude and longitude to each of them.

Does anyone know the easiest way to generate this information once?

See also Multiple geocoding addresses

+4
source share
5 answers

The first part of the third video shows how to get latitude and longitude using Google Refine and geocoding. No need to write a new script. Ideal for this kind of change once .

http://code.google.com/p/google-refine/

+5
source

Or use www.geonames.org - there are APIs for this. Or Open Street Map Nominatim: http://wiki.openstreetmap.org/wiki/Nominatim - Google has slightly more restrictive terms of service.

+3
source

You can use the Google geocoding API. Check out the API at this URL: http://code.google.com/apis/maps/documentation/geocoding/

Next, write some code. I am doing something similar in C #, and here it is pretty simple.

+2
source

Most geocoding services can only process requests with administrative names that you, for example, the municipality and region. So I choose one of them that you like, also handles batch or bulk requests, for example the Bing Spatial Data API (here's an article about batch geocoding with it .)

An alternative approach that can be useful if you are on a budget and they need to do a lot of things is to download the Geonames database and write some code to import it into your database or index it; then query it and how often do you like, for example, if you place your seats in another table, you can SELECT [...] FROM my_places LEFT JOIN geonames [...] . I used to import Geonames DB into vanilla PostgreSQL at night and probably still have the code in the git repository somewhere if you want to try this route (comment and I will find it and attach it.)

+1
source

For a service using Google, which I consider the most accurate. Take a look at http://www.torchproducts.com/tools/geocode

0
source

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


All Articles