Enlem Boylam Bilgisi – Google Maps API Geocode

in #power8 years ago (edited)

Amaç

Türkiye’nin il tablosunu internetten alarak, ilgili illerin enlem ve boylam bilgilerini google haritalar arayüzünü kullanarak çekebilmek.

Türkiyedeki İllerin Listesi
Kaynak: Wikipedia

Kaynak wikipedia linkini kullanarak power bi‘a Türkiyenin illerinin listesini çekiyoruz.*Web’ten veri çekmek  ile ilgili konumuzu inceleyebilirsiniz.İlgili tablonun web’te bulunmasinin ardindan düzenle denilerek sorgu editörüne gidilir ve illerin isimlerinin olduğu sütun dışındaki sütınlar kaldırılmak kaydı ile sadece illerin adlarının listesi olan bir görünüm sağlanır.Daha sonra sorguda kullanabilmek adına google arayüz linkini hazırlamak için yeni bir sürun eklenir. (Add Column / Custom Column) 

 Sütun adı olarak “GoogleMapAPI” verilir, daha sonrasinda sorguda kullanilacaktır, dolayısıyla başka bir isim vermek isterseniz sorguda da değiştirmeniz gerekir.Formul olarak;

https://maps.googleapis.com/maps/api/geocode/json?address=+”&[İl adı]&”+Turkey”

 Bu sayede yukarıdaki tablo görünümüne ulaşılır.Bu link size json türünde bir veri oluşmasını sağlayacaktır. Örnek bir veri için tıklayın.Sonrasında her bir json dosyasının kendi kırılımına göre veri çekilir.

"geometry" : {             "location" : {                "lat" : 36.9914194,                "lng" : 35.3308285             }}

Bizim örneğimizde enlem bilgisi için [geometry][location][lat] ve boylam bilgisi için [geometry][location][lng] kırılımı izlenmiştir.

let
Source = Web.Page(Web.Contents(“https://tr.wikipedia.org/wiki/T%C3%BCrkiye’nin_illeri”)),
Data1 = Source{1}[Data],
#”Changed Type” = Table.TransformColumnTypes(Data1,{{“Plaka”, type text}, {“İl adı”, type text}, {“Alan (km2)[8][A]”, type text}, {“Nüfus (2015)[7]”, type text}, {“NY kişi/km²[9]”, type text}, {“Telefon #(lf)kodu”, type text}, {“Vali”, type text}}),
#”Promoted Headers” = Table.PromoteHeaders(#”Changed Type”),
#”Removed Columns” = Table.RemoveColumns(#”Promoted Headers”,{“Alan (km)”, “Nüfus (2015)”, “NY kişi/km²”, “Telefon#(cr)#(lf)#(lf)kodu”, “Vali”, “Plaka”}),#”Added Custom” = Table.AddColumn(#”Removed Columns”, “GoogleMapAPI”, each “https://maps.googleapis.com/maps/api/geocode/json?address=+”&[İl adı]&”+Turkey”),GetJson = Table.AddColumn( #”Added Custom”, “JsonDoc”, each Json.Document(Web.Contents([GoogleMapAPI]))),Enlem = Table.AddColumn(GetJson, “Enlem”, each GetJson{_}[JsonDoc][results]{0}[geometry][location][lat]),
Boylam = Table.AddColumn(Enlem, “Boylam”, each Enlem{_}[JsonDoc][results]{0}[geometry][location][lng]),
#”Removed Columns1″ = Table.RemoveColumns(Boylam,{“GoogleMapAPI”, “JsonDoc”}),
#”Changed Type1″ = Table.TransformColumnTypes(#”Removed Columns1″,{{“Enlem”, type number}, {“Boylam”, type number}})in
#”Changed Type1″

 GOOGLE MAPS GEOCODE DOSYASINI İNDİR 

Sort:  

Congratulations @mmustafaaslan! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - The semi-finals are coming. Be ready!


Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes


Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @mmustafaaslan! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.099
BTC 63229.00
ETH 1747.23
USDT 1.00
SBD 0.39