1

I am analysing app data which contains lat value and lon value of a user visited places. I was able to export the data to tableau and plot it on the map but I want to find the name of place for each pair of lat and lon.

One solution could be, if I get a table of three columns (Lat, Lon, Place) then I can join it with my user data table to find the name of a place at a given Lat and Lon.

My question is, do we have a ready made table with the above three columns which I can import in my SQL-Server? I am interested in places of UK or London. Is there any other approach to achieve it?

Dr. Mian
  • 3,334
  • 10
  • 45
  • 69

2 Answers2

1

You can get this from the Ordinance Survey which should get you lat, long, postcode;

https://www.ordnancesurvey.co.uk/business-and-government/products/code-point-open.html

You'll then need another data source to map the postcode to location name (e.g. town, county etc). See the similar post below;

Where can I find a list of all UK _full_ postcodes including street name and their precise coordinates?

It might take a little fiddling about, and you're always going to have the issue with data being a little out of date but it should be good enough.

Community
  • 1
  • 1
Rich Benner
  • 7,873
  • 9
  • 33
  • 39
  • Thanks for the reply. I am looking for something similar (http://www.latlong.net/Show-Latitude-Longitude.html). To get an API or the database they are using and import that database. E.g. lat = 51.5147184975572 lon = -0.301268398761749 – Dr. Mian May 16 '16 at 10:24
1

I wrote an API wrapper in R for postcodes.io, which is a free UK postcode database. Check the original documentation so that you could create an API wrapper in your language of choice. Wrappers in languages other than R are also available.

If you use R, then type you can get the place names in the following way:

if (!require("devtools")) install.packages("devtools")
devtools::install_github("erzk/PostcodesioR")
library(PostcodesioR)

rev_geo <- reverse_geocoding(0.127, 51.507)

It will return a list with extensive information about the latitude and longitude, e.g. wards, NUTS, administrative district, county, parish, consituency, CCG and many more.

There is also a bulk_reverse_geocoding() function which takes several lat and lon inputs.

epo3
  • 2,991
  • 2
  • 33
  • 60