はじめに
定期券
交通費精算(定期区間控除)
通勤費管理(定期代支給)
探索
運賃
探索結果
探索条件
地点
路線
路線図

経路探索結果から通過駅・停車駅一覧を取得する

経路探索結果から、通過する駅と停車する駅の一覧を取得します。

関連URL

手順

1. 経路探索を行う

経路探索を行います。 リクエスト例では、以下の駅を指定して探索を行います。

  • 出発駅: 下北沢(駅コード: 22723)
  • 経由駅: 新宿(駅コード: 22741)
  • 到着駅: 高円寺(駅コード: 22671)

駅コード駅情報駅簡易情報から取得できます。

リクエスト例では経路探索平均待ち時間による探索を利用していますが、 ダイヤによる探索平均待ち時間による探索はどちらも利用可能なため、 経路簡易探索平均待ち時間探索でも可能です。

GET /v1/search/course/extreme?viaList=22723:22741:22671&searchType=plain
<ResultSet apiVersion="1.27.0.0" engineVersion="201701_02a">
<Course searchType="plain" dataType="plain">
<Route timeOther="12" timeOnBoard="13" exhaustCO2="235" index="1" exhaustCO2atPassengerCar="1797" distance="107" timeWalk="0" transferCount="1">
<Point index="1">
<Station code="22723">
<Name>下北沢</Name>
<Type>train</Type>
<Yomi>しもきたざわ</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.40.10.59" lati="35.39.30.19" longi_d="139.66961" gcs="tokyo" lati_d="35.658389"/>
</Point>
<Line direction="Up" stopStationCount="1" teiki3Index="1" teiki6Index="1" timeOnBoard="7" exhaustCO2="107" fareIndex="1" index="1" exhaustCO2atPassengerCar="823" distance="49" teiki1Index="1">
<Name>小田急小田原線快速急行</Name>
<Type>train</Type>
<ArrivalState>
<Type>normal</Type>
<Datetime operation="today">2016-12-27</Datetime>
</ArrivalState>
<Destination/>
<TypicalName>小田急小田原線快速急行</TypicalName>
<TimeReliability>none</TimeReliability>
<DepartureState>
<Type>normal</Type>
<Datetime operation="today">2016-12-27</Datetime>
</DepartureState>
:
<Color>013087206</Color>
:
<SerializeData>経路シリアライズデータ</SerializeData>
:

2. 通過駅一覧を取得する

通過駅情報を利用して、通過する駅と停車する駅の一覧を取得します。

sectionIndexパラメータに、1のレスポンスで取得できる区間インデックスResultSet/Course/Route/Line/indexを指定すると、指定した区間のみを取得することができます。

GET /v1/xml/course/passStation?serializeData=1で取得できる経路シリアライズデータを入れてください
<ResultSet apiVersion="1.27.0.0" engineVersion="201701_02a">
<Point index="1">
<Station code="22723">
<Name>下北沢</Name>
<Type>train</Type>
<Yomi>しもきたざわ</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.40.10.59" lati="35.39.30.19" longi_d="139.66961" lati_d="35.658389" gcs="tokyo"/>
</Point>
<Point index="2">
<Station code="22929">
<Name>東北沢</Name>
<Type>train</Type>
<Yomi>ひがしきたざわ</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.40.34.59" lati="35.39.43.89" longi_d="139.676277" lati_d="35.662194" gcs="tokyo"/>
</Point>
<Point index="3">
<Station code="23044">
<Name>代々木上原</Name>
<Type>train</Type>
<Yomi>よよぎうえはら</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.40.59.19" lati="35.39.56.69" longi_d="139.683111" lati_d="35.66575" gcs="tokyo"/>
</Point>
<Point index="4">
<Station code="23046">
<Name>代々木八幡</Name>
<Type>train</Type>
<Yomi>よよぎはちまん</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.41.30.50" lati="35.39.58.50" longi_d="139.691806" lati_d="35.66625" gcs="tokyo"/>
</Point>
<Point index="5">
<Station code="22702">
<Name>参宮橋</Name>
<Type>train</Type>
<Yomi>さんぐうばし</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.41.49.0" lati="35.40.31.29" longi_d="139.696944" lati_d="35.67536" gcs="tokyo"/>
</Point>
<Point index="6">
<Station code="22993">
<Name>南新宿</Name>
<Type>train</Type>
<Yomi>みなみしんじゅく</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.42.7.69" lati="35.40.49.39" longi_d="139.702139" lati_d="35.680388" gcs="tokyo"/>
</Point>
<Point index="7">
<Station code="22741">
<Name>新宿</Name>
<Type>train</Type>
<Yomi>しんじゅく</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.42.11.0" lati="35.41.15.0" longi_d="139.703056" lati_d="35.6875" gcs="tokyo"/>
</Point>
<Point index="8">
<Station code="22558">
<Name>大久保(東京都)</Name>
<Type>train</Type>
<Yomi>おおくぼ</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.42.2.9" lati="35.41.51.0" longi_d="139.700583" lati_d="35.6975" gcs="tokyo"/>
</Point>
<Point index="9">
<Station code="22936">
<Name>東中野</Name>
<Type>train</Type>
<Yomi>ひがしなかの</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.41.12.50" lati="35.42.11.0" longi_d="139.686806" lati_d="35.703056" gcs="tokyo"/>
</Point>
<Point index="10">
<Station code="22849">
<Name>中野(東京都)</Name>
<Type>train</Type>
<Yomi>なかの</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.40.9.0" lati="35.42.9.29" longi_d="139.669167" lati_d="35.702582" gcs="tokyo"/>
</Point>
<Point index="11">
<Station code="22671">
<Name>高円寺</Name>
<Type>train</Type>
<Yomi>こうえんじ</Yomi>
</Station>
<Prefecture code="13">
<Name>東京都</Name>
</Prefecture>
<GeoPoint longi="139.39.10.89" lati="35.42.7.59" longi_d="139.653027" lati_d="35.70211" gcs="tokyo"/>
</Point>
</ResultSet>
ページ上部へ