Location/route
Zhangchao2 (讨论 | 贡献) |
Zhangchao2 (讨论 | 贡献) (→返回结果) |
||
第45行: | 第45行: | ||
<accessInfo /> | <accessInfo /> | ||
<navSign /> | <navSign /> | ||
− | <P>11643755,3992733</P> | + | <\P>11643755,3992733</\P> |
<next>11643757,3992702</next> | <next>11643757,3992702</next> | ||
</item> | </item> | ||
第60行: | 第60行: | ||
<accessInfo>无辅助动作</accessInfo> | <accessInfo>无辅助动作</accessInfo> | ||
<navSign /> | <navSign /> | ||
− | <P>11643757,3992702</P> | + | <\P>11643757,3992702</\P> |
<next>11643463,3992709</next> | <next>11643463,3992709</next> | ||
</item> | </item> | ||
第76行: | 第76行: | ||
<type>0</type> | <type>0</type> | ||
</xml> | </xml> | ||
− | |||
=== 使用示例=== | === 使用示例=== | ||
需修改appkey | 需修改appkey | ||
*xml: curl -u username:password http://api.map.sina.com.cn/i/route.php?beginxy=11635442,3988904&endxy=11634171,3958904&appkey=appkey | *xml: curl -u username:password http://api.map.sina.com.cn/i/route.php?beginxy=11635442,3988904&endxy=11634171,3958904&appkey=appkey |
2010年6月28日 (一) 17:52的版本
目录 |
Location/route
驾车路线查询接口。
URL
http://api.map.sina.com.cn/i/route.php
格式
xml
HTTP请求方式
GET
是否需要登录
false
请求数限制
true
请求参数
- city1(city2):起(终)点所在城市代码,默认为0010(北京)
- begin_id(end_id): 起(终)点的id(与city1(city2)结合使用,会覆盖beginxy(endxy))
- beginxy(endxy): 起(终)点的坐标(逗号分隔,若有id以id为准)
- t: 查询类型(0:速度优先,1:费用优先,2:距离优先)
返回结果
XML示例:
<?xml version="1.0" encoding="utf-8" ?> <xml> <list> <item> <seg_id>1</seg_id> <seg_Length>34</seg_Length> <roadSign>行驶时间;等级方向;坐标点;</roadSign> <sTime>1</sTime> <sGrade>主要道路</sGrade> <sDirection>南</sDirection> <roadName>吉市口路</roadName> <segline>11643755,3992733;11643757,3992702</segline> <action /> <accessInfo /> <navSign /> <\P>11643755,3992733</\P> <next>11643757,3992702</next> </item> <item> <seg_id>2</seg_id> <seg_Length>250</seg_Length> <roadSign>行驶时间;等级方向;坐标点;道路名称;</roadSign> <sTime>1</sTime> <sGrade>主要道路</sGrade> <sDirection>西</sDirection> <roadName /> <segline>11643757,3992702;11643757,3992702;11643704,3992703;11643463,3992709</segline> <action>右转</action> <accessInfo>无辅助动作</accessInfo> <navSign /> <\P>11643757,3992702</\P> <next>11643463,3992709</next> </item> </list> <statusInfo>0</statusInfo> <midsxy /> <total>11</total> <segNum>11</segNum> <distance>26296</distance> <time>30</time> <pathstr>11643755,3992733;11643757,3992702;11643757,3992702;……</pathstr> <startxy>11643755,3992733</startxy> <endxy>11619215,3992640</endxy> <result>1</result> <type>0</type> </xml>
使用示例
需修改appkey
- xml: curl -u username:password http://api.map.sina.com.cn/i/route.php?beginxy=11635442,3988904&endxy=11634171,3958904&appkey=appkey