Baidu Map API to achieve the address & latitude and longitude of each other switch __ public resources

Source: Internet
Author: User
1. According to the address to obtain latitude and longitude:

Request Address: http://api.map.baidu.com/geocoder/v2/?address= China Chengdu Talent Market &output=json&ak= your AK.

Return results: {"status": 0, "result": {"location": {"LNG": 104.06552381979525, "lat": 30.68093376455154}, "precise": 1, " Confidence ":", "Level": "UNKNOWN"}}


2. Obtain the address according to the latitude and longitude degree:

Request Address: http://api.map.baidu.com/geocoder/v2/?callback=renderReverse&location= 30.68093376455154,104.06552381979525&output=json&pois=1&ak= your AK.

return Result:

Renderreverse&&renderreverse ({"Status": 0, "result": {"location": {"LNG": 104.0655238197952, "lat" : 30.680933634264947}, "Formatted_address": "Chengdu City, Sichuan Province, Qingyang District Ningxia Street, No. 160th", "Business": "Chunma, Xinhua West Road, Babel Street", "Addresscomponent": {" Country ":" China "," Country_code ": 0," province ":" Sichuan Province "," City ":" Chengdu "," District ":" Qingyang District "," Adcode ":" 510105 "," Street ":" Ningxia Jie " , "Street_number": "160th Number", "direction": "Nearby", "Distance": "5"}, "POIs": [{"addr": "136th of Ningxia Street with 1th", "CP": "", "direction": "Nearby" , "Distance": "The", "name": "Talent Building", "Poitype": "Real Estate", "point": {"x": 104.06570195377788, "y": 30.68123929976142}, "tag": " Real estate, Office, "tel": "", "UID": "9f97b1c55d348507b64f54c4", "Zip": ""},{"addr": "Ningxia Street 136th", "CP": "", "direction": "Near", " Distance ":" "", "Name": "Chengdu Talent Flow Service Center", "Poitype": "Government agencies", "point": {"x": 104.06560314017178, "y": 30.681216006133047}, " Tag ":" Government agencies, administrative units, "tel": "," "UID": "A431A82C02AE3A90D2F49EEC", "Zip": ""},{"addr": "Chengdu City, Sichuan Province, Qingyang District Ningxia Street, No. 136th, with 1th talent building", "CP": "" , "direction": "Near", "Distance": "", "Name": "China Chengdu Talent Market", "Poitype": "Company Enterprise", "point": {"x": 104.06566602155748, "Y" : 30.681270357923777}, "tag": "CorporateCompany "," Tel ":" "," UID ":" 251374c9ad16f33ea11de9f7 "," Zip ":" "},{" addr ":" 1th Qingyang District West Street, Chengdu City, Sichuan Province "," CP ":" "," direction ":" Northeast "," Distance ":" 201 "," Name ":" Chengdu New City Plaza "," Poitype ":" Shopping "," point ": {" x ": 104.06397720719872," y ": 30.6801211991978}," tag ":" Shopping mall "," tel ":" "," UID ":" 7aea43b7568f9ae17d29bdf6 "," Zip ":" "},{" addr ":" A building 2, New City Plaza, no. 1th West Street, Chengdu "," CP ":" "," direction ":" Northeast "," Distance ":" 117 "," Name ":" Pacific Studios "," Poitype ":" Leisure and entertainment "," point ": {" x ": 104.0648216143781," Y " : 30.68025319786169}, "tag": "Leisure and entertainment; Cinema", "tel": "", "UID": "Fa7da3e81fc87a7b42d63e24", "Zip": ""},{"addr": "Million and Road No. 99th", "CP" : "", "direction": "West", "Distance": "The", "name": "Li Yang World", "Poitype": "Real Estate", "point": {"x": 104.06639364902056, "Y" : 30.681045186018193}, "tag": "Real estate, residential area", "tel": "", "UID": "101bc61b807557dec42ba16c", "Zip": "},{" addr ":" 5/F, block A, New City Plaza, No. No. 200, Ningxia Street "," CP ":" "," "direction": "Northeast", "Distance": "", "name": "Living Home Group Chengdu Branch", "Poitype": "Corporate Enterprise", "point": {"x" : 104.0649473771495, "y": 30.68033860866474}, "tag": "Corporate Company", "Tel": "", "UID": "6348ee6b13dda375d12dd655", "Zip": ""}, {"addr": "Million and road 11th", "CP": "", "direction": "Northwest", "DisTance ":" "135", "Name": "Chengdu Qingyang District State Tax Bureau", "Poitype": "Government agencies", "point": {"x": 104.06633076763487, "y": 30.6801444930929}, "tag": " Government agencies, administrative units, "tel": "", "UID": "AA40108BB0301C14C5EFFBCA", "Zip": ""},{"addr": "Qingyang District million and road 100th", "CP": "", "direction": "Southwest", " Distance ":" 207 "," name ":" Deyang Bank (Chengdu million and Road branch) "," Poitype ":" Finance "," point ": {" x ": 104.06706737815304," y ": 30.681837167614427}, "Tag": "Financial Bank", "tel": "," "UID": "Cfd60c585e1ca3bb9d9d68ce", "Zip": ""},{"addr": "No. 1th Qingyang District West Street, Chengdu," "CP": "", "direction": " Northeast "," Distance ":" 211 "," Name ":" Parkson Shopping center (Sichuan fashion Shop) "," Poitype ":" Shopping "," point ": {" x ": 104.06404907163952," Y " : 30.67990378923652}, "tag": "Shopping; shopping malls", "tel": "", "UID": "251374C95826C626A11DE9DF", "Zip": ""}], "Poiregions": [], " Sematic_description ": 44 meters near the talent building", "Citycode": 75}})


Report:

AK View Address: Http://lbsyun.baidu.com/apiconsole/key


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.