WS_Market
Click here for a complete list of operations.
getTransitRoutingPaths_RT
依據轉乘工具及規劃設定,加上起點/終點資訊,取得"輸入時間"可轉乘路徑規劃結果
傳入參數
註: 1.5公里以內沒站牌就不會運算參數名稱 參數型態 參數說明 nCategoryBits int 可使用之轉乘工具
市區公車:0x1
捷運:0x2
長途客運:0x4
火車:0x8
高鐵:0x16
飛機:0x32
船舶:0x64nRoutePlan int 路徑規劃設定,最快速:1, 最省錢:2, 最少轉乘次數:3 strStartPoint string 起點經緯度
緯度X1000000,經度 X1000000,關鍵字(非必填),類型(0:道路與地址,1:POI,非必填)
Ex1:"25000000,121000000" 直接用經緯度查規劃。
EX2:"25000000,121000000,中華電信,1" 查詢離此經緯度最近之POI關鍵字為中華電信之景點
EX3:"25000000,121000000,羅斯福路100號,0" 查詢離此經緯度最近之地址關鍵字為羅斯福路100號之地址strEndPoint string 終點經緯度
緯度X1000000,經度 X1000000,關鍵字(非必填),類型(0:道路與地址,1:POI,非必填)
Ex1:"25000000,121000000" 直接用經緯度查規劃。
EX2:"25000000,121000000,中華電信,1" 查詢離此經緯度最近之POI關鍵字為中華電信之景點
EX3:"25000000,121000000,羅斯福路100號,0" 查詢離此經緯度最近之地址關鍵字為羅斯福路100號之地址
RouteNum int 轉乘規劃的結果數 RequestTime dateTime 轉乘的時間
參數輸入範例
範例 1:直接用經緯度查規劃參數 值 nCategoryBits 2 nRoutePlan 3 strStartPoint 25026842,121520515 strEndPoint 25028835,121522003
RouteNum 3 RequestTime 2014-09-30T13:23:00
範例 2:查詢離此經緯度最近之關鍵字之景點參數 值 nCategoryBits 1 nRoutePlan 1 strStartPoint 25020650,121528533,羅斯福路,1 strEndPoint 25020650,121528533,羅斯福路,1
RouteNum 3
RequestTime
2014-09-30T13:23:00
回傳格式
第一部分為筆數回傳值 說明 result 筆數
第二部分為多筆資料 JSONArray格式
起/終點正確並查得規劃路線資料回傳值 說明 routes 路線
多筆可能起點或終點回傳值 說明 start_points 起點 end_points 終點
回傳範例
範例 1:直接用經緯度查規劃
[
{
"result":3,
"routes":[
{
"points":[
{
"id":0,
"name":"起點",
"region":0,
"lat":25026842,
"lon":121520515
},
{
"id":508379,
"name":"捷運古亭站(出入口8)",
"region":3,
"lat":25026356,
"lon":121522872
},
{
"id":508379,
"name":"捷運古亭站(出入口7)",
"region":3,
"lat":25026356,
"lon":121522872
},
{
"id":0,
"name":"終點",
"region":0,
"lat":25028835,
"lon":121522003
}
],
"lines":[
{
"RouteID":0,
"name":"步行",
"category":0,
"period":4,
"price":0,
"schedule":"258"
},
{
"RouteID":50004,
"name":"捷運小南門線[台電大樓-西門]",
"category":1102,
"period":1,
"price":-1,
"schedule":"頭末班車:06:00-24:00 發車班距:尖峰6-7分 離峰8-12分 例假日8-12分"
},
{
"RouteID":0,
"name":"步行",
"category":0,
"period":5,
"price":0,
"schedule":"304"
}
]
}
]
}
]
範例 2:查詢離此經緯度最近之關鍵字之POI
[ { "result":2, "start_points:":[ { "Name":"羅斯福路匝道北上入口", "type":"道路施設/資訊", "Lat":25021018, "Lon":121530921, "Region":2 }, { "Name":"羅斯福路匝道南下出口", "type":"道路施設/資訊", "Lat":25021456, "Lon":121531154, "Region":2 }, { "Name":"羅斯福路三段停車場", "type":"汽車停車場", "Lat":25022345, "Lon":121525584, "Region":3 }, { "Name":"羅斯福路三段停車場", "type":"汽車停車場", "Lat":25017056, "Lon":121532607, "Region":2 }, { "Name":"羅斯福路停車場", "type":"汽車停車場", "Lat":25025467, "Lon":121523887, "Region":2 }, { "Name":"羅斯福路派出所", "type":"軍警單位", "Lat":25011150, "Lon":121537997, "Region":2 }, { "Name":"羅斯福路六段北上入口", "type":"道路施設/資訊", "Lat":25000099, "Lon":121535299, "Region":7 }, { "Name":"協和汽車羅斯福路廠", "type":"汽車維修保養廠", "Lat":25002641, "Lon":121538933, "Region":7 } ], "end_points:":[ { "Name":"羅斯福路匝道北上入口", "type":"道路施設/資訊", "Lat":25021018, "Lon":121530921, "Region":2 }, { "Name":"羅斯福路匝道南下出口", "type":"道路施設/資訊", "Lat":25021456, "Lon":121531154, "Region":2 }, { "Name":"羅斯福路三段停車場", "type":"汽車停車場", "Lat":25022345, "Lon":121525584, "Region":3 }, { "Name":"羅斯福路三段停車場", "type":"汽車停車場", "Lat":25017056, "Lon":121532607, "Region":2 }, { "Name":"羅斯福路停車場", "type":"汽車停車場", "Lat":25025467, "Lon":121523887, "Region":2 }, { "Name":"羅斯福路派出所", "type":"軍警單位", "Lat":25011150, "Lon":121537997, "Region":2 }, { "Name":"羅斯福路六段北上入口", "type":"道路施設/資訊", "Lat":25000099, "Lon":121535299, "Region":7 }, { "Name":"協和汽車羅斯福路廠", "type":"汽車維修保養廠", "Lat":25002641, "Lon":121538933, "Region":7 } ] } ]
Test
The test form is only available for requests from the local machine.SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /WS_Market.asmx HTTP/1.1 Host: transittw.localking.com.tw Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://www.gotcha.com.tw/WS_Transit/getTransitRoutingPaths_RT" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <AuthHeaderMarket xmlns="http://www.gotcha.com.tw/WS_Transit"> <Username>string</Username> <HashKey>string</HashKey> <Password>string</Password> </AuthHeaderMarket> </soap:Header> <soap:Body> <getTransitRoutingPaths_RT xmlns="http://www.gotcha.com.tw/WS_Transit"> <nCategoryBits>int</nCategoryBits> <nRoutePlan>int</nRoutePlan> <strStartPoint>string</strStartPoint> <strEndPoint>string</strEndPoint> <RouteNum>int</RouteNum> <RequestTime>dateTime</RequestTime> </getTransitRoutingPaths_RT> </soap:Body> </soap:Envelope>
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getTransitRoutingPaths_RTResponse xmlns="http://www.gotcha.com.tw/WS_Transit"> <getTransitRoutingPaths_RTResult>string</getTransitRoutingPaths_RTResult> </getTransitRoutingPaths_RTResponse> </soap:Body> </soap:Envelope>
SOAP 1.2
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /WS_Market.asmx HTTP/1.1 Host: transittw.localking.com.tw Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Header> <AuthHeaderMarket xmlns="http://www.gotcha.com.tw/WS_Transit"> <Username>string</Username> <HashKey>string</HashKey> <Password>string</Password> </AuthHeaderMarket> </soap12:Header> <soap12:Body> <getTransitRoutingPaths_RT xmlns="http://www.gotcha.com.tw/WS_Transit"> <nCategoryBits>int</nCategoryBits> <nRoutePlan>int</nRoutePlan> <strStartPoint>string</strStartPoint> <strEndPoint>string</strEndPoint> <RouteNum>int</RouteNum> <RequestTime>dateTime</RequestTime> </getTransitRoutingPaths_RT> </soap12:Body> </soap12:Envelope>
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <getTransitRoutingPaths_RTResponse xmlns="http://www.gotcha.com.tw/WS_Transit"> <getTransitRoutingPaths_RTResult>string</getTransitRoutingPaths_RTResult> </getTransitRoutingPaths_RTResponse> </soap12:Body> </soap12:Envelope>