逆地理编码查询
简介
天地图逆地理服务API是一类简单的HTTP/HTTPS接口,提供将坐标点(经纬度)转换为结构化的地址信息的功能。
使用逆地理编码服务前您需要申请Key
请求接口
参数值 参数说明 参数类型 是否必备 备注(值域)
lon 坐标的x值 string
lat 坐标的y值 string
appkey 网站的唯一编码 string
ver 接口版本 string
逆地理编码响应示例:
请求:http://api.tianditu.gov.cn/geocoder?postStr={'lon':116.37304,'lat':39.92594,'ver':1}&type=geocode&tk=您的密钥
返回:
响应接口
参数值 参数说明 参数类型 返回条件 备注(值域)
result 响应的具体信息 Json 有结果时返回
status 状态 String(0:正确,1:错误,404:出错。) 必返回
msg 响应信息是否有 String(OK:有信息) 必返回 Status=404时返回错误信息。
result:
参数值 参数说明 参数类型 返回条件 备注(值域)
addressComponent 此点的具体信息(分类) Json 必返回
formatted_address 详细地址 String 必返回
location 此点坐标 Json 必返回 -180。
addressComponent
参数值 参数说明 参数类型 返回条件 备注(值域)
address 此点最近地点信息 string 必返回
address_distince 此点距离最近地点信息距离 int 必返回
address_position 此点在最近地点信息方向 string 必返回
city 此点所在国家或城市或区县 string 必返回
poi 距离此点最近poi点 string 必返回
poi_distince 距离此点最近poi点的距离 int 必返回
poi_position 此点在最近poi点的方向 string 必返回
road 距离此点最近的路 string 必返回
road_distince 此点距离此路的距离 int 必返回
location:
参数值 参数说明 参数类型 返回条件 备注(值域)
lon 此点坐标x值 string 必返回
lat 此点坐标y值 string 必返回