请求消息:
- POST https://siteapi.cloud.huawei.com/mapApi/v1/siteService/geocode?key=API KEY HTTP/1.1
- Content-Type: application/json
- Accept: application/json
- {
- "address": "Cleary Garden,Queen Victoria St,London",
- "bounds": {
- "northeast": {
- "lng": "-0.0953",
- "lat": "51.512"
- },
- "southwest": {
- "lng": "-1.0953",
- "lat": "50.512"
- }
- },
- "language": "en",
- "politicalView": "EN"
- }
响应消息:
- {
- "returnCode": "0",
- "sites": [
- {
- "formatAddress": "Queen Victoria Street, City of London, London, England, EC4V 4, the United Kingdom",
- "address": {
- "country": "the United Kingdom",
- "countryCode": "GB",
- "locality": "City of London",
- "adminArea": "England",
- "subAdminArea": "London",
- "thoroughfare": "Queen Victoria Street",
- "postalCode": "EC4V 4"
- },
- "viewport": {
- "southwest": {
- "lng": -0.096741,
- "lat": 51.5107041
- },
- "northeast": {
- "lng": -0.0939118,
- "lat": 51.5132477
- }
- },
- "name": "Cleary Garden",
- "siteId": "2BAB93BEA76683B5178A744F287C7D93",
- "location": {
- "lng": -0.0953263,
- "lat": 51.511976
- }
- },
- {
- "formatAddress": "Queen Victoria Street, City of London, London, England, the United Kingdom",
- "address": {
- "country": "the United Kingdom",
- "countryCode": "GB",
- "locality": "City of London",
- "adminArea": "England",
- "subAdminArea": "London",
- "thoroughfare": "Queen Victoria Street"
- },
- "viewport": {
- "southwest": {
- "lng": -0.0931563,
- "lat": 51.5116538
- },
- "northeast": {
- "lng": -0.0903271,
- "lat": 51.5141974
- }
- },
- "name": "City of London, Bank Station Queen Victoria Street",
- "siteId": "653ED37CEC70F1C898664B606E83923F",
- "location": {
- "lng": -0.0917416,
- "lat": 51.5129256
- }
- },
- {
- "formatAddress": "Queen Victoria Street, City of London, London, England, the United Kingdom",
- "address": {
- "country": "the United Kingdom",
- "countryCode": "GB",
- "locality": "City of London",
- "adminArea": "England",
- "subAdminArea": "London",
- "thoroughfare": "Queen Victoria Street",
- "postalCode": "EC4V 4"
- },
- "viewport": {
- "southwest": {
- "lng": -0.0925221,
- "lat": 51.5116525
- },
- "northeast": {
- "lng": -0.0896929,
- "lat": 51.5141961
- }
- },
- "name": "City of London, Bank Station Queen Victoria Street",
- "siteId": "B8A8BE102AF230D836F5FE9F3B86D88E",
- "location": {
- "lng": -0.0911075,
- "lat": 51.5129243
- }
- },
- {
- "formatAddress": "Melbourne CBD, Melbourne, Ciudad Victoria, 3000, Australia",
- "address": {
- "country": "Australia",
- "countryCode": "AU",
- "subLocality": "Melbourne CBD",
- "adminArea": "Victoria",
- "subAdminArea": "Melbourne",
- "postalCode": "3000"
- },
- "viewport": {
- "southwest": {
- "lng": 144.968429,
- "lat": -37.8235692
- },
- "northeast": {
- "lng": 144.9722822,
- "lat": -37.8210256
- }
- },
- "name": "Queen Victoria Gardens",
- "siteId": "BC89FA4C95E190C0EC7FE7384EB3C8BD",
- "location": {
- "lng": 144.9703557,
- "lat": -37.82229739999999
- }
- },
- {
- "formatAddress": "the United Kingdom",
- "address": {
- "country": "the United Kingdom",
- "countryCode": "GB"
- },
- "viewport": {
- "southwest": {
- "lng": -1.7055477,
- "lat": 51.9927943
- },
- "northeast": {
- "lng": -1.7022272,
- "lat": 51.994558
- }
- },
- "name": "Queen Victoria's Garden",
- "siteId": "E54BB0D3B4F253114574E00343E19072",
- "location": {
- "lng": -1.704096748253849,
- "lat": 51.99367615
- }
- },
- {
- "formatAddress": "46th St, Sunnyside Gardens, Queens, New York, United States",
- "address": {
- "country": "United States",
- "countryCode": "US",
- "locality": "Sunnyside Gardens",
- "adminArea": "New York",
- "subAdminArea": "Queens",
- "thoroughfare": "46th St"
- },
- "viewport": {
- "southwest": {
- "lng": -73.9201214,
- "lat": 40.7465061
- },
- "northeast": {
- "lng": -73.9165448,
- "lat": 40.7490497
- }
- },
- "name": "Sunnyside Gardens",
- "siteId": "787EE94944ABB25B3AA8FCD567388F06",
- "location": {
- "lng": -73.918333,
- "lat": 40.747778
- }
- },
- {
- "formatAddress": "13432, 217Th St, Springfield Gardens, Queens, New York, 11413, United States",
- "address": {
- "country": "United States",
- "countryCode": "US",
- "locality": "Springfield Gardens",
- "adminArea": "New York",
- "subAdminArea": "Queens",
- "thoroughfare": "217Th St"
- "streetNumber": "13432",
- "postalCode": "11413"
- },
- "viewport": {
- "southwest": {
- "lng": -73.7546834,
- "lat": 40.6780572
- },
- "northeast": {
- "lng": -73.7511008,
- "lat": 40.6806008
- }
- },
- "name": "Merrick Gardens",
- "siteId": "F4C51AA79346BA67256C6D265AB91C7B",
- "location": {
- "lng": -73.752892,
- "lat": 40.67932900000001
- }
- },
- {
- "formatAddress": "14686, 181St St, Springfield Gardens, Queens, New York, 11413, United States",
- "address": {
- "country": "United States",
- "countryCode": "US",
- "locality": "Springfield Gardens",
- "adminArea": "New York",
- "subAdminArea": "Queens",
- "thoroughfare": "181St St",
- "streetNumber": "14686",
- "postalCode": "11413"
- },
- "viewport": {
- "southwest": {
- "lng": -73.7681175,
- "lat": 40.6593721
- },
- "northeast": {
- "lng": -73.7645333,
- "lat": 40.6619157
- }
- },
- "name": "Garden Winser",
- "siteId": "6C4CF26FAD3838D5A2A5180F757F7DF4",
- "location": {
- "lng": -73.7663254,
- "lat": 40.660644
- }
- },
- {
- "formatAddress": "77th St, Garden Bay Manor, Queens, New York, United States",
- "address": {
- "country": "United States",
- "countryCode": "US",
- "locality": "Garden Bay Manor",
- "adminArea": "New York",
- "subAdminArea": "Queens",
- "thoroughfare": "77th St"
- },
- "viewport": {
- "southwest": {
- "lng": -73.8944874,
- "lat": 40.7682282
- },
- "northeast": {
- "lng": -73.8909128,
- "lat": 40.7707718
- }
- },
- "name": "Garden Bay Manor",
- "siteId": "6A8D838C5DA2AB678B4A01D003FC2130",
- "location": {
- "lng": -73.8927,
- "lat": 40.7695
- }
- },
- {
- "formatAddress": "13604, 220th St, Springfield Gardens, Queens, New York, 11413, United States",
- "address": {
- "country": "United States",
- "countryCode": "US",
- "locality": "Springfield Gardens",
- "adminArea": "New York",
- "subAdminArea": "Queens",
- "thoroughfare": "220th St",
- "streetNumber": "13604",
- "postalCode": "11413"
- },
- "viewport": {
- "southwest": {
- "lng": -73.7531415,
- "lat": 40.6753222
- },
- "northeast": {
- "lng": -73.7495587,
- "lat": 40.6778658
- }
- },
- "name": "Lifespire Springfield Gardens",
- "siteId": "72980C86D13DC668C870AFE69735E049",
- "location": {
- "lng": -73.75135,
- "lat": 40.676594
- }
- }
- ],
- "returnDesc": "OK"
- }
POST https://siteapi.cloud.huawei.com/mapApi/v1/siteService/geocode?key=API KEY
参数名称 | 必选(M)/可选(O) | 参数类型 | 参数说明 |
address | M | String(<=512) | 地点信息。 |
bounds | O | 查询结果偏向的搜索范围。 | |
language | O | String(<=6) | 搜索结果的语种。如果不传,使用地点的当地语言。 语种取值请参考语种映射列表。 |
| politicalView | O | String(=2) | 政治观点参数,采用ISO 3166-1-alpha-2规范的2位国家码。 |
参数名称 | 必选(M)/可选(O) | 参数类型 | 参数说明 |
returnCode | M | String | 返回码,具体请参考“返回码”。 |
returnDesc | O | String | 返回值描述。 |
sites | O | Site[] | 如果查询成功,返回搜索结果。如果没有结果,返回空数组。 注意Site对象不返回POI信息。 |
请求消息:
- POST https://siteapi.cloud.huawei.com/mapApi/v1/siteService/reverseGeocode?key=API KEY HTTP/1.1
- Content-Type: application/json
- Accept: application/json
- {
- "location": {
- "lng": 77.2155,
- "lat": 18.0527
- },
- "language": "en",
- "politicalView": "CN",
- "returnPoi": true
- }
响应消息:
- {
- "returnCode": "0",
- "sites": [
- {
- "formatAddress": "Bhalki, Bidar, Karnataka, India",
- "address": {
- "country": "India",
- "countryCode": "IN",
- "locality": "Bhalki",
- "adminArea": "Karnataka",
- "subAdminArea": "Bidar"
- },
- "viewport": {
- "southwest": {
- "lng": 77.21601340436659,
- "lat": 18.047203360252986
- },
- "northeast": {
- "lng": 77.21979263425037,
- "lat": 18.050796621388685
- }
- },
- "name": "",
- "siteId": "0BC2A43E59A2433F058836FED1CFEA50",
- "location": {
- "lng": 77.217903,
- "lat": 18.049
- }
- },
- {
- "formatAddress": "Bidar, Karnataka, India",
- "address": {
- "country": "India",
- "countryCode": "IN",
- "adminArea": "Karnataka",
- "subAdminArea": "Bidar"
- },
- "viewport": {
- "southwest": {
- "lng": 77.24675971115403,
- "lat": 18.019168660268228
- },
- "northeast": {
- "lng": 77.25053833900586,
- "lat": 18.022761921403927
- }
- },
- "name": "",
- "siteId": "2444F4ABC13BEEFDA1AC75CD9BD3FD44",
- "location": {
- "lng": 77.2486490058066,
- "lat": 18.0209653
- }
- },
- {
- "formatAddress": "Karnataka, India",
- "address": {
- "country": "India",
- "countryCode": "IN",
- "adminArea": "Karnataka"
- },
- "viewport": {
- "southwest": {
- "lng": 76.16582923864172,
- "lat": 14.708474755022333
- },
- "northeast": {
- "lng": 76.1695442701685,
- "lat": 14.712068016158103
- }
- },
- "name": "",
- "siteId": "76633A6DA68C893C9AE654C7FF506F97",
- "location": {
- "lng": 76.16768673911331,
- "lat": 14.7102713929855
- }
- },
- {
- "formatAddress": "India",
- "address": {
- "country": "India",
- "countryCode": "IN"
- },
- "viewport": {
- "southwest": {
- "lng": 79.5577310167445,
- "lat": 22.57606210771953
- },
- "northeast": {
- "lng": 79.56162252858664,
- "lat": 22.579655368855118
- }
- },
- "name": "",
- "siteId": "A44719C2043653BB06204386B976C7BC",
- "location": {
- "lng": 79.55967674729584,
- "lat": 22.57785875
- }
- }
- ],
- "returnDesc": "OK"
- }
POST https://siteapi.cloud.huawei.com/mapApi/v1/siteService/reverseGeocode?key=API KEY
参数名称 | 必选(M)/可选(O) | 参数类型 | 参数说明 |
location | M | 经纬度。 | |
language | O | String(<=6) | 搜索结果的语种。如果不传,使用地点的当地语言。 语种取值请参考语种映射列表。 |
| politicalView | O | String(=2) | 政治观点参数,采用ISO 3166-1-alpha-2规范的2位国家码。 |
| returnPoi | O | boolean | 是否返回POI的地点名称,默认是true。 |
参数名称 | 必选(M)/可选(O) | 参数类型 | 参数说明 |
returnCode | M | String | 返回码,具体请参考“返回码”。 |
returnDesc | O | String | 返回值描述。 |
sites | O | Site[] | 如果查询成功,返回搜索结果。如果没有结果,返回空数组。 注意:如果returnPoi是false,不返回Site的Poi对象。 |