逆向地址编码就是通过经纬度反向查地名
HTTP请求
search1.mapabc.com/sisserver?highLight=false&config=SPAS&ver=2.0
& resType=json&enc=utf-8&spatialXml=%3C?xml%20version=%221.0%22%20encoding=%22gb2312%22?%3E%0D%0A%3Cspatial_request%20
method=%22searchPoint%22%3E%3Cx%3E116.334%3C/x%3E%3Cy%3E39.9872%3C/y%3E%3Cxs/%3E%3Cys/%3E%3CpoiNumber%3E10%3C/poiNumber
%3E%3Crange%3ENaN%3C/range%3E%3Cpattern%3E1%3C/pattern%3E%3CroadLevel%3E0%3C/roadLevel%3E%3Cexkey/%3E%3C/
spatial_request%3E%0D%0A&a_k=b0a7db0b3a30f944a21c3682064dc70ef5b738b062f6479a5eca39725798b1ee300bd8d5de3a4ae3
其中spatialXml为 XML请求包,转成标准格式如下
<spatial_request method=”searchPoint>
< x>116.334</x>
< y>39.9872</y>
< xs/>
< ys/>
< poiNumber>10</poiNumber>
< range>NaN</range>
< pattern>1</pattern>
< roadLevel>0</roadLevel>
< exKey/>
< /spatial_request>
返回 JSON格式
{
"message": "ok",
"SpatialBean": {
"crossPoiList": [
{
"name": "中关村路-中关村东路",
"y": "39.987446",
"x": "116.333208"
}
],
"District": {
"bounds": "116.047004699707;39.887622833252;116.391914367676;40.1567420959473",
"name": "海淀区",
"code": "110108",
"y": "39.9999",
"x": "116.286"
},
"roadList": [
{
"id": "00105836",
"distance": "24.653358",
"level": "45000",
"direction": "WestSouth",
"width": "4",
"name": "中关村路",
"ename": "Zhongguancun Road"
},
{
"id": "00104764",
"distance": "72.468277",
"level": "44000",
"direction": "EastNorth",
"width": "16",
"name": "北四环中路辅路",
"ename": "Side Road of N.4th Ring Road Middle"
},
{
"id": "00104802",
"distance": "87.100464",
"level": "44000",
"direction": "WestSouth",
"width": "16",
"name": "中关村东路",
"ename": "Zhongguancun East Road"
},
{
"id": "00103698",
"distance": "89.302155",
"level": "43000",
"direction": "EastNorth",
"width": "16",
"name": "北四环西路",
"ename": "N. 4th Ring Rd West"
},
{
"id": "00103654",
"distance": "112.080139",
"level": "44000",
"direction": "WestSouth",
"width": "20",
"name": "北四环西路辅路",
"ename": "Side Road of N.4th Ring Road West"
}
],
"Province": {
"name": "北京市",
"code": "110000"
},
"poiList": [
{
"icon": "",
"gridcode": "5916728612",
"direction": "EastNorth",
"tel": "010-62650066",
"en_name": "",
"extid": "",
"xml": "",
"type": "商务住宅;楼宇;商务写字楼",
"url": "",
"id": "",
"citycode": "010",
"timestamp": "",
"distance": "25",
"buscode": "",
"pguid": "B000A3513F",
"address": "北四环西路9",
"en_type": "",
"name": "银谷大厦",
"en_address": "",
"match": "10",
"srctype": "basepoi",
"y": "39.987152",
"x": "116.334297"
},
{
"icon": "",
"gridcode": "5916728612",
"direction": "EastNorth",
"tel": "",
"en_name": "",
"extid": "",
"xml": "",
"type": "政府机构及社会团体;政府机关;国家级机关及事业单位",
"url": "",
"id": "",
"citycode": "010",
"timestamp": "",
"distance": "15",
"buscode": "",
"pguid": "B000A80W3O",
"address": "北四环西路9号银谷大厦11F层(东侧)",
"en_type": "",
"name": "国家知识产权局专利复审委员会受理处",
"en_address": "",
"match": "10",
"srctype": "basepoi",
"y": "39.987155",
"x": "116.334167"
}
],
"City": {
"name": "",
"telnum": "010",
"code": ""
}
}
}