Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
TomMartens
Super User
Super User

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.