cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dnison Frequent Visitor
Frequent Visitor

Possible to get address returned from Lat Long in maps?

Is it possible to hook a dataset with lat long in it to something within Power BI that will bring back an approximate address that I could display on a map?  If yes, how accurate is that address?  Am I better off seeking an outside service to hook into the dataset before bringing it into Power BI?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Possible to get address returned from Lat Long in maps?

Hey,

 

what you are looking for is called "reverse geocoding".

 

Here is a little example, how to "reverse geocode" using the google maps api:

https://www.codexworld.com/get-address-from-latitude-longitude-using-google-maps-api-php/

 

This excellenct video shows how you can use the google maps api from Power Query

https://www.youtube.com/watch?v=87UsaOYD-ZM

This video also a link to how to obtain an api key.

 

Spoiler
Please consider the following, reverse geocoding may conflict  with data privacy!

 

Also consider, due to the lack of incremental data loads in Power Query, you send each row of the ever growing dataset to the api whenever you refresh the dataset. This then may also conflict with api limitations that just answers a certain amount of requests per time unit. For this reason I would recommend to use SQL Server and the integration of R (available since SQL Server 2016). And then use R script to get the address, this is described here:

https://datavisualizationineconomics.blogspot.de/2015/11/reverse-geocode-using-google-api-and.html

Please be aware that this solution calls into the world wide web from inside the SQL Server, and you may need some good arguments to convince your DBAs to allow this. One Argument is always "the value of location based information", at least I often use this argument 😉

 

Hopefully this provides some ideas.

 

Regards

Tom

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Possible to get address returned from Lat Long in maps?

Hey,

 

what you are looking for is called "reverse geocoding".

 

Here is a little example, how to "reverse geocode" using the google maps api:

https://www.codexworld.com/get-address-from-latitude-longitude-using-google-maps-api-php/

 

This excellenct video shows how you can use the google maps api from Power Query

https://www.youtube.com/watch?v=87UsaOYD-ZM

This video also a link to how to obtain an api key.

 

Spoiler
Please consider the following, reverse geocoding may conflict  with data privacy!

 

Also consider, due to the lack of incremental data loads in Power Query, you send each row of the ever growing dataset to the api whenever you refresh the dataset. This then may also conflict with api limitations that just answers a certain amount of requests per time unit. For this reason I would recommend to use SQL Server and the integration of R (available since SQL Server 2016). And then use R script to get the address, this is described here:

https://datavisualizationineconomics.blogspot.de/2015/11/reverse-geocode-using-google-api-and.html

Please be aware that this solution calls into the world wide web from inside the SQL Server, and you may need some good arguments to convince your DBAs to allow this. One Argument is always "the value of location based information", at least I often use this argument 😉

 

Hopefully this provides some ideas.

 

Regards

Tom

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!

View solution in original post

Highlighted
pistonss Frequent Visitor
Frequent Visitor

Re: Possible to get address returned from Lat Long in maps?

Hello Tom,

 

This seems like to be the answer to what I am looking for. However, I am completely new to coding and do not even know what to do with the PHP code given in the link you provided. Can you give me an idea of what I should be doing with it?

 

I have csv file with million rows of lat long and I need to be able to identify the district, subdistrict, zipcode of each coordinate

 

 

My data could possibly be too large for excel. Would it be possible to do it in MS Access or Power BI too? If not I can stick with Excel.

 

Bests

Suthipat

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 6 members 2,313 guests
Please welcome our newest community members: