利用開始
このセクションでは、 HERE platform で Intermodal Routing API V8 を使用してはじめにをすばやく実行する方法について説明します。
- HERE アカウントを取得する
- プロジェクトを作成します
- API キー を入手する
- リクエストを送信します
HERE アカウントを取得する
フレキシブル HERE 基本プランから無料の HERE platform アカウントを使用し作成できます。 詳細については、 HERE 基本プランの価格表を参照してください。 または、会社がすでに HERE platform 組織を作成している場合は、組織管理者に連絡して、会社の組織に参加するよう招待してください。
プロジェクトを作成する
プロジェクトを作成するには、次の手順に従います。
- HERE アカウントを使用して HERE platform にサインイン。
- ランチャーから[プロジェクトマネージャ]を開きます。
- [ 新しいプロジェクトを作成] をクリックする。
- プロジェクトの名前を入力する。プロジェクト名は一意である必要はありません。
- プロジェクト ID を入力します。 プロジェクト ID は組織内で一意である必要があり、組織の有効期間中は変更できません。プロジェクト ID の長さは 4 ~ 16 文字である必要があります。
- 任意 :任意の説明を入力します。
- [保存]をクリックする。
API キー を入手する
API キー を取得するには、次の手順を実行します。
- HERE アカウントを使用して HERE platform にサインイン。
- ランチャから [アクセスマネージャ] を選択します。
- [ アプリ] タブを選択し、[ 新しいアプリ を登録 ] をクリックします。
- アプリ の名前を入力します。
- オプション: アプリ の説明を入力します。
- オプション : 前の手順で作成したプロジェクトを 、プロジェクト フィールドへの既定のアクセス権から選択します。
- [ 登録] をクリックします HERE platform によって、一意のアプリ ID を持つ新しいアプリ が作成されます。
- [資格情報]タブで 、[API Keys]を選択 し、[API キーを生成]をクリック して、アプリケーション認証資格情報用に 最大 2 つのAPI キーを生成します。API キー が作成され、表示されます。
リクエストを送信する
この例は、ベルリンミッテの HERE キャンパスから始まり、ドイツの首都に近いポツダムへのルートを提供します。 この例では、ポツダムに到達するための少なくとも 3 つの方法を知りたいと考えています。
GET https://intermodal.router.hereapi.com/v8/routes
?apiKey={YOUR_API_KEY}
&alternatives=1
&destination=52.40358749909618,13.058351363288239
&origin=52.53105637575095,13.384944833815183
デフォルト では、 Intermodal Routing API V8 は最適なモーダル間ルートを 1 つだけ返します。 オプションのパラメータ alternatives
は、最適なルートとともに戻る代替ルートの数を表します。 デフォルトでは、に設定 alternatives=0
されています。 alternatives=2
パラメーターを渡した後、 Intermodal Routing API V8 のルーターは 、地域で利用可能なすべてのトランスポートタイプを使用して、最適な 3 つのモーダル間ルートを計算します。
モーダル間ルートの計算が成功した場合、 /routes
応答には計算されたルートについて要求された詳細情報が含まれます。
- 3 つの最適なモーダル間ルート。
- 以下の輸送タイプの 1 つまたは組み合わせ。各輸送タイプには、出発時間と到着時間、所要時間、座標、およびその他のセクション情報が含まれています。
taxi
transit
vehicle
rented
pedestrian
- 代替品に含まれているサービスを実行するオペレータのセット。オペレータコード、オペレータ名、オペレータの Web サイトへのリンク ( 存在する場合 ) などが含まれます。
注
複数のオプションのパラメータ ( 特に departureTime
arrivalTime
、、 ) を指定しないため <transport-type>[enable]=<route-section>
、以下に示すような出力結果が返されない場合があります。
{
"routes": [
{
"id": "R00347b-C0",
"sections": [
{
"id": "R00347b-C0-S0",
"type": "pedestrian",
"notices": [
{
"code": "walkOptionViolated"
}
],
"departure": {
"time": "2020-04-28T17:53:00+02:00",
"place": {
"type": "place",
"location": {
"lat": 52.531055,
"lng": 13.384947
}
}
},
"arrival": {
"time": "2020-04-28T17:57:00+02:00",
"place": {
"name": "U Naturkundemuseum [Invalidenstr.]",
"type": "station",
"location": {
"lat": 52.530336,
"lng": 13.382223
},
"id": "vbb_900100709"
}
}
},
{
"id": "R00347b-C0-S1",
"type": "transit",
"departure": {
"time": "2020-04-28T17:57:00+02:00",
"place": {
"name": "U Naturkundemuseum [Invalidenstr.]",
"type": "station",
"location": {
"lat": 52.530336,
"lng": 13.382223
},
"id": "vbb_900100709"
},
"delay": 0
},
"arrival": {
"time": "2020-04-28T18:01:00+02:00",
"place": {
"name": "S+U Berlin Hauptbahnhof",
"type": "station",
"location": {
"lat": 52.52585,
"lng": 13.368928
},
"id": "vbb_900003201"
},
"delay": 0
},
"transport": {
"mode": "lightRail",
"name": "Tram M10",
"category": "Tram",
"color": "#DF6A1C",
"textColor": "#FFFFFF",
"headsign": "S+U Hauptbahnhof"
},
"agency": {
"id": "BVG",
"name": "Berliner Verkehrsbetriebe"
}
},
{
"id": "R00347b-C0-S2",
"type": "transit",
"departure": {
"time": "2020-04-28T18:12:00+02:00",
"place": {
"name": "S+U Berlin Hauptbahnhof",
"type": "station",
"location": {
"lat": 52.52585,
"lng": 13.368928
},
"id": "vbb_900003201",
"platform": "14"
},
"delay": 60
},
"arrival": {
"time": "2020-04-28T18:36:00+02:00",
"place": {
"name": "S Potsdam Hauptbahnhof",
"type": "station",
"location": {
"lat": 52.390931,
"lng": 13.067187
},
"id": "vbb_900230999",
"platform": "3"
},
"delay": 0
},
"transport": {
"mode": "regionalTrain",
"name": "RE1",
"category": "RE",
"color": "#D7081D",
"textColor": "#FFFFFF",
"headsign": "Magdeburg, Hauptbahnhof"
},
"agency": {
"id": "DB",
"name": "DB Regio AG"
}
},
{
"id": "R00347b-C0-S3",
"type": "transit",
"departure": {
"time": "2020-04-28T18:42:00+02:00",
"place": {
"name": "S Potsdam Hauptbahnhof",
"type": "station",
"location": {
"lat": 52.390931,
"lng": 13.067187
},
"id": "vbb_900230999",
"platform": "2"
}
},
"arrival": {
"time": "2020-04-28T18:49:00+02:00",
"place": {
"name": "Potsdam, Nauener Tor",
"type": "station",
"location": {
"lat": 52.403102,
"lng": 13.057919
},
"id": "vbb_900230022"
}
},
"transport": {
"mode": "lightRail",
"name": "Tram 96",
"category": "Tram",
"color": "#CC0A22",
"textColor": "#FFFFFF",
"headsign": "Potsdam, Campus Jungfernsee"
},
"agency": {
"id": "ViP",
"name": "Verkehrsbetrieb Potsdam GmbH"
}
},
{
"id": "R00347b-C0-S4",
"type": "pedestrian",
"notices": [
{
"code": "walkOptionViolated"
}
],
"departure": {
"time": "2020-04-28T18:49:00+02:00",
"place": {
"name": "Potsdam, Nauener Tor",
"type": "station",
"location": {
"lat": 52.403102,
"lng": 13.057919
},
"id": "vbb_900230022"
}
},
"arrival": {
"time": "2020-04-28T18:51:00+02:00",
"place": {
"type": "place",
"location": {
"lat": 52.403588,
"lng": 13.058351
}
}
}
}
]
},
{
"id": "R00347b-C1",
"sections": [
{
"id": "R00347b-C1-S0",
"type": "pedestrian",
"notices": [
{
"code": "walkOptionViolated"
}
],
"departure": {
"time": "2020-04-28T18:03:00+02:00",
"place": {
"type": "place",
"location": {
"lat": 52.531055,
"lng": 13.384947
}
}
},
"arrival": {
"time": "2020-04-28T18:07:00+02:00",
"place": {
"name": "U Naturkundemuseum [Invalidenstr.]",
"type": "station",
"location": {
"lat": 52.530336,
"lng": 13.382223
},
"id": "vbb_900100709"
}
}
},
{
"id": "R00347b-C1-S1",
"type": "transit",
"departure": {
"time": "2020-04-28T18:07:00+02:00",
"place": {
"name": "U Naturkundemuseum [Invalidenstr.]",
"type": "station",
"location": {
"lat": 52.530336,
"lng": 13.382223
},
"id": "vbb_900100709"
},
"delay": 0
},
"arrival": {
"time": "2020-04-28T18:11:00+02:00",
"place": {
"name": "S+U Berlin Hauptbahnhof",
"type": "station",
"location": {
"lat": 52.52585,
"lng": 13.368928
},
"id": "vbb_900003201"
},
"delay": 0
},
"transport": {
"mode": "lightRail",
"name": "Tram M10",
"category": "Tram",
"color": "#DF6A1C",
"textColor": "#FFFFFF",
"headsign": "S+U Hauptbahnhof"
},
"agency": {
"id": "BVG",
"name": "Berliner Verkehrsbetriebe"
}
},
{
"id": "R00347b-C1-S2",
"type": "transit",
"departure": {
"time": "2020-04-28T18:17:00+02:00",
"place": {
"name": "S+U Berlin Hauptbahnhof",
"type": "station",
"location": {
"lat": 52.52585,
"lng": 13.368928
},
"id": "vbb_900003201",
"platform": "16"
},
"delay": 0
},
"arrival": {
"time": "2020-04-28T18:52:00+02:00",
"place": {
"name": "S Potsdam Hauptbahnhof",
"type": "station",
"location": {
"lat": 52.390931,
"lng": 13.067187
},
"id": "vbb_900230999",
"platform": "6"
},
"delay": 0
},
"transport": {
"mode": "cityTrain",
"name": "S7",
"category": "S-Bahn",
"color": "#7760B0",
"textColor": "#FFFFFF",
"headsign": "S Potsdam Hauptbahnhof"
},
"agency": {
"id": "DBS",
"name": "S-Bahn Berlin GmbH"
}
},
{
"id": "R00347b-C1-S3",
"type": "transit",
"departure": {
"time": "2020-04-28T18:57:00+02:00",
"place": {
"name": "S Potsdam Hauptbahnhof",
"type": "station",
"location": {
"lat": 52.390931,
"lng": 13.067187
},
"id": "vbb_900230999",
"platform": "2"
},
"delay": 0
},
"arrival": {
"time": "2020-04-28T19:04:00+02:00",
"place": {
"name": "Potsdam, Nauener Tor",
"type": "station",
"location": {
"lat": 52.403102,
"lng": 13.057919
},
"id": "vbb_900230022"
},
"delay": 0
},
"transport": {
"mode": "lightRail",
"name": "Tram 92",
"category": "Tram",
"color": "#CC0A22",
"textColor": "#FFFFFF",
"headsign": "Potsdam, Kirschallee"
},
"agency": {
"id": "ViP",
"name": "Verkehrsbetrieb Potsdam GmbH"
}
},
{
"id": "R00347b-C1-S4",
"type": "pedestrian",
"notices": [
{
"code": "walkOptionViolated"
}
],
"departure": {
"time": "2020-04-28T19:04:00+02:00",
"place": {
"name": "Potsdam, Nauener Tor",
"type": "station",
"location": {
"lat": 52.403102,
"lng": 13.057919
},
"id": "vbb_900230022"
}
},
"arrival": {
"time": "2020-04-28T19:06:00+02:00",
"place": {
"type": "place",
"location": {
"lat": 52.403588,
"lng": 13.058351
}
}
}
}
]
}
]
}
次のステップ
この開発者ガイド では、次に示す Intermodal Routing API の最も一般的な使用例を参照することをお勧めします。 駐車、乗馬、 タクシー、乗り物、バイク & ライドが含まれています。 API リクエストで使用されているパラメータと、レスポンスで提供されているデータの完全なリストについて は、『 HERE Intermodal Routing API リファレンス 』を参照してください。