WS_Market


Click here for a complete list of operations.

getTransitRoutingPaths

依據轉乘工具及規劃設定,加上起點/終點資訊,取得"當前時間"可轉乘路徑規劃結果

傳入參數
參數名稱參數型態參數說明
nCategoryBitsint可使用之轉乘工具
市區公車:0x1
捷運:0x2
長途客運:0x4
火車:0x8
高鐵:0x16
飛機:0x32
船舶:0x64
nRoutePlanint路徑規劃設定,最快速:1, 最省錢:2, 最少轉乘次數:3
strStartPointstring起點經緯度
緯度X1000000,經度 X1000000,關鍵字(非必填),類型(0:道路與地址,1:POI,非必填)
Ex1:"25000000,121000000" 直接用經緯度查規劃。
EX2:"25000000,121000000,中華電信,1" 查詢離此經緯度最近之POI關鍵字為中華電信之景點
EX3:"25000000,121000000,羅斯福路100號,0" 查詢離此經緯度最近之地址關鍵字為羅斯福路100號之地址
strEndPointstring終點經緯度
緯度X1000000,經度 X1000000,關鍵字(非必填),類型(0:道路與地址,1:POI,非必填)
Ex1:"25000000,121000000" 直接用經緯度查規劃。
EX2:"25000000,121000000,中華電信,1" 查詢離此經緯度最近之POI關鍵字為中華電信之景點
EX3:"25000000,121000000,羅斯福路100號,0" 查詢離此經緯度最近之地址關鍵字為羅斯福路100號之地址
註: 1.5公里以內沒站牌就不會運算

參數輸入範例
範例 1:直接用經緯度查規劃
參數
nCategoryBits2
nRoutePlan3
strStartPoint25026842,121520515
strEndPoint25028835,121522003

範例 2:查詢離此經緯度最近之關鍵字之景點
參數
nCategoryBits1
nRoutePlan1
strStartPoint25020650,121528533,羅斯福路,1
strEndPoint25020650,121528533,羅斯福路,1

回傳格式
第一部分為筆數
回傳值說明
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":25026357,"lon":121522873},{"id":508379,"name":"捷運古亭站(出口7)","region":3,"lat":25026357,"lon":121522873},{"id":0,"name":"終點","region":0,"lat":25028835,"lon":121522003}],"lines":[{"RouteID":0,"name":"步行","category":0,"period":4,"price":0,"schedule":"258"},{"RouteID":50001,"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}],"end_points:":[{"Name":"羅斯福路匝道北上入口","type":"道路施設/資訊","Lat":25021018,"Lon":121530921,"Region":2},{"Name":"羅斯福路匝道南下出口","type":"道路施設/資訊","Lat":25021456,"Lon":121531154,"Region":2}]}]

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"

<?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 xmlns="http://www.gotcha.com.tw/WS_Transit">
      <nCategoryBits>int</nCategoryBits>
      <nRoutePlan>int</nRoutePlan>
      <strStartPoint>string</strStartPoint>
      <strEndPoint>string</strEndPoint>
    </getTransitRoutingPaths>
  </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>
    <getTransitRoutingPathsResponse xmlns="http://www.gotcha.com.tw/WS_Transit">
      <getTransitRoutingPathsResult>string</getTransitRoutingPathsResult>
    </getTransitRoutingPathsResponse>
  </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 xmlns="http://www.gotcha.com.tw/WS_Transit">
      <nCategoryBits>int</nCategoryBits>
      <nRoutePlan>int</nRoutePlan>
      <strStartPoint>string</strStartPoint>
      <strEndPoint>string</strEndPoint>
    </getTransitRoutingPaths>
  </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>
    <getTransitRoutingPathsResponse xmlns="http://www.gotcha.com.tw/WS_Transit">
      <getTransitRoutingPathsResult>string</getTransitRoutingPathsResult>
    </getTransitRoutingPathsResponse>
  </soap12:Body>
</soap12:Envelope>