(以“{{car-sidebar}} ==接口说明== 将地址转换成坐标的功能,将详细的地址描述传给百度车联网服务如:北京市上地十街十号百度大...”为内容创建页面) |
|||
(未显示1个用户的7个中间版本) | |||
第1行: | 第1行: | ||
{{car-sidebar}} | {{car-sidebar}} | ||
− | ==接口说明== | + | |
+ | == 接口说明 == | ||
+ | |||
+ | <span style="color:red;"> </span><span style="color:#FF0000;">车联网API服务的各种能力后续将合并到Web API服务中。自2015年12月31日起,车联网API服务将不再向新用户提供服务支持,服务已不再维护,请已使用了各种车联网API服务的开发者,尽快升级服务到Web API中使用。</span> | ||
将地址转换成坐标的功能,将详细的地址描述传给百度车联网服务如:北京市上地十街十号百度大厦,返回经纬度坐标。 | 将地址转换成坐标的功能,将详细的地址描述传给百度车联网服务如:北京市上地十街十号百度大厦,返回经纬度坐标。 | ||
− | ==接口示例== | + | == 接口示例 == |
− | http://api.map.baidu.com/telematics/v3/geocoding?keyWord=北京市上地十街十号百度大厦&cityName=131&out_coord_type=gcj02&ak=E4805d16520de693a3fe707cdc962045 | + | [http://api.map.baidu.com/telematics/v3/geocoding?keyWord=北京市上地十街十号百度大厦&cityName=131&out_coord_type=gcj02&ak=E4805d16520de693a3fe707cdc962045 http://api.map.baidu.com/telematics/v3/geocoding?keyWord=北京市上地十街十号百度大厦&cityName=131&out_coord_type=gcj02&ak=E4805d16520de693a3fe707cdc962045] |
− | ==接口参数设置== | + | == 接口参数设置 == |
− | {| | + | {| |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | ! width="100" | 参数类型 |
− | | | + | ! width="100" | 参数名称 |
− | | | + | ! width="100" | 是否必须 |
− | + | ! 具体描述 | |
|- | |- | ||
− | |String | + | | String |
− | | | + | | ak |
− | | | + | | true |
− | | | + | | 开发者密钥 |
|- | |- | ||
− | |String | + | | String |
− | | | + | | sn |
− | | | + | | false |
− | | | + | | 若用户所用ak的校验方式为sn校验时该参数必须。 |
|- | |- | ||
− | |String | + | | String |
− | | | + | | keyWord |
− | |true | + | | true |
− | | | + | | 搜索的具体地址,建议按照省市/区县/街道、POI名称的方式完整填写,例如:北京市/海淀区/上地信息路甲9号/奎科科技大厦 |
|- | |- | ||
− | |String | + | | String |
− | | | + | | cityName |
− | | | + | | true |
− | | | + | | 城市名称,如cityName=’北京’ |
|- | |- | ||
− | |String | + | | String |
− | |out_coord_type | + | | output |
− | |false | + | | false |
− | |返回结果输出时的坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标。 | + | | 输出的数据类型,默认为xml格式的数据,如果将output的值设置为“json”,则输出json格式的数据 |
+ | |- | ||
+ | | String | ||
+ | | out_coord_type | ||
+ | | false | ||
+ | | 返回结果输出时的坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标。 | ||
+ | |- | ||
+ | | String | ||
+ | | callback | ||
+ | | false | ||
+ | | 将json格式的返回值通过callback函数返回以实现jsonp功能。举例:callback=showLocation(JavaScript函数名)。 | ||
|} | |} | ||
− | ==返回结果== | + | == 返回结果 == |
{| | {| | ||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | ! width="150" | 参数类型 |
− | | | + | ! width="150" | 参数名及位置 |
− | + | ! 具体描述 | |
|- | |- | ||
− | | | + | | string |
− | | | + | | status |
− | | | + | | 请求状态,如果成功返回0,如果失败返回其他数字,详细见状态码附录。 |
|- | |- | ||
− | | | + | | int |
− | | | + | | precise |
− | | | + | | 精准度,0为不够精准,1表示比较精准 |
|- | |- | ||
− | |float | + | | float |
− | |lat | + | | lng |
− | |地点的纬度 | + | | 地点的经度 |
+ | |- | ||
+ | | float | ||
+ | | lat | ||
+ | | 地点的纬度 | ||
|} | |} | ||
− | ==返回xml格式的数据== | + | == 返回xml格式的数据 == |
− | + | <pre><GecoderResponse> | |
− | <pre> | + | |
− | <GecoderResponse> | + | |
<status>Success</status> | <status>Success</status> | ||
<results> | <results> | ||
第88行: | 第96行: | ||
</pre> | </pre> | ||
− | ==返回json格式的数据== | + | == 返回json格式的数据 == |
− | + | <pre>{ | |
− | <pre> | + | |
− | { | + | |
"status":"success", | "status":"success", | ||
"results":{ | "results":{ |
2022年11月14日 (一) 11:02的最后版本
接口说明
车联网API服务的各种能力后续将合并到Web API服务中。自2015年12月31日起,车联网API服务将不再向新用户提供服务支持,服务已不再维护,请已使用了各种车联网API服务的开发者,尽快升级服务到Web API中使用。
将地址转换成坐标的功能,将详细的地址描述传给百度车联网服务如:北京市上地十街十号百度大厦,返回经纬度坐标。
接口示例
http://api.map.baidu.com/telematics/v3/geocoding?keyWord=北京市上地十街十号百度大厦&cityName=131&out_coord_type=gcj02&ak=E4805d16520de693a3fe707cdc962045
接口参数设置
参数类型 | 参数名称 | 是否必须 | 具体描述 |
---|---|---|---|
String | ak | true | 开发者密钥 |
String | sn | false | 若用户所用ak的校验方式为sn校验时该参数必须。 |
String | keyWord | true | 搜索的具体地址,建议按照省市/区县/街道、POI名称的方式完整填写,例如:北京市/海淀区/上地信息路甲9号/奎科科技大厦 |
String | cityName | true | 城市名称,如cityName=’北京’ |
String | output | false | 输出的数据类型,默认为xml格式的数据,如果将output的值设置为“json”,则输出json格式的数据 |
String | out_coord_type | false | 返回结果输出时的坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标。 |
String | callback | false | 将json格式的返回值通过callback函数返回以实现jsonp功能。举例:callback=showLocation(JavaScript函数名)。 |
返回结果
参数类型 | 参数名及位置 | 具体描述 |
---|---|---|
string | status | 请求状态,如果成功返回0,如果失败返回其他数字,详细见状态码附录。 |
int | precise | 精准度,0为不够精准,1表示比较精准 |
float | lng | 地点的经度 |
float | lat | 地点的纬度 |
返回xml格式的数据
<GecoderResponse> <status>Success</status> <results> <result> <location> <lat>40.050743859593</lat>//当前点的经度坐标 <lng>116.3017193083</lng>//当前点对应的纬度坐标 </location> <precise>1</precise> </result> </results> </GecoderResponse>
返回json格式的数据
{ "status":"success", "results":{ "location":{"lng":116.3017193083,"lat":40.050743859593}, "precise":1, } }