コンテンツにスキップ

多地点巡回ルート検索(車)

/round_route_car [POST] [GET]

基本情報

概要

自動車を移動手段として、2地点間のルートを検索します。 /route_carよりも多くの経由地指定が可能です。

リクエスト回数について

本APIはルート検索に時間を要する場合があるため、1回のルート検索につき2回のリクエストが必要になります。
1回目はPOST形式で検索リクエストを受け付け、2回目はGET形式で検索結果を返却します。

実装のヒント

サンプルページはこちらからご確認いただけます。

URL

https://{HOST}/{CID}/v1/round_route_car

※APIマーケットでは提供しておりません

出力形式

  • JSON

対応言語

  • ja

1回目のリクエスト

パラメータ [POST]

  • 「ルート検索(車)/route_car」と同等のパラメータを受け付けます

Content-Typeヘッダーにapplication/x-www-form-urlencodedを指定し、 リクエストボディにパラメータを指定して送信してください。

 

signature及びrequest_codeはリクエストボディではなく、クエリパラメータに指定してください。

経由地の指定方法について

経由地指定の上限数は150地点です。
出発地点、到着地点は含みません。
150地点以上の経由地を指定するとエラーとなります。

レスポンス [POST]

名称 レスポンス名 型名 配列 説明
ルート検索ID processing_id 文字列 リクエストを受け付けたルート検索ごとに発行されるID

レスポンス例

{"processing_id": "8405511d33ebba6e122436b74cb6a215460609b6725b41a9d0ee0bf0b3f85ee9"}

2回目のリクエスト

パラメータ [GET]

パラメータ名 必須 概要 型名 デフォルト値 上下限/選択値 備考
processing_id ルート検索ID 文字列 POSTリクエストで取得したIDを指定してください

パラメータ構成例

/round_route_car?processing_id=8405511d33ebba6e122436b74cb6a215460609b6725b41a9d0ee0bf0b3f85ee9

レスポンス [GET]

  • ルート検索が正常に完了している場合、レスポンスは/route_carと同様です。
  • shape=trueを指定した場合はshapes(ルート形状)が出力されます。shapesは/shape_carのGeoJSON形式のレスポンスと同様です。

レスポンス例

・shape=trueを指定の場合

{
    "items": [
        {
            "summary": {
                "no": "1",
                "start": {
                    "type": "point",
                    "coord": {
                        "lat": 35.676028,
                        "lon": 139.740678
                    },
                    "name": "start"
                },
                "goal": {
                    "type": "point",
                    "coord": {
                        "lat": 35.663267,
                        "lon": 139.775531
                    },
                    "name": "goal"
                },
                "move": {
                    "toll_road_distance": 0,
                    "type": "move",
                    "from_time": "2022-01-22T02:00:00+09:00",
                    "to_time": "2022-01-22T02:14:34+09:00",
                    "time": 14,
                    "distance": 4520,
                    "other_fare": {
                        "taxi": 1860
                    }
                },
                "via": [
                    {
                        "from_time": "2022-01-22T02:00:00+09:00",
                        "to_time": "2022-01-22T02:00:00+09:00",
                        "type": "point",
                        "coord": {
                            "lat": 35.676028,
                            "lon": 139.740678
                        },
                        "name": "経由地"
                    },
                    {
                        "from_time": "2022-01-22T02:02:02+09:00",
                        "to_time": "2022-01-22T02:02:02+09:00",
                        "type": "point",
                        "coord": {
                            "lat": 35.675967,
                            "lon": 139.742164
                        },
                        "name": "経由地"
                    }
                ]
            },
            "sections": [
                {
                    "type": "point",
                    "coord": {
                        "lat": 35.676028,
                        "lon": 139.740678
                    },
                    "name": "start"
                },
                {
                    "type": "move",
                    "move": "car",
                    "from_time": "2022-01-22T02:00:00+09:00",
                    "to_time": "2022-01-22T02:00:00+09:00",
                    "time": 0,
                    "distance": 0,
                    "line_name": "車"
                },
                {
                    "type": "point",
                    "coord": {
                        "lat": 35.676028,
                        "lon": 139.740678
                    },
                    "name": "経由地",
                    "with_via": true,
                    "stay_time": 0
                },
                {
                    "type": "move",
                    "move": "car",
                    "from_time": "2022-01-22T02:00:00+09:00",
                    "to_time": "2022-01-22T02:02:02+09:00",
                    "time": 2,
                    "distance": 561,
                    "line_name": "車"
                },
                {
                    "type": "point",
                    "coord": {
                        "lat": 35.675967,
                        "lon": 139.742164
                    },
                    "name": "経由地",
                    "with_via": true,
                    "stay_time": 0
                },
                {
                    "type": "move",
                    "move": "car",
                    "from_time": "2022-01-22T02:02:02+09:00",
                    "to_time": "2022-01-22T02:14:34+09:00",
                    "time": 12,
                    "distance": 3959,
                    "line_name": "車"
                },
                {
                    "type": "point",
                    "coord": {
                        "lat": 35.663267,
                        "lon": 139.775531
                    },
                    "name": "goal"
                }
            ],
            "shapes": {
                "type": "FeatureCollection",
                "features": [
                    {
                        "type": "Feature",
                        "bbox": [
                            139.740678,
                            35.676028,
                            139.741473,
                            35.676077
                        ],
                        "geometry": {
                            "type": "LineString",
                            "coordinates": [
                                [
                                    139.740678,
                                    35.676028
                                ],
                                [
                                    139.741473,
                                    35.676077
                                ]
                            ]
                        },
                        "properties": {
                            "ways": "car",
                            "section": "0001",
                            "inline": {
                                "line_style": "auxiliary",
                                "width": 5,
                                "color": "#D3D3D3",
                                "opacity": 1.0,
                                "strokelinecap": "round",
                                "strokelinejoin": "round"
                            },
                            "outline": {
                                "line_style": "solid",
                                "width": 10,
                                "color": "#898989",
                                "opacity": 1.0,
                                "strokelinecap": "round",
                                "strokelinejoin": "round"
                            },
                            "route_no": "1"
                        }
                    },
                    {
                    ...
                    },
                    ...
                ],
                "bbox": [
                    139.740678,
                    35.662681,
                    139.775531,
                    35.678119
                ]
            }
        }
    ],
    "unit": {
        "datum": "wgs84",
        "coord_unit": "degree",
        "distance": "metre",
        "time": "minute"
    }
}

ルート検索が完了していない場合、POSTリクエストと同様のレスポンス「processing_id」を返却します。
5分程度時間をおいてから再度リクエストを実行してください。

 

検索結果はリクエスト実行後、24時間で削除されます。