14 ルーティング・エンジン

Spatial and Graphルーティング・エンジン(ルーティング・エンジンとも呼ばれます)を使用すると、次の機能を提供するXMLベースのWebサービスをホストできます。

ノート:

Spatial and Graphのルーティング・エンジンは、サーバーレス・デプロイメントと専用デプロイメントの両方のOracle Autonomous Databaseでサポートされていません。
  • 単純ルート・リクエストでは、2つの場所間のルート情報が戻されます。

  • 単純マルチアドレス・ルート・リクエストでは、3つ以上の場所間のルート情報が戻されます。レスポンス内の場所の順序はユーザー指定であり、最適化されていません。

  • 巡回セールスマン(TSP)ルート・リクエストは、マルチアドレス・ルート・リクエストの1形式であり、これも3つ以上の場所間のルート情報を戻します。レスポンス内の一部またはすべての場所の順序を並べ替えて、全体的なルートを最適化できます。

  • 一括ルート・リクエストは、1つ以上の単純またはマルチアドレス・ルート・リクエストのバッチです。これは、単純、単純マルチアドレスおよびTSPの各リクエストの組合せにすることができます。個々のリクエストは単一のリクエストのように見えますが、<batch_route_request>要素にカプセル化されています。ルーティング・エンジンは、<batch_route_request>要素に埋め込まれた<route_request>要素を検出すると、一括リクエストをバッチ・モード・リクエストと区別します。

  • バッチ・モード・ルート・リクエストは複数のレスポンスを戻し、それぞれが同じ出発地を持ちますが、目的地は異なります。

すべてのリクエストについて、出発地、中間値および目的地は、住所、事前ジオコード済住所または経度/緯度座標で識別されます。

マルチアドレス・ルートについては、「ルーティング」を参照してください。

Oracleルーティング・エンジンは、Oracle WebLogic Serverなどのアプリケーション・サーバーでデプロイできるJava 2 Enterprise Edition (J2EE) Webアプリケーションとして実装されます。

図14-1に、ルーティング・エンジンを使用する基本的なアクション・フローを示します。クライアントは、リモートのルーティング・エンジン・インスタンスを探してルート・リクエストを送信し、ルーティング・エンジン・インスタンスから戻されたルート・レスポンスを処理します。

図14-1 Spatial and Graphルーティング・エンジンを使用した基本的なアクション・フロー

図14-1の説明が続きます
図14-1「Spatial and Graphルーティング・エンジンを使用した基本的なアクション・フロー」の説明

この章には、ルーティング・エンジンの管理に関する情報は含まれません。特殊なニーズを持つ上級ユーザー向けのこの情報は、「ルーティング・エンジン管理」にあります。

14.1 ルーティング

ルートは、場所要素間で計算されます。

<start_location><location> (中間地または中間地点)、<end_location>という3種類の場所要素があります。場所要素は、ジオコード化された住所、事前ジオコード済の住所、エッジID/パーセンテージのペアまたは逆ジオコード化された緯度/経度ペアとして指定できます。

ルーティング・エンジンでは、その計算に出発時間を組み込むことができます。たとえば、都市圏では、平日に自宅から空港まで自動車で行く場合の推定所要時間は、午前8時と午後7時で大きく異なります。時間の計算は、リアルタイムの収集データではなく、過去のトラフィック・パターンに基づきます。(たとえば、現在の事故や悪天候は考慮されません)。

このオプションの機能を含めるには、ルート・リクエストにstart_timeとオプションのstart_date値を指定し、return_route_timetrueに設定して(つまり、レスポンスに合計推定ルート時間を含める)、タイム・ゾーン・ユーザー・データを使用可能にします。return_route_timetrueで、出発時間が指定されない場合、ルート・リクエストが発行された時間が出発時間とみなされます。(関連する属性については、「ルーティング・エンジンのXML API」を参照してください。)

このオプション機能は、一括ルート・リクエストやバッチ・モード・リクエストには適用されません。

14.1.1 単純ルート・リクエスト

単純ルート・リクエストには、<start_location><end_location>の両方の要素が含まれます。単純ルート・リクエストのレスポンスは、出発地から目的地までの単一のルートです。

単純ルート・リクエスト内のいくつかの属性は、ルートの計算方法およびルート・レスポンスで戻される内容を制御します。これらの属性については、「ルーティング・エンジンのXML API」で説明しています。

14.1.2 単純マルチアドレス・ルート・リクエスト

単純マルチアドレス・ルート・リクエストには、必須の<start_location>要素など、少なくとも3つの場所が含まれている必要があります。マルチアドレス・ルート・リクエストには、1つ以上の<location>要素も含まれている必要があり、オプションで<end_location>要素が含まれます。

単純マルチアドレス・ルート・リクエストの結果は、各中間地を通る、出発地から目的地までの単一のルートです。この単一ルートは複数のサブルートで構成されます。サブルートは、個々の場所間のルートです。

単純マルチアドレス・ルート・リクエストでは、optimize_route属性が存在しないかFALSEに設定されている必要があります。単純マルチアドレス・ルート・リクエストでは、すべての場所が固定されます。場所を訪れる順序の最適化は試行されません。ルート内の場所は、リクエストで指定された順序で訪問されます。

単純マルチアドレス・ルート・リクエストでは、route_type属性を使用して、ルートを開いた行程または閉じた行程として分類します。

  • 開いた行程: ルートは最終中間地または指定した目的地で終了します。

  • 閉じた行程: ルートは出発地に戻ります。

    単純マルチアドレスの閉じた行程ルートがリクエストされた場合、ルート計算中に<start_location>要素指定は目的地としても使用されます。単純マルチアドレスの閉じた行程ルート・リクエストで<end_location>要素が指定されている場合は、エラーが戻されます。

例: 単純マルチアドレスの開いた行程ルート・リクエスト

職場から顧客Aまで運転し、次に顧客B、その次に顧客Cまで運転する必要があるとします。

  • ルート・リクエストには、職場が出発地、顧客AとBが中間地、そして顧客Cが目的地として含まれます。

  • 戻されるルートには、(1)職場から顧客A、(2)顧客Aから顧客Bおよび(3)顧客Bから顧客Cという3つのサブルートが含まれます。

  • 各サブルートには、複数のセグメントが含まれる場合があり、各セグメントは、特定の運転方向ステップに関連付けられます。

例: 単純マルチアドレスの閉じた行程ルート・リクエスト

職場から顧客Aまで運転し、次に顧客B、その次に顧客Cまで運転してから、職場に戻る必要があるとします。

  • ルート・リクエストには、職場が出発地、顧客A、B、Cが中間地として含まれます。職場は目的地としても使用されます。<end_location>要素はルート・リクエストで指定しないでください。ルーティング・エンジンは、閉じた行程のリクエストを検出すると、顧客Cから職場までのサブルートを自動的に追加します。

  • 戻されるルートには、(1)職場から顧客A、(2)顧客Aから顧客B、(3)顧客Bから顧客Cおよび(4)顧客Cから職場という4つのサブルートが含まれます。

  • 各サブルートには、複数のセグメントが含まれる場合があり、各セグメントは、特定の運転方向ステップに関連付けられます。

単純マルチアドレス・リクエストには、各サブルートに固有の複数の属性を含めることができます。これらの属性には、return_subroutesreturn_subroute_edge_idsおよびreturn_subroute_geometryが含まれます。これらの属性については、「ルート・リクエストXMLスキーマ定義」で説明しています。

14.1.3 巡回セールスマン(TSP)ルート・リクエスト

巡回セールスマン(TSP)ルート・リクエストには、少なくとも3つの場所が必要です。単純マルチアドレス・ルート・リクエストとは異なり、<start_location>要素はオプションです。

TSPルート・リクエストは、optimize_route属性が存在し、TRUEに設定されたマルチアドレス・リクエストです。TSPルート・リクエストは、リクエスト内の固定されていない場所を並べ替えて全体的なルートの最適化を試みます。

TSPリクエスト内のすべての場所は、非固定または固定として分類されます。

  • 非固定の場所: 場所が<location>要素で指定されている場合は、非固定の場所とみなされ、ルート計算時に並替えの対象となります。

  • 固定の場所: 場所が<start_location>または<end_location>要素で指定されている場合は、固定の場所とみなされ、ルート計算時に並替えの対象になりません。

    中間地を固定する必要がある場合は、TSPルート・リクエストのかわりに単純マルチアドレス・ルート・リクエストを使用する必要があります。

TSPルート・リクエストでは、route_type属性を使用して、ルートを開いた行程または閉じた行程として分類します。

  • 開いた行程: ルートは出発地に戻りません。

  • 閉じた行程: ルートは出発地に戻ります。

    TSPの閉じた行程ルートがリクエストされた場合は、<start_location>要素を指定する必要があります。この出発地はルート計算中に目的地としても使用されます。TSPの閉じた行程ルート・リクエストで<end_location>要素が指定されている場合は、エラーが戻されます。定義では、TSPの閉じた行程ルートは単一の固定の出発および目的地を使用しますが、中間地は並替えの対象となります。

例: TSPの開いた行程ルート・リクエスト

職場から運転し、顧客A、B、Cを訪問する場合は、次のようになります。

  • ルートには固定の出発地として職場があります。

  • ルートには、非固定の中間地として顧客A、B、Cがあります。これらの場所が並べ替えられて、全体的なルートが最適化されます。

  • 戻されるルートは、職場から最初の並べ替えられた場所、さらに2番目の並べ替えられた場所を通過して最終目的地に到達する、最適化された開いた行程ルートです。

例: TSPの閉じた行程ルート・リクエスト

職場から運転し、顧客A、B、Cを訪問し、職場に戻る場合は、次のようになります。

  • ルートには固定の出発地として職場があります。職場は固定の目的地としても使用されます。<end_location>要素はルート・リクエストで指定しないでください。ルーティング・エンジンは、閉じた行程のリクエストを検出すると、最後の非固定の場所から職場までのサブルートを自動的に追加します。

  • ルートには、非固定の中間地として顧客A、B、Cがあります。これらの場所が並べ替えられて、全体的なルートが最適化されます。

  • 戻されるルートは、職場から最初の並べ替えられた場所、さらに2番目と3番目の並べ替えられた場所を通過して最終的に出発地に戻る、最適化された閉じた行程ルートです。

TSPルート・リクエストには、各サブルートに固有の複数の属性を含めることができます。これらの属性には、return_subroutesreturn_subroute_edge_idsおよびreturn_subroute_geometryが含まれます。これらの属性については、「ルート・リクエストXMLスキーマ定義」で説明しています。

14.1.4 一括ルート・リクエスト

一括ルート・リクエストは、バッチ・モード・リクエスト(「バッチ・モード・ルート・リクエスト」で説明)と個別のルート・リクエストのハイブリッドです。一括ルート・リクエストは、複数の単純、単純マルチアドレスおよびTSPルート・リクエストをルーティング・エンジンに対する1つのリクエストで処理する方法です。バッチ・モード・リクエストの一括処理は許可されていません。

バッチ・モード・リクエストと同様に、一括ルート・リクエストの一番外側の要素は<batch_route_request>です。バッチ・モード・リクエストとは異なり、一括ルート・リクエストにはバッチ・リクエストの内部に1つ以上の<route_request>要素がネストされています。

一括ルート・リクエストでは、含まれる<batch_route_request>要素に関連する属性はすべて無視されます。かわりに、ネストされた<route_request>要素に関連付けられた属性が個々のルートの処理時に使用されます。これにより、ユーザーは単一の一括個別ルート・リクエスト内に単純、単純マルチアドレスおよびTSPの各リクエストを混在させることができます。

一括ルート・リクエストは、最速ルートを最短ルートと比較するなど、属性の異なる単一のルート・リクエストの複数のバリエーションを送信し、結果を比較する場合に役立ちます。

一括ルート・リクエスト内の個々のルート・リクエストでは、単純ルート・リクエストの任意の属性を使用できます。これらは、単純マルチアドレス・リクエストおよびTSPルート・リクエストの任意のサブルート固有属性も使用できます。

一括ルート・リクエスト内のすべての個々のルート・リクエストはスタンドアロンです。これらはバッチ内の他のルート・リクエストに影響しません。

14.1.5 バッチ・モード・ルート・リクエスト

バッチ・モード・ルート・リクエストには、1つの<start_location>要素および1つ以上の<end_location>要素が含まれます。

バッチ・モード・ルート・リクエストの結果には、複数のルートが含まれます。各ルートは、出発地から目的地の1つまでのルートです。バッチ・モード・リクエスト内の各ルートは、共有出発地を除き、他のすべてのルートから完全に分離されます。

バッチ・モード・ルート・リクエストには、複数のバッチ・モード固有属性を含めることができます。これらの属性には、cutoff_distanceおよびsort_by_distanceが含まれます。これらの属性については、「ルート・リクエストXMLスキーマ定義」で説明しています。

14.1.6 ルーティング・エンジンとジオコーダ間の関係

ルーティング・エンジンはジオコーダに依存するため、ルーティングおよびジオコーディングに使用するデータは一貫している必要があります(つまり、データ・プロバイダからの同じヴィンテージである必要があります)。

ジオコーディング・リクエストは、道路セグメントごとに(1)パーセントとEdgeIDおよび(2)経度と緯度を含むSDO_GEO_ADDRオブジェクトを返します。ルーティング・エンジンでは、パーセントとEdgeIDのみが考慮されます。

ルート・サーバーのエッジID値は、セグメントの方向を反映して正または負になります。(ジオコーディングでは方向は関係ないため、ジオコーディングのエッジIDは常に正です)。ルーティング表とジオコーディング表の同じ道路セグメント識別子は、符号のみ異なる場合があります。

住所がジオコードされ、後でルーティングに使用される次の例について考えてみます。

SELECT SDO_GCDR.GEOCODE('ODF_NA_Q312', 
  SDO_KEYWORDARRAY('5100 Geary Blvd', 'SAN FRANCISCO,CA 94118'), 
  'US', 'RELAX_POSTAL_CODE') 
  FROM dual;

ジオコーダは、edgeid = 127806839、パーセント= .86 (EDGEIDはジオコーダGC_ROAD_SEGMENT表のroad_segment_id列に対応)を返します。ただし、ルーティング・エンジンが使用するEDGE表には、edge_id -127806839と同じ(負の符号のみが異なる)セグメントが存在する可能性があります。正のroad_segment_id (GC_ROAD_SEGMENTから)が負のedge_id (EDGEから)のみと一致する場合は、対応するパーセントを取得するために、ジオコーダから返されるパーセントを1から減算して逆エッジ(edge_id)に適用する必要があります。この例では、1 - .86 = .14となります。

14.2 ルーティング・エンジンのデプロイ

このトピックでは、ルーティング・エンジンのデプロイの概要を示します。

このトピックのステップを実行する前に、「空間Webサービスのデプロイと構成」の情報を理解し、必要な操作を行っていることを確認してください。

ルーティング・エンジンのデプロイには、次の処理が含まれます。

14.2.1 routeserver.earファイルの解凍

routeserver.ear.zipファイルを解凍するには、次のステップに従います。

これらのステップの例では、次の値が使用されます。

  • WebLogic Serverホーム($WLS_HOME)は/scratch/software/Oracle/Middleware/user_projects/domains/spatial/です。

  • アプリケーション・デプロイメント・ディレクトリは$WLS_HOME/applications/です。

ただし、環境に適した値が異なる場合は、それを使用してください。

  1. routeserver.ear.zipをアプリケーション・デプロイメント・ディレクトリにコピーします。
    cp routeserver.ear.zip $WLS_HOME/applications/
    
  2. routeserver.ear.zipを解凍します。
    cd $WLS_HOME/applications/
    unzip routeserver.ear.zip

14.2.2 ルーティング・エンジンのデプロイのためのweb.xmlファイルの編集

この項では、ルーティング・エンジンを正しくデプロイするために行う必要のある、web.xmlファイル内のパラメータ値の変更について説明します。(ルーティング・エンジンの動作を変更するために変更できる他のパラメータもあります。)

  • container_dsパラメータを、管理対象サーバーに関連付けられているデータ・ソースのJNDI名に変更します。たとえば、JNDI/NorthAmericanDSなどです。

  • routeserver_network_nameパラメータを、ルーティング・エンジンの道路ネットワーク・データに構築されたネットワーク・データ・モデル(NDM)ネットワークの名前に変更します。たとえば、NorthAmericanNetworkです

  • WLS管理対象サーバーにワーク・マネージャが関連付けられている場合は、wl-dispatch-policyパラメータ値をワーク・マネージャの名前に変更します。たとえば、NorthAmericanWMです

  • geocoder_typeパラメータがhttpclientまたはNoneに設定されていることを確認します。(thinclientはサポートされなくなりました。)

    • httpclientに設定されている場合は、geocoder_http_urlをジオコーダ・サーブレットのURLに設定します。たとえば、http://localhost:8888/geocoder/gcserverなどです。

    • HTTPプロキシが使用されている場合は、geocoder_http_proxy_hostおよびgeocoder_http_proxy_portも指定します。プロキシが存在しない場合、この2つのパラメータは無視できます。

  • 必要に応じて、logfile_nameパラメータ値を変更します。デフォルトでは、logfile_nameパラメータはlog/RouteServer.logに設定されます。このデフォルトの相対パスには、ルーティング・エンジンがインストールされている場所からの相対のlogという名前のサブディレクトリが含まれます。logfile_nameパラメータを/scratch/logs/RouteServer.logなどの絶対パスに設定することもできます。

  • start_timeおよびstart_dateをルート・リクエストに使用する場合、属性date_formattime_formatおよびoutput_time_formatを含めます。date_formatおよびtime_formatは、JavaのSimpleDateFormatでサポートされる書式である必要があります。たとえば、date_formatdd-MMM-yyyyに設定し、time_formatHH:mmに設定するとします。ルート・リクエストのstart_timeは、これらのパラメータで設定された書式に従って解析されます。

  • return_route_timeまたはreturn_subroute_timeをルート・リクエストに使用する場合、output_time_formatをJavaのSimpleDateFormatでサポートされる時間書式に設定します。ルーター・レスポンスの出発時間と到着時間は、output_time_format値に従って書式設定されます。

  • partition_cache_sizeパラメータを変更します。このパラメータのデフォルト値は70ですが、管理対象サーバーのヒープに割り当てられているメモリー量に応じて変更することが必要になる場合があります。次の式を使用して、キャッシュ・サイズに適した開始点を取得できます。

    partition_cache_size = (NodesPerGigabyte/AvgNodesPartition)*UsableMemory

    説明:

    • NodesPerGigabyteは、GB当たりのノード数です。(この値は変更しないでください。2013年12月時点のデータ・セットでは、この値は15,000,000、つまり150万です。)

    • AvgNodesPartitionは、ローカル・パーティション当たりの平均ノード数です。これには、高速道路パーティション0は含まれません。高速道路パーティションのメモリーは、割り当てられたヒープ・サイズから1GBを引いて計算されます。北米データ・セットの場合、AvgNodesPartition値は約26,000です。パーティション当たりの実際の平均ノード数は、次の問合せを使用して確認できます。

      SELECT AVG(COUNT(node_id))
           FROM node 
           WHERE partition_id>0
           GROUP BY partition_id;
      
    • UsableMemoryは、管理対象サーバーが割り当てたギガバイト単位のヒープ・サイズから1GBを引いた値です。

    この式では、partition_cache_sizeパラメータに対して安全な数が生成されます。使用されるユーザー情報のタイプと処理される同時リクエストの平均数によっては、この数値にさらに15%から20%を追加できる場合があります。この数値を変更する前に、WLSコンソールを使用して、ヒープ使用率を監視してください。

    ルーティング・エンジンの実行中にヒープを監視して、この数値を増減できます。ただし、この値を大きく設定しすぎると、管理対象サーバーのメモリーが不足することがあります。

14.2.3 WebLogic Serverへのルーティング・エンジンのデプロイ

ルーティング・エンジンをWebLogic Serverにデプロイするには、「空間Webサービスのデプロイと構成」の「空間WebサービスのWebLogic Serverでのデプロイおよびweb.xmlファイルの編集」のステップに従います。

ルーティング・エンジンがデプロイされた後で、ルーティング・エンジン・テスト問合せのセットでデプロイメントをテストできます。たとえば、管理対象サーバーがポート7003で稼働するように設定されている場合は、ルーティング・エンジン・サーブレットをhttp://localhost:7003/routeserver/からテストできます。

これらの問合せは、様々なタイプのルート・リクエストを実行できます。これらの問合せには北米の住所が含まれますが、住所は他のデータ・セットのWebページで簡単に操作できます。

14.3 ルーティング・エンジンのXML API

このトピックでは、XML形式のルート・リクエストをルーティング・エンジンに送信する方法、およびルート・リクエスト(入力)とルート・レスポンス(出力)のXMLスキーマ定義(XSD)について説明します。

XMLは、HTTPプロトコルを使用した構造化文書の送信に広く使用されています。HTTPリクエスト(GETまたはPOSTメソッド)を使用する場合、そのリクエストには、xml_requestというパラメータがあり、その値は、リクエストのXML文書が含まれる文字列であると想定されます。

ルーティング・エンジン・サーブレットへのリクエストの書式は、次のとおりです。

http://hostname:port/route-server-servlet-path?xml_request=xml-request

この書式の詳細は次のとおりです。

  • hostname: ルーティング・エンジンが実行されているサーバーのネットワーク・パスです。

  • port: アプリケーション・サーバーがリスニングするポートです。

  • route-server-servlet-path: ルーティング・エンジン・サーブレットのパスです(たとえば、routeserver/servlet/RouteServerServlet)。

  • xml-request: URLエンコードされたXMLリクエストです。HTMLのGETまたはPOSTメソッドを使用して送信されます。

入力XMLは、すべてのリクエストに必須です。出力は、XML文書になります。

単純なルート・リクエストでは、ルートIDを指定する必要があり、次の属性を1つ以上指定できます。

  • route_preference: fastesttrafficまたはshortest(デフォルト)

  • traffic_sampling_id (route_preferencetrafficの場合): 1(移動時間は15分間隔)または2(デフォルト: 移動時間は1時間間隔)。

  • road_preference: highway (デフォルト)またはlocal

  • return_route_time(出発時間と到着時間を戻すかどうか): trueまたはfalse(デフォルト)

  • return_driving_directions (運転方向を戻すかどうか): trueまたはfalse (デフォルト)

  • return_hierarchical_directions (階層的な方向を戻すかどうか): trueまたはfalse (デフォルト)

  • return_locations (ルートおよび任意のサブルートの出発地と目的地のジオコード化された結果を戻す): trueまたはfalse (デフォルト)

  • return_subroutes (サブルートを戻すかどうか): true (マルチアドレス・ルートの場合はデフォルト、シングルアドレス・ルートの場合は無視)またはfalse

  • return_route_geometry (ルートの線ストリングの座標を戻すかどうか): trueまたはfalse (デフォルト)

  • return_subroute_geometry (各サブルートの線ストリングの座標を戻すかどうか): trueまたはfalse (マルチアドレス・ルートの場合はデフォルト)

  • return_segment_geometry (ルートのマヌーバごとに線ストリングの座標を戻すかどうか): trueまたはfalse (デフォルト)

  • return_detailed_geometry: true (デフォルト。詳細なジオメトリを戻す)またはfalse (総合的なジオメトリを戻す)

  • start_date: ルートの出発日。たとえば、05-Aug-2016です。デフォルトは、リクエストの日付です。

  • start_time: ルートの出発時間。たとえば、午前10時30分の場合、10:30です。デフォルトは、リクエストの時間です。

  • date_format: start_date属性の出発日の解析に使用する書式。たとえば、dd-MMM_yyyyです。これは、JavaのSimpleDateFormatでサポートされるどの書式に設定してもかまいません

  • time_format: start_time属性の出発時間の解析に使用する書式。たとえば、HH:mmです。これは、JavaのSimpleDateFormatでサポートされるどの書式に設定してもかまいません

  • output_time_format: return_route_timeまたはreturn_subroute_timetrueに設定されている場合にルート・レスポンスの出発時間と到着時間の表示に使用される書式

  • language: 運転方向の生成に使用する言語(ENGLISH(デフォルト)、FRENCHGERMANITALIANPORTUGUESEまたはSPANISH)

  • distance_unit: kilometermile (デフォルト)またはmeter

  • length_unit: フィートの場合はus (デフォルト)、メートルの場合はmetric

  • time_unit: hourminute (デフォルト)またはsecond

  • weight_unit: トンの場合はus (デフォルト)、メートル・トンの場合はmetric

  • pre_geocoded_locations (出発地および目的地を、入力場所(住所指定または点)とジオコード済の場所のどちらで指定するか): true (ジオコード済の場所)またはfalse (デフォルト。入力場所)

  • driving_directions_detail: highmedium (デフォルト)またはlow

  • optimize_route: trueまたはfalse (デフォルト)

  • route_type: open (デフォルト)またはclosed

  • vehicle_type: auto (デフォルト)またはtruck

  • truck_type: deliverypublicresidentまたはtrailer。(デフォルトなし)

  • truck_height: length_unitsの浮動小数点数

  • truck_length: length_unitsの浮動小数点数

  • truck_per_axle_weight: weight_unitsの浮動小数点数

  • truck_weight: weight_unitsの浮動小数点数

  • truck_width: length_unitsの浮動小数点数

一括ルート・リクエストは、<batch_route_request>要素にカプセル化された1つ以上の単純(単一、マルチアドレスまたはTSP)リクエストのグループです。<batch_route_request>要素に関連する属性はすべて無視されます。カプセル化されたすべてのリクエストは単純リクエストであるため、これらは前にリストした属性を使用します。

バッチ・モード・ルート・リクエストでは、リクエストID、出発地、および1つ以上の目的地を指定する必要があります。ID属性は、場所ごとに必要です。単純リクエストに使用されるほとんどの属性は、バッチ・モードでは意味がありません。バッチ・モード・ルート・リクエストで次の属性の1つ以上を使用できますが、このリストにない属性を使用すると例外が発生する原因となります。

  • route_preference: fastestまたはshortest (デフォルト)

  • road_preference: highway (デフォルト)またはlocal

  • distance_unit: kilometerkmmile (デフォルト)またはmeter

  • time_unit: hourminute (デフォルト)またはsecond

  • sort_by_distance (戻されるルートを、出発地から目的地までの距離で昇順にソートするかどうか): trueまたはfalse (デフォルト)

  • cutoff_distance (出発地から目的地までの距離が、指定された距離以下のルートのみを戻す): (数値。デフォルトは制限なし)

  • pre_geocoded_locations (出発地および目的地を、入力場所(住所指定または点)とジオコード済の場所のどちらで指定するか): true (ジオコード済の場所)またはfalse (デフォルト。入力場所)

14.3.1 ルート・リクエストおよびルート・レスポンスの例

この項では、ルート・リクエストと、そのリクエストによって生成されるルート・レスポンスのXMLの例を示します。リクエストには、指定した住所、経度と緯度の座標により指定される点、またはジオコード済の場所を使用できます。使用可能な要素および属性のリファレンス情報は、リクエストについては「ルート・リクエストXMLスキーマ定義」を、レスポンスについては「ルート・レスポンスXMLスキーマ定義」を参照してください。

例14-1 指定した住所を使用した場合のルート・リクエスト

例14-1は、5.67メートル・トンの配送トラックでの、住所を指定した2つのオフィス(Massachusetts州Waltham市とNew Hampshire州Nashua市)間の最速ルート(可能な場合は、高速道路を使用)の単純リクエストを示しています。レスポンスには、距離にキロメートル、時間に分を使用した各セグメントの運転方向が含まれます。このリクエストでは、出発地と目的地のジオコード情報も戻されます。

<?xml version="1.0" standalone="yes"?>
<route_request 
          id="8" 
          route_preference="fastest"
          road_preference="highway"
          vehicle_type="truck"
          truck_type="delivery"
          truck_weight="5.67" 
          return_driving_directions="true"
          return_locations="true"
          distance_unit="km" 
          time_unit="minute"
          weight_unit="metric">
  <start_location>
    <input_location id="1">
      <input_address>
        <us_form1 
          street="1000 Winter St" 
          lastline="Waltham, MA" />
      </input_address>
    </input_location></start_location>
  <end_location>
    <input_location id="2">
      <input_address>
        <us_form1 
          street="1 Oracle Dr" 
          lastline="Nashua, NH" />
      </input_address>
    </input_location>
  </end_location>
</route_request>

例14-2 指定した住所を使用したルート・リクエストのレスポンス

例14-2に、例14-1のリクエストによって生成されたレスポンスを示します。(出力は、読みやすくするために変更が加えられています。)

<!-- Oracle Routeserver version 12.1.0.1.0 (data version 11.1.0.7.1) -->
<route_response>
  <route id="8" step_count="12" 
    distance="46.07216796875" distance_unit="km" 
    time="31.133371988932293" time_unit="minute" 
    start_location="1" end_location="2">
  <start_location>
    <location id="1" 
      longitude="-71.25962" latitude="42.39741" 
      house_number="399" street="WINTER ST" 
      city="WALTHAM" state="MA" country="US" 
      driving_side="R" 
      postal_code="02451" 
      edge_id="906810462" percent="0.0"/>
  </start_location>
  <segment sequence="1" 
    instruction="Start out on Winter St (Going Southwest)" 
    distance="0.0" time="0.0"/>
  <segment sequence="2" 
    instruction="Turn RIGHT onto Wyman St (Going North)"  
    distance="0.3453199939727783" time="0.3597083270549774"/>
  <segment sequence="3" 
    instruction="Take RAMP toward Peabody" 
    distance="0.43125000953674314" time="0.3478285253047943"/>
  <segment sequence="4" 
    instruction="Merge onto I-95 N/RT-128 N (Going North)" 
    distance="9.598520091056823" time="6.1528975268205"/>
  <segment sequence="5" 
    instruction="Continue on toward Burlington" 
    distance="0.0" time="0.0"/>
  <segment sequence="6" 
    instruction="Stay STRAIGHT to go onto RAMP (Going East)" 
    distance="0.22952000427246094" time="0.23908333778381347"/>
  <segment sequence="7" 
    instruction="Continue on toward Lowell" 
    distance="0.5157099990844727" time="0.5371979157129924"/>
  <segment  sequence="8" 
    instruction="Stay STRAIGHT to go onto US-3 N (Going Northwest)" 
    distance="33.26371000862122" time="21.322891048093638"/>
  <segment sequence="9" 
    instruction="Take EXIT 1 toward S. Nashua" 
    distance="0.6134100036621094" time="0.5454034169514974"/>
  <segment sequence="10" 
    instruction="Continue on toward So. Nashua" 
    distance="0.27333999633789063" time="0.41415150960286456"/>
  <segment sequence="11" 
    instruction="Turn LEFT onto Spit Brook Rd (Going West)" 
    distance="0.8013799934387207" time="1.2142121195793152"/>
  <segment sequence="12" 
    instruction="Turn RIGHT onto Oracle Dr (Going North)" 
    distance="0.0" time="0.0"/>
  <end_location>
    <location id="2" 
      longitude="-71.45937" latitude="42.70783" 
      house_number="1" street="ORACLE DR" 
      city="NASHUA" state="NH" country="US" 
      driving_side="R" 
      postal_code="03062" 
      edge_id="22325991" percent="0.0"/>
  </end_location>
  </route>
</route_response>

例14-3 経度/緯度点で場所を指定したルート・リクエスト

例14-3は、経度/緯度点で指定した4つの場所間の閉じた行程TSPの最短ルート(可能な場合は、高速道路を使用)のリクエストを示しています。(この4つの場所は、California州San Francisco市の、World Trade Center、Golden Gate Park、3001 Larkin Streetおよび100 Flower通りに対応しています。)ルートはWorld Trade Centerの固定位置で開始および終了しますが、他の3つの場所は最適ルートを生成するための並替えの対象となります。ルート内のすべての場所についてジオコードからの情報が戻されます。ジオメトリはサブルート・レベルで表示され、エッジIDはセグメント・レベルの運転方向で表示されます。

<?xml version="1.0" standalone="yes"?>
<route_request id="8" 
               route_preference="shortest"
               route_type="closed"
               optimize_route="true"
               road_preference="highway"
               return_locations="true"
               return_driving_directions="true"
               return_subroutes="true"
               return_route_geometry="false"
               return_subroute_geometry="true"
               return_segment_geometry= "false"
               return_segment_edge_ids= "true"
          >
  <start_location>
    <input_location id="1" longitude="-122.39436" latitude="37.79579"/>
  </start_location>
  <location>
    <input_location id="2" longitude="-122.45412" latitude="37.7714" />;
  </location>
  <location>
    <input_location id="3" longitude="-122.422" latitude="37.80551" />
  </location>
  <location>
    <input_location id="4" longitude="-122.40459" latitude="37.74211" />
  </location>
</route_request>

例14-4 経度/緯度点で場所を指定したルート・リクエストに対するレスポンス

例14-4に、例14-3のリクエストによって生成されたレスポンスを示します。(出力は、読みやすくするために変更が加えられています。)

<!-- Oracle Routeserver version 12.1.0.2.0 (data version 11.1.0.7.1) -->
<route_response>
  <route id="8" step_count="88" 
    distance="15.105344411681319" distance_unit="mile" 
    time="35.63843688964844" time_unit="minute" 
    start_location="1" end_location="1">
    <subroute id="1" step_count="5" 
      distance="1.8589950065634127" distance_unit="mile" 
      time="4.305604044596354" time_unit="minute" 
      start_location="1" end_location="3">   
      <subroute_geometry>
        <LineString><coordinates> 
          -122.39436,37.79579 -122.39436,37.79579 -122.39454,37.79601 
          -122.39467,37.79614 -122.39486,37.79633 -122.39499,37.79647 
          -122.39529,37.79678 -122.39558,37.79709 -122.39592,37.79747 
          -122.3963,37.7979 -122.39646,37.79808 -122.3969,37.79858 
          -122.39741,37.79916 -122.39755,37.79929 -122.39776,37.79918 
          -122.39793,37.79907 -122.39811,37.79899 -122.39821,37.79896 
          -122.39836,37.79892 -122.39867,37.79889 -122.39986,37.79874 
          -122.40104,37.7986 -122.40223,37.79845 -122.40302,37.79835 
          -122.40308,37.79834 -122.40349,37.79828 -122.40384,37.79824 
          -122.40466,37.79813 -122.40545,37.79802 -122.40549,37.79802 
          -122.4062,37.79794 -122.40622,37.79794 -122.40664,37.79789 
          -122.40707,37.79816 -122.40789,37.79872 -122.40846,37.7991 
          -122.40898,37.7995 -122.41017,37.80031 -122.41038,37.80045 
          -122.41078,37.80073 -122.41089,37.8008 -122.41094,37.80084 
          -122.41136,37.80112 -122.41143,37.80118 -122.41248,37.80188 
          -122.41254,37.80193 -122.41289,37.80218 -122.41367,37.80274 
          -122.41488,37.80355 -122.41547,37.80396 -122.41607,37.80441 
          -122.41657,37.80475 -122.41681,37.80492 -122.4172,37.80519 
          -122.4178,37.8056 -122.41837,37.80598 -122.41873,37.80593 
          -122.42035,37.80573 -122.422,37.80551 
          -122.42199999992847,37.805509999663826        
        </coordinates></LineString>
      </subroute_geometry>
      <start_location>
        <location id="1" 
          longitude="-122.39436" latitude="37.79579" 
          house_number="" street="HERB CAEN WAY" 
          city="SAN FRANCISCO" state="CA" country="US" 
          driving_side="R" 
          postal_code="94111" 
          edge_id="724791174" percent="1.0"/>
      </start_location>
      <segment sequence="1" 
        instruction="Start out on The Embarcadero (Going Northwest)" 
        distance="0.29822904401544625" time="0.49993750055631003">
        <segment_edge_ids><edge_ids>
          724791174, 724791175, 733049363, 915793201, 915793202, 830932896,
          112011102, 112011103, 830934259, 830934260, 726169597, 112011105,
          37830229
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="2" 
        instruction="Turn LEFT onto Broadway (Going Southwest)"   
        distance="0.5093705394140182" time="1.2420151789983114">
        <segment_edge_ids><edge_ids>
          -24571168, -724946174, -724946173, -23598782, -23621077, -23598783,
          -23598784, -23598786, -23598787, -23598788, -23598789, -23598791, 
          -23598792
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="3" 
        instruction="Turn SLIGHT RIGHT onto Columbus Ave (Going Northwest)" 
        distance="0.8505250718279074" time="2.07386361459891">
        <segment_edge_ids><edge_ids>
          23601001, 23601002, 23601003, 23601004, 830239101, 830239102,
          799420615, 23601006, 23601007, 23601008, 23737804, 23601009,
          23601010, 23601011, 23737805, 23601012, 754219681, 754219682,
          23622414, 754224948, 754224949
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="4" 
        instruction="Turn SLIGHT LEFT onto North Point St (Going West)" 
        distance="0.20086994241069608" time="0.48978787660598755">
        <segment_edge_ids><edge_ids>
          -23612405, -23612406, -23612407
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="5" 
        instruction="Turn LEFT onto Larkin St (Going South)" 
        distance="2.3560371803568745E-8" time="5.744803956986288">
        <segment_edge_ids><edge_ids>
          -23609029
        </edge_ids></segment_edge_ids>
      </segment>
      <end_location>
        <location id="3" 
          longitude="-122.42199999966279" latitude="37.80551000007165" 
          house_number="2999" street="LARKIN ST" city="SAN FRANCISCO" 
          state="CA" country="US" 
          driving_side="R" 
          postal_code="94109" 
          edge_id="23609029" percent="0.9999996412873026"/>
      </end_location>
    </subroute>
    <subroute id="2" step_count="32" 
      distance="4.0150478493172495" distance_unit="mile" 
      time="9.790025838216145" time_unit="minute" 
      start_location="3" end_location="2">
      <subroute_geometry>
        <LineString><coordinates> 
          -122.42199999992847,37.805509999663826 -122.422,37.80551 
          -122.42364,37.8053 -122.42345,37.80436 -122.42327,37.80342 
          -122.42482,37.80322 -122.42496,37.8032 -122.42545,37.80314 
          -122.42656,37.803 -122.42638,37.80207 -122.4262,37.80111 
          -122.42782,37.8009 -122.42947,37.80069 -122.43111,37.80048 
          -122.43276,37.80026 -122.43439,37.80006 -122.43605,37.79985 
          -122.43597,37.79943 -122.43588,37.79896 -122.43751,37.79874 
          -122.43742,37.79828 -122.43733,37.79781 -122.43895,37.79759 
          -122.43877,37.79667 -122.44041,37.79645 -122.44025,37.79554 
          -122.4419,37.7953 -122.44173,37.79439 -122.44153,37.79343 
          -122.44308,37.79323 -122.44317,37.79322 -122.44328,37.79321 
          -122.44476,37.79302 -122.44487,37.79301 -122.44496,37.793 
          -122.44643,37.7928 -122.4463,37.79188 -122.44614,37.79099 
          -122.44595,37.79011 -122.44577,37.78924 -122.44559,37.78836 
          -122.44697,37.78818 -122.44688,37.78775 -122.44687,37.78769 
          -122.44678,37.78726 -122.44676,37.78705 -122.44671,37.78679 
          -122.44675,37.78651 -122.4468,37.78635 -122.44689,37.78618 
          -122.44697,37.78603 -122.44749,37.7855 -122.44766,37.78538 
          -122.44792,37.78513 -122.448,37.78507 -122.44814,37.78496 
          -122.44929,37.78468 -122.45012,37.78448 -122.45015,37.78432 
          -122.4502,37.78418 -122.45034,37.78396 -122.45041,37.78383 
          -122.45043,37.78369 -122.45012,37.78218 -122.45112,37.78205 
          -122.45109,37.78192 -122.45082,37.78064 -122.45186,37.78049 
          -122.45287,37.78037 -122.45385,37.78023 -122.45374,37.77943 
          -122.45367,37.77905 -122.45349,37.77817 -122.45339,37.77781 
          -122.45332,37.77763 -122.45318,37.77685 -122.45303,37.77596 
          -122.45299,37.77574 -122.45283,37.77499 -122.45297,37.77497 
          -122.45287,37.77443 -122.45279,37.77404 -122.45262,37.7731 
          -122.45241,37.77215 -122.45276,37.77206 -122.45301,37.77195 
          -122.45346,37.77172 -122.45387,37.77153 -122.45398,37.77148 
          -122.45412868777395,37.77142244344235 
        </coordinates></LineString>
      </subroute_geometry>
      <start_location>
        <location id="3" 
          longitude="-122.42199999966279" latitude="37.80551000007165" 
          house_number="2999" street="LARKIN ST" city="SAN FRANCISCO" 
          state="CA" country="US" 
          driving_side="R" 
          postal_code="94109" 
          edge_id="23609029" percent="0.9999996412873026"/>
      </start_location>
      <segment sequence="1" 
        instruction="Start out on Larkin St (Going North)" 
        distance="2.3560371803568745E-8" time="5.7448039569862884E-8">
        <segment_edge_ids><edge_ids>
          23609029
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="2" 
        instruction="Turn LEFT onto North Point St (Going West)" 
        distance="0.09072267445473188" time="0.22121211687723796">
        <segment_edge_ids><edge_ids>
          -23612408
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="3" 
        instruction="Turn LEFT onto Polk St (Going South)" 
        distance="0.1314981638707435" time="0.3206363519032796">
        <segment_edge_ids><edge_ids>
          -23614397, -23614396
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="4" 
        instruction="Turn RIGHT onto Francisco St (Going West)" 
        distance="0.1819921735430389" time="0.443757571776708">
        <segment_edge_ids><edge_ids>
          -23604420, -120906034, -916007650, -916007649
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="5" 
        instruction="Turn LEFT onto Franklin St (Going South)" 
        distance="0.13209470069661014" time="0.32209091186523436">
        <segment_edge_ids><edge_ids>
          -23604500, -23604499
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="6" 
        instruction="Turn RIGHT onto Lombard St (Going West)" 
        distance="0.544926363604202" 
        time="1.3287121295928954">
        <segment_edge_ids><edge_ids>
          -23609690, -23609691, -23609692, -23609693, -23609694, 
          -23609695
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="7" 
        instruction="Turn LEFT onto Fillmore St (Going South)" 
        distance="0.06220717119887626" 
        time="0.15168182055155435">
        <segment_edge_ids><edge_ids>
          -23604040, -23604039
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="8" 
        instruction="Turn RIGHT onto Greenwich St (Going West)" 
        distance="0.09030634551112576" 
        time="0.22019697825113932">
        <segment_edge_ids><edge_ids>
          -23605619
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="9" 
        instruction="Turn LEFT onto Steiner St (Going South)"
        distance="0.06502205890116725" t
        time="0.15854545434316">
        <segment_edge_ids><edge_ids>
          -23618095, -23618094
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="10" 
        instruction="Turn RIGHT onto Filbert St (Going West)" 
        distance="0.08977195129603127" 
        time="0.21889394124348957">
        <segment_edge_ids><edge_ids>
          -23603994
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="11" 
        instruction="Turn LEFT onto Pierce St (Going South)" 
        distance="0.06433853285001388" 
        time="0.15687878926595053">
        <segment_edge_ids><edge_ids>
          -23614117
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="12" 
        instruction="Turn RIGHT onto Union St (Going West)" 
        distance="0.09084695019464499" 
        time="0.22151514689127605">
        <segment_edge_ids><edge_ids>
          -23619255
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="13" 
        instruction="Turn LEFT onto Scott St (Going South)" 
        distance="0.06349965975356134" 
        time="0.15483333269755045">
        <segment_edge_ids><edge_ids>
          -23616716
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="14" 
        instruction="Turn RIGHT onto Green St (Going West)" 
        distance="0.09162990537119692" 
        time="0.2234242598215739">
        <segment_edge_ids><edge_ids>
          -23605539
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="15" 
        instruction="Turn LEFT onto Divisadero St (Going South)" 
        distance="0.13081463781959013" 
        time="0.3189696947733561">
        <segment_edge_ids><edge_ids>
          -23602190, -23602189
        </edge_ids></segment_edge_ids>
     </segment>
      <segment sequence="16" 
        instruction="Turn RIGHT onto Broadway (Going West)"
        distance="0.2711613656927398"
        time="0.6611817995707194">
        <segment_edge_ids><edge_ids>
          -829713884, -829713883, -829713879, -829713878, 
          -829713874, -829713887,-829713886
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="17"
        instruction="Turn LEFT onto Lyon St (Going South)"
        distance="0.3103461147339876"
      <segment sequence="16" 
        instruction="Turn RIGHT onto Broadway (Going West)"
        distance="0.2711613656927398"
        time="0.6611817995707194">
        <segment_edge_ids><edge_ids>
          -829713884, -829713883, -829713879, -829713878, 
          -829713874, -829713887,-829713886
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="17"
        instruction="Turn LEFT onto Lyon St (Going South)"
        distance="0.3103461147339876"
        time="0.7567272663116456">
        <segment_edge_ids><edge_ids>
          -28479560, -23609965, -23609964, -23609963, -23609962
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="18"
        instruction="Turn RIGHT onto Sacramento St (Going West)"
        distance="0.07639346451339481"
        time="0.18627273241678874">
        <segment_edge_ids><edge_ids>
          -23615823
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="19" 
        instruction="Turn LEFT onto Presidio Ave (Going South)"
        distance="0.09716025402078811"
        time="0.23690908749898273">
        <segment_edge_ids><edge_ids>
          -754763527, -754763526,-23747787
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="20"
        instruction="Turn SLIGHT RIGHT onto RAMP (Going South)"
        distance="0.054849932668282114"
        time="0.1337424119313558">
        <segment_edge_ids><edge_ids>
          -23747788
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="21" 
        instruction="Turn SLIGHT RIGHT onto Masonic Ave (Going Southwest)"
        distance="0.09798048860074304"
        time="0.23890908559163412">
        <segment_edge_ids><edge_ids>
          -723450070, -723450073
        </edge_ids></segment_edge_ids>
      </segment>
        time="0.7567272663116456">
        <segment_edge_ids><edge_ids>
          -28479560, -23609965, -23609964, -23609963, -23609962
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="18"
        instruction="Turn RIGHT onto Sacramento St (Going West)"
        distance="0.07639346451339481"
        time="0.18627273241678874">
        <segment_edge_ids><edge_ids>
          -23615823
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="19" 
        instruction="Turn LEFT onto Presidio Ave (Going South)"
        distance="0.09716025402078811"
        time="0.23690908749898273">
        <segment_edge_ids><edge_ids>
          -754763527, -754763526,-23747787
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="20"
        instruction="Turn SLIGHT RIGHT onto RAMP (Going South)"
        distance="0.054849932668282114"
        time="0.1337424119313558">
        <segment_edge_ids><edge_ids>
          -23747788
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="21" 
        instruction="Turn SLIGHT RIGHT onto Masonic Ave (Going Southwest)"
        distance="0.09798048860074304"
        time="0.23890908559163412">
        <segment_edge_ids><edge_ids>
          -723450070, -723450073
        </edge_ids></segment_edge_ids>
      </segment>
      <end_location>
        <location id="2" 
          longitude="-122.45412868707837" latitude="37.771422441619094" 
          house_number="" street="JOHN F KENNEDY DR" 
          city="SAN FRANCISCO" state="CA" country="US" 
          driving_side="R" 
          postal_code="94118" 
          edge_id="728011751" percent="0.5203619908971352"/>
      </end_location>
    </subroute>
    <subroute id="3" step_count="36" 
      distance="4.848880093441248" distance_unit="mile" 
      time="11.788133748372395" time_unit="minute" 
      start_location="2" end_location="4">
      <subroute_geometry>
        <LineString><coordinates>
          -122.45412868777395,37.77142244344235 -122.45429,37.77136 
          -122.4546,37.77123 -122.45483,37.77114 -122.4551,37.77103 
          -122.4552,37.77097 -122.45533,37.77086 -122.45501,37.77098 
          -122.4547,37.77107 -122.45447,37.77116 -122.45424,37.77124
          -122.45396,37.77135 -122.45384,37.7714 -122.45382,37.77141 
          -122.45369,37.77143 -122.45358,37.77144 -122.45347,37.77143 
          -122.4529,37.77133 -122.45222,37.77123 -122.45205,37.77031 
          -122.45043,37.77051 -122.45021,37.76958 -122.44967,37.76964 
          -122.44945,37.76872 -122.44839,37.76885 -122.44756,37.76895 
          -122.44672,37.76907 -122.44593,37.76917 -122.44555,37.76733 
          -122.44473,37.76743 -122.44467,37.76702 -122.44456,37.76645 
          -122.44451,37.76631 -122.44418,37.76596 -122.44361,37.76539 
          -122.44347,37.76536 -122.44273,37.76532 -122.44246,37.7653
          -122.44232,37.76529 -122.44192,37.76527 -122.44202,37.76513
          -122.44229,37.76511 -122.44232,37.76508 -122.44232,37.765 
          -122.44219,37.76499 -122.44209,37.76496 -122.44107,37.76443 
          -122.43976,37.76376 -122.4392,37.76348 -122.43908,37.76344 
          -122.43795,37.76329 -122.43781,37.7633 -122.43709,37.76333
          -122.43528,37.76346 -122.43523,37.76312 -122.43519,37.76283
          -122.43516,37.76264 -122.43515,37.76258 -122.43511,37.76207
          -122.43504,37.76128 -122.435,37.76089 -122.43388,37.76095 
          -122.43278,37.76101 -122.43057,37.76115 -122.43048,37.76036 
          -122.43039,37.75958 -122.42824,37.75972 -122.42816,37.7589 
          -122.42805,37.75806 -122.42789,37.75807 -122.42583,37.75821 
          -122.42566,37.75822 -122.42347,37.75836 -122.42126,37.75851 
          -122.42047,37.75854 -122.42028,37.75695 -122.41999,37.75696 
          -122.4197,37.75698 -122.41892,37.75702 -122.41874,37.75545
          -122.41766,37.75553 -122.41659,37.75557 -122.41549,37.75563
          -122.41533,37.75405 -122.41425,37.75412 -122.41385,37.75414
          -122.41312,37.75417 -122.41204,37.75424 -122.41109,37.75428 
          -122.4102,37.75433 -122.41004,37.75276 -122.40913,37.75282 
          -122.40818,37.75287 -122.40733,37.75292 -122.40713,37.75133 
          -122.40617,37.75138 -122.40614,37.75103 -122.40613,37.75096 
          -122.40611,37.75088 -122.40602,37.75067 -122.40599,37.75051 
          -122.40578,37.75013 -122.40565,37.74987 -122.40529,37.74937
          -122.40518,37.74924 -122.40506,37.74913 -122.40483,37.74896 
          -122.4045,37.74873 -122.40441,37.74867 -122.40437,37.74864 
          -122.4041,37.74845 -122.40393,37.74827 -122.40384,37.74815
          -122.40378,37.74801 -122.40375,37.74785 -122.40381,37.74762
          -122.40397,37.74719 -122.4043,37.74633 -122.40434,37.74618 
          -122.40434,37.74603 -122.40431,37.74594 -122.4042,37.74554 
          -122.40416,37.7453 -122.40417,37.74515 -122.40431,37.74464 
          -122.40445,37.74427 -122.40461,37.74393 -122.40479,37.74362 
          -122.40522,37.74304 -122.40538,37.74284 -122.40565,37.7425
          -122.40517,37.74233 -122.40459,37.74211
        </coordinates></LineString>
      </subroute_geometry>
      <start_location>
        <location id="2" 
          longitude="-122.45412868707837" latitude="37.771422441619094" 
          house_number="" street="JOHN F KENNEDY DR" 
          city="SAN FRANCISCO" state="CA" country="US" 
          driving_side="R" 
          postal_code="94118" 
          edge_id="728011751" percent="0.5203619908971352"/>
      </start_location>
      <segment sequence="1"
        instruction="Start out on John F Kennedy Dr (Going West)"
        distance="0.02898340160626114"
        time="0.07067119280497233">
        <segment_edge_ids><edge_ids>
          -728011751, -728011750
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="2"
        instruction="Stay STRAIGHT to go onto Kezar Dr (Going Southwest)"
        distance="0.04787796125753919"
        time="0.11674242814381917">
        <segment_edge_ids><edge_ids>
          -23747756
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="3"
        instruction="Turn SHARP LEFT onto John F Kennedy Dr (Going East)"
        distance="0.08222829797036355"
        time="0.20049999952316283">
        <segment_edge_ids><edge_ids>
          23747762, 728012586, 724789094
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="4"
        instruction="Stay STRAIGHT to go onto Oak St (Going Northeast)"
        distance="0.09773193475050901"
        time="0.2383030315240224">
        <segment_edge_ids><edge_ids>
          724764533, 724764534, -23738012
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="5"
        instruction="Turn RIGHT onto Shrader St (Going South)"
        distance="0.06425775409315192"
        time="0.15668182373046874">
        <segment_edge_ids><edge_ids>
          -23617167
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="6"
        instruction="Turn LEFT onto Page St (Going East)"
        distance="0.08957932247692126"
        time="0.21842424074808756">
        <segment_edge_ids><edge_ids>
          23613434
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="7"
        instruction="Turn RIGHT onto Cole St (Going South)"
        distance="0.06538868039329745"
        time="0.1594394048055013">
        <segment_edge_ids><edge_ids>
          -23600911
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="8"
        instruction="Turn LEFT onto Haight St (Going East)"
        distance="0.02978934855322748"
        time="0.07263635794321696">
        <segment_edge_ids><edge_ids>
          23605814
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="9"
        instruction="Turn RIGHT onto Belvedere St (Going South)"
        distance="0.06471136481056884"
        time="0.1577878793080648">
        <segment_edge_ids><edge_ids>
          -23598189
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="10"
        instruction="Turn LEFT onto Waller St (Going East)"
        distance="0.1948176204828599"
        time="0.4750302950541178">
        <segment_edge_ids><edge_ids>
          23620205, 23620204, 23620203, 23620202
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="11"
        instruction="Turn RIGHT onto Delmar St (Going South)"
        distance="0.12885726410065712"
        time="0.3141969680786133">
        <segment_edge_ids><edge_ids>
          -23602039
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="12"
        instruction="Turn LEFT onto Frederick St (Going East)"
        distance="0.04533026592197986"
        time="0.11053029696146648">
        <segment_edge_ids><edge_ids>
          23604508
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="13"
        instruction="Turn RIGHT onto Masonic Ave (Going South)"
        distance="0.2072702425733493"
        time="0.5053939501444499">
        <segment_edge_ids><edge_ids>
          -932510459, -932510458, -23610757, -23610758,
          -814886921
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="14"
        instruction="Stay STRAIGHT to go onto Roosevelt Way (Going East)"
        distance="0.04439197258915798"
        time="0.1082424263159434">
        <segment_edge_ids><edge_ids>
          -814886920, -799371986, -799371985
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="15"
        instruction="Turn RIGHT onto Levant St (Going Southwest)"
        distance="0.03410178286259032"
        time="0.0831515113512675">
        <segment_edge_ids><edge_ids>
          -799371984, -799371983
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="16"
        instruction="Turn LEFT onto States St (Going Southeast)"
        distance="0.4172186714314114"
        time="1.0173182010650634">
        <segment_edge_ids><edge_ids>
          -829568337, -936352352, -936352351, -932495104, 
          932495103, 799475779
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="17"
        instruction="Turn RIGHT onto Castro St (Going South)"
        distance="0.1783259826221157"
        time="0.4348181843757629">
        <segment_edge_ids><edge_ids>
          -754012004, -833349280, -833349279, -905543898, 
          -905543897, -753950604, -753950603
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="18"
        instruction="Turn LEFT onto 18th St (Going East)"
        distance="0.24272664830496957"
        time="0.5918484846750895">
        <segment_edge_ids><edge_ids>
          23594648, 23594647, 23594646
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="19"
        instruction="Turn RIGHT onto Sanchez St (Going South)"
        distance="0.10895420615626991"
        time="0.26566667556762696">
        <segment_edge_ids><edge_ids>
          -23616290, -23616291
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="20"
        instruction="Turn LEFT onto 19th St (Going East)"
        distance="0.11787733607670552"
        time="0.2874242464701335">
        <segment_edge_ids><edge_ids>
          23594737
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="21"
        instruction="Turn RIGHT onto Church St (Going South)"
        distance="0.115211584951289"
        time="0.2809242566426595">
        <segment_edge_ids><edge_ids>
          -23600503, -23600504
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="22"
        instruction="Turn LEFT onto 20th St (Going East)"
        distance="0.4155409305719238"
        time="1.0132273137569427">
        <segment_edge_ids><edge_ids>
          732180611, 732180612, 23747712, 23594835, 
          23594834, 23594833
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="23"
        instruction="Turn RIGHT onto Lexington St (Going South)"
        distance="0.11038339612853318"
        time="0.5921333312988282">
        <segment_edge_ids><edge_ids>
          -23609398
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="24"
        instruction="Turn LEFT onto 21st St (Going East)"
        distance="0.07448580061634548"
        time="0.18162120978037516">
        <segment_edge_ids><edge_ids>
          23594883, 23594882, 23594881
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="25"
        instruction="Turn RIGHT onto Mission St (Going South)"
        distance="0.10895420141545431"
        time="0.26566665967305503">
        <segment_edge_ids><edge_ids>
          -23611414
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="26"
        instruction="Turn LEFT onto 22nd St (Going East)"
        distance="0.17805878047745186"
        time="0.4341666539510091">
        <segment_edge_ids><edge_ids>
          23594956, 23594955, 23594954
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="27"
        instruction="Turn RIGHT onto Shotwell St (Going South)"
        distance="0.10955073824132096"
        time="0.2671212196350098">
        <segment_edge_ids><edge_ids>
          -23617156
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="28"
        instruction="Turn LEFT onto 23rd St (Going East)"
        distance="0.28101037926858485"
        time="0.6851969718933105">
        <segment_edge_ids><edge_ids>
          23595024, 799561724, 799561725, 23595022, 
          23595021, 23595020
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="29"
        instruction="Turn RIGHT onto Florida St (Going South)"
        distance="0.10886099698092727"
        time="0.26543939908345543">
        <segment_edge_ids><edge_ids>
          -23604143
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="30"
        instruction="Turn LEFT onto 24th St (Going East)"
        distance="0.14851177530603368"
        time="0.3621212085088094">
        <segment_edge_ids><edge_ids>
          23595090, 23595089, 23595088
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="31"
        instruction="Turn RIGHT onto Hampshire St (Going South)"
        distance="0.11043310832082466"
        time="0.26927274068196616">
        <segment_edge_ids><edge_ids>
          -23605909
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="32"
        instruction="Turn LEFT onto 25th St (Going East)"
        distance="0.05257565439032596"
        time="0.1281969706217448">
        <segment_edge_ids><edge_ids>
          23595179
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="33"
        instruction="Turn RIGHT onto Potrero Ave (Going South)"
        distance="0.050077673617465915"
        time="0.1221060593922933">
        <segment_edge_ids><edge_ids>
          -724773368, -724773367
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="34"
        instruction="Take RAMP toward Bayshore Blvd"
        distance="0.03984341188503202"
        time="0.09715151786804199">
        <segment_edge_ids><edge_ids>
          -915517048
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="35"
        instruction="Stay STRAIGHT to go onto Bayshore Blvd(Going Southeast)"
        distance="0.5910582184784158"
        time="1.0831619163354238">
        <segment_edge_ids><edge_ids>
          -915517047, -120885637, -830210066, -776735343, 
          -776735342, -756632225, -756632224, -127815508,
          -23621037, -23621038, -23621034, -756635722, 
          -756635721, -23597820, -756635724, -756635723
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="36"
        instruction="Turn LEFT onto Flower St (Going East)"
        distance="0.06390356064909457"
        time="0.15581818421681723">
        <segment_edge_ids><edge_ids>
          -23604154, -23604155
        </edge_ids></segment_edge_ids>
      </segment>
      <end_location>
        <location id="4" 
          longitude="-122.40459" latitude="37.74211" 
          house_number="99" street="FLOWER ST" city="SAN FRANCISCO" 
          state="CA" country="US" 
          driving_side="R" 
          postal_code="94124" 
          edge_id="23604155" percent="0.0"/>
      </end_location>
    </subroute>
    <subroute id="4" step_count="15" 
      distance="4.382421462359411" distance_unit="mile" 
      time="9.754673258463542" time_unit="minute" 
      start_location="4" end_location="1">
      <subroute_geometry>
        <LineString><coordinates>
          -122.40459,37.74211 -122.40459,37.74211 -122.40431,37.74253
          -122.40366,37.74342 -122.40322,37.74381 -122.40289,37.74515
          -122.40268,37.74635 -122.40295,37.74675 -122.40311,37.747 
          -122.40327,37.74723 -122.40332,37.74737 -122.40342,37.74753 
          -122.40348,37.74767 -122.40354,37.74787 -122.40365,37.74821 
          -122.40367,37.74839 -122.40366,37.74857 -122.40358,37.74883 
          -122.40353,37.74897 -122.40343,37.74916 -122.40336,37.74926 
          -122.40329,37.74932 -122.4032,37.74936 -122.40306,37.7494 
          -122.40283,37.74944 -122.40283,37.74994 -122.40281,37.75019
          -122.4028,37.75044 -122.40276,37.7505 -122.40266,37.75057 
          -122.40221,37.7506 -122.40231,37.75197 -122.40242,37.75326 
          -122.40254,37.75452 -122.40163,37.75458 -122.40178,37.75614 
          -122.40187,37.75714 -122.40198,37.75826 -122.40199,37.75842 
          -122.4021,37.75969 -122.40222,37.76095 -122.40235,37.76223 
          -122.40248,37.76352 -122.40254,37.76478 -122.40268,37.7661
          -122.40282,37.76738 -122.40295,37.76865 -122.40306,37.76983
          -122.40351,37.76981 -122.40363,37.76989 -122.40378,37.76999
          -122.40382,37.77002 -122.40386,37.77004 -122.4036,37.77025 
          -122.40285,37.77086 -122.40226,37.77134 -122.40203,37.77153 
          -122.40166,37.77183 -122.40131,37.77211 -122.40113,37.77226 
          -122.39968,37.7734 -122.39956,37.7735 -122.39943,37.77361 
          -122.39723,37.77535 -122.39539,37.77679 -122.39499,37.77711 
          -122.39457,37.77743 -122.3943,37.77764 -122.3939,37.77795
          -122.39356,37.77823 -122.39344,37.77832 -122.3933,37.77843 
          -122.39275,37.77886 -122.39259,37.77899 -122.39256,37.77902 
          -122.39239,37.77915 -122.39222,37.77929 -122.39203,37.77944 
          -122.39141,37.77994 -122.39108,37.7802 -122.39052,37.78062 
          -122.38974,37.78123 -122.38923,37.78161 -122.38911,37.78166 
          -122.38896,37.78173 -122.38863,37.78179 -122.38841,37.78181 
          -122.38814,37.7818 -122.38813,37.78195 -122.38811,37.7823
          -122.38811,37.78254 -122.3881,37.78266 -122.38806,37.78316 
          -122.38802,37.78335 -122.38791,37.78477 -122.38789,37.78504 
          -122.3878,37.7861 -122.3878,37.78615 -122.38771,37.78707 
          -122.3877,37.78722 -122.38769,37.78747 -122.3877,37.78766 
          -122.38772,37.78791 -122.38779,37.78835 -122.38788,37.7888 
          -122.38794,37.78896 -122.38816,37.78937 -122.38838,37.78965 
          -122.38859,37.78984 -122.38935,37.79047 -122.38978,37.79082 
          -122.38992,37.79095 -122.39013,37.7912 -122.39028,37.79141 
          -122.39041,37.79166 -122.39049,37.79181 -122.39061,37.79205 
          -122.39071,37.79226 -122.39093,37.79252 -122.39117,37.79276 
          -122.3915,37.79303 -122.392,37.79344 -122.39233,37.79374
          -122.39246,37.79387 -122.39257,37.79397 -122.39275,37.79414 
          -122.39303,37.7944 -122.39319,37.79455 -122.39335,37.79471 
          -122.39357,37.79494 -122.39374,37.79511 -122.39382,37.79518 
          -122.39407,37.79546 -122.39436,37.79579
        </coordinates></LineString>
      </subroute_geometry>
      <start_location>
        <location id="4" 
          longitude="-122.40459" latitude="37.74211"
          house_number="99" street="FLOWER ST" city="SAN FRANCISCO" 
          state="CA" country="US" 
          driving_side="R" 
          postal_code="94124" 
          edge_id="23604155" percent="0.0"/>
      </start_location>
      <segment sequence="1"
        instruction="Start out on Flower St (Going East)"
        distance="0.0"
        time="0.0">
        <segment_edge_ids><edge_ids>
          -23604155
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="2"
        instruction="Turn LEFT onto Loomis St (Going Northeast)"
        distance="0.1399739006534103"
        time="0.341303030649821">
        <segment_edge_ids><edge_ids>
          23609757, 23609756
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="3"
        instruction="Turn SLIGHT LEFT onto Barneveld Ave (Going North)"
        distance="0.1780836365735976"
        time="0.43422727584838866">
        <segment_edge_ids><edge_ids>
          23597607
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="4"
        instruction="Turn SLIGHT LEFT onto Jerrold Ave (Going Northwest)"
        distance="0.06884359716369064"
        time="0.16786363919576008">
        <segment_edge_ids><edge_ids>
          127821131
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="5"
        instruction="Stay STRAIGHT to go onto RAMP (Going Northwest)"
        distance="0.04681538329577495"
        time="0.11415150960286459">
        <segment_edge_ids><edge_ids>
          127821133
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="6"
        instruction="Stay STRAIGHT to go onto Cesar Chavez (Going North)"
        distance="0.1321568397517706"
        time="0.22154166897137959">
        <segment_edge_ids><edge_ids>
          23621025, 830210057, 830210058, 120885622
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="7"
        instruction="Turn LEFT onto Vermont St (Going North)"
        distance="0.06916050646352936"
        time="0.16863636970520018">
        <segment_edge_ids><edge_ids>
          754243248, 754243249
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="8"
        instruction="Turn SLIGHT RIGHT onto 26th St (Going East)"
        distance="0.036668115529443365"
        time="0.08940908908843995">
        <segment_edge_ids><edge_ids>
          23595258
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="9"
        instruction="Turn LEFT onto Kansas St (Going North)"
        distance="0.27153420476451817"
        time="0.6620909055074056">
        <segment_edge_ids><edge_ids>
          23608261, 23608260, 23608259
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="10"
        instruction="Turn RIGHT onto 23rd St (Going East)"
        distance="0.049897472846428766"
        time="0.12166666984558105">
        <segment_edge_ids><edge_ids>
          23595010
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="11"
        instruction="Turn LEFT onto Rhode Island St (Going North)"
        distance="1.0569688657972653"
        time="2.5772424399852754">
        <segment_edge_ids><edge_ids>
          933038005, 933038006, 933038001, 933038002, 
          23615271, 23615270, 23615269, 23615268, 
          23615267, 23615266, 23615265, 23615264,
          23615263
        </edge_ids></segment_edge_ids>
      </segment> 
      <segment sequence="12"
        instruction="Turn LEFT onto Division St (Going West)"
        distance="0.043919717429223945"
        time="0.10709091226259868">
        <segment_edge_ids><edge_ids>
          -23602204, 829577422, 829577423
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="13"
        instruction="Stay STRAIGHT to go onto RAMP (Going Northwest)"
        distance="0.0055987076548075785"
        time="0.013651515046755472">
        <segment_edge_ids><edge_ids>
          24552756
        </edge_ids></segment_edge_ids>
      </segment>
      <segment sequence="14"
        instruction="Turn RIGHT onto Townsend St (Going Northeast)"
        distance="1.192965882328057"
        time="2.9088484485944113">
        <segment_edge_ids><edge_ids>
          916742043, 916742044, 916742041, 916742042, 
          916637669, 916637670, 916637671, 916637672, 
          23618959, 724706739, 724706740, 915025718, 
          915025719, 915025717, 23618956, 915025720,
          915025721, 23618954, 916135978, 916135979, 
          916135980, 916135981, 916135982, 799424055,
          23618951, 23618950, 799362044, 799362045, 
          724686775, -23841533
        </edge_ids></segment_edge_ids>
      </segment> 
      <segment sequence="15"
        instruction="Turn LEFT onto The Embarcadero (Going North)"
        distance="1.0898340975809355"
        time="1.8269479304552079">
        <segment_edge_ids><edge_ids>
          807424014, 807424015, 733049265, 830425790, 
          830425791, 112011086, 799424653, 799424654, 
          724665449, 830416191, 830416192, 120886507, 
          120886508, 112011094, 112011097, 725001298,
          830434313, 830434314, 724945050, 724945051, 
          830222369, 830222370, 23841522, 825450115,  
          825450116, 127810052, 724791171, 724791172, 
          799417573, 799417574, 724791173, 724791174
        </edge_ids></segment_edge_ids>
      </segment>
      <end_location>
        <location id="1" 
          longitude="-122.39436" latitude="37.79579" 
          house_number="" street="HERB CAEN WAY" city="SAN FRANCISCO" 
          state="CA" country="US" 
          driving_side="R" postal_code="94111" 
          edge_id="724791174"percent="1.0"/>
      </end_location>
    </subroute>
  </route>
</route_response>

例14-5 住所で指定された場所、事前ジオコード済の場所および経度/緯度点での一括ルート・リクエスト

例14-5に、最速ルートをリクエストする自動車、最短ルートをリクエストする自動車、最速ルートをリクエストするトラックおよび最短ルートをリクエストするトラックとしての同じ2点間のルートの一括リクエストを示します。すべてのリクエストの場所は同じですが、これらは入力アドレス、事前ジオコード済の場所および経度/緯度点の組合せで指定されます。

<?xml version="1.0" standalone="yes"?>
<batch_route_request id="1">
<route_request id="1" 
        route_preference="fastest"
        road_preference="highway"
        return_locations="true"
        return_driving_directions="true"
        vehicle_type="auto" 
        distance_unit="mile" 
        time_unit="minute"
        >
  <start_location>
    <input_location id="1">
      <input_address>
        <us_form1 
          street="875 ALMA ST" 
          lastline="94301"/>
      </input_address>
    </input_location>
  </start_location>
  <end_location>
    <input_location id="2">
      <input_address>
        <us_form1
          street="660 BLOSSOM HILL RD" 
          lastline="95123" />
      </input_address>
    </input_location>
  </end_location>
</route_request>
<route_request id="2" 
        route_preference="shortest"
        road_preference="highway"
        pre_geocoded_locations="true"
        return_locations="true"
        return_driving_directions="true"
        vehicle_type="auto" 
        distance_unit="mile" 
        time_unit="minute"
        >
  <start_location>
    <pre_geocoded_location id="1">
      <edge_id>23694266</edge_id>
      <percent>0.0</percent>
      <side>R</side>
    </pre_geocoded_location>
  </start_location>
  <end_location>
    <pre_geocoded_location id="2">
      <edge_id>812218080</edge_id>
      <percent>0.0</percent>
      <side>R</side>
    </pre_geocoded_location>
  </end_location>
</route_request>
<route_request id="3" 
        route_preference="fastest"
        road_preference="highway"
        return_locations="true"
        return_driving_directions="true"
        vehicle_type="truck"
        truck_height="13.6"
        truck_length="75"
        truck_weight="30"   
        distance_unit="mile" 
        time_unit="minute"
        >
  <start_location>
     <input_location id="1"
       longitude="-122.15901" 
       latitude="37.4403" />
  </start_location>
  <end_location>
     <input_location id="2" 
       longitude="-121.83459" 
       latitude="37.25125" />
  </end_location>
</route_request>
<route_request id="4" 
     route_preference="shortest"
     road_preference="highway"
     pre_geocoded_locations="true"
     vehicle_type="truck"
     truck_height="13.6"
     truck_length="75"
     truck_weight="30"   
     return_driving_directions="true"
     distance_unit="mile" 
     time_unit="minute"
     >
  <start_location>
    <pre_geocoded_location id="1">
      <edge_id>23694266</edge_id>
      <percent>0.0</percent>
      <side>R</side>
      </pre_geocoded_location>
  </start_location>
  <end_location>
    <pre_geocoded_location id="2">
      <edge_id>812218080</edge_id>
      <percent>0.0</percent>
      <side>R</side>
    </pre_geocoded_location>
  </end_location>
</route_request>
</batch_route_request>

例14-6 住所で指定された場所、事前ジオコード済の場所および経度/緯度点での一括ルート・リクエストに対するレスポンス

例14-6に、例14-5のリクエストに対するレスポンスを示します。(出力は、読みやすくするために変更が加えられています。)

<!-- Oracle Routeserver version 12.1.0.2.0 (data version 11.1.0.7.1) -->
<batch_route_response>
<route_response>
  <route id="1" step_count="15"
    distance="26.103862121729946" distance_unit="mile" 
    time="26.6184814453125" time_unit="minute" 
    start_location="1" end_location="2">
    <start_location>
      <location id="1" 
        longitude="-122.15901" latitude="37.4403" 
        house_number="898" street="ALMA ST" city="PALO ALTO"
        state="CA" country="US" 
        driving_side="R" 
        postal_code="94301"
        edge_id="23694266" percent="0.0"/>
    </start_location>
    <segment sequence="1"
      instruction="Start out on Alma St (Going Southeast)"
      distance="1.3587211956625542" 
      time="2.504421416918437"/>
    <segment sequence="2"
      instruction="Take RAMP toward Oregon Expwy" 
      distance="0.12862735113732848"
      time="0.215624996026357"/>
    <segment sequence="3" 
      instruction="Stay STRAIGHT togo onto Oregon Expy (Going Northeast)" 
      distance="1.3840054698278719"
      time="2.3200833360354105"/>
    <segment sequence="4" 
      instruction="Take RAMP toward San Jose" 
      distance="0.2647486517044605" 
      time="0.44381250540415446"/>
    <segment sequence="5" 
      instruction="Stay STRAIGHT to go onto US-101 S (Going Southeast)"
      distance="11.747225529883993" 
      time="10.16387637803952"/>
    <segment sequence="6"
      instruction="Take RAMP toward Guadalupe Pkwy" 
      distance="0.40232399596959373"
      time="0.6744375069936116"/>
    <segment sequence="7" 
      instruction="Stay STRAIGHT to go onto CA-87 S (Going Southeast)"
      distance="2.6388802347934055"
      time="2.2831989218791326"/>
    <segment sequence="8" 
      instruction="Stay STRAIGHT to go onto CA-87 S (Going Southeast)" 
      distance="5.839967669586142"
      time="5.052827918032805"/>
    <segment sequence="9" 
      instruction="Stay STRAIGHT to go onto RAMP (Going South)" 
      distance="0.1527496425121632"
      time="0.15757692654927571"/>
    <segment sequence="10" 
      instruction="Continue on toward Gilroy" 
      distance="0.8405766344600814"
      time="0.8671410039067269"/>
    <segment sequence="11" 
      instruction="Stay STRAIGHT to go onto CA-85 S (Going East)" 
      distance="0.3956813619067624"
      time="0.34234946966171265"/>
    <segment sequence="12" 
      instruction="Take RAMP toward Blossom Hill Road" 
      distance="0.22891319287702547"
      time="0.38373958468437197"/> 
    <segment sequence="13" 
      instruction="Turn LEFT onto Blossom Hill Rd (Going East)" 
      distance="0.49810476095097306"
      time="0.8349999914566676"/>
    <segment sequence="14" 
      instruction="Turn LEFT onto Snell Ave (Going North)" 
      distance="0.011060709151221367"
      time="0.01854166587193807"/>
    <segment sequence="15" 
      instruction="Turn LEFT onto Blossom Hill Rd (Going West)" 
      distance="0.21227241518009607"
      time="0.35584374765555066"/>
    <end_location>
      <location id="2"
        longitude="-121.83459" latitude="37.25125" 
        house_number="499" street="BLOSSOM HILL RD" city="SAN JOSE" 
        state="CA" country="US" 
        driving_side="R"
        postal_code="95123" 
        edge_id="812218080" percent="0.0"/>
    </end_location>
  </route>
</route_response>
<route_response>
  <route id="2" step_count="18" 
    distance="24.879477393121235" distance_unit="mile"
    time="39.014546712239586" time_unit="minute" 
    start_location="1" end_location="2">
    <start_location>
      <location id="1" 
        longitude="" latitude=""
        house_number="" street="" city="" 
        state="" country="" 
        driving_side="N"
        postal_code="" 
        edge_id="23694266" percent="0.0"/>
    </start_location>
    <segment sequence="1" 
      instruction="Start out on Alma St (Going Southeast)"
      distance="0.2592928618616754" 
      time="0.6322424242893855"/>
    <segment sequence="2"
      instruction="Turn LEFT onto Kingsley Ave (Going Northeast)"
      distance="0.08879637204118493" 
      time="0.2165151596069336"/>
    <segment sequence="3" 
      instruction="Turn SLIGHT RIGHT onto Embarcadero Rd (Going East)"
      distance="0.6481327160471586"
      time="1.5803636133670806"/>
    <segment sequence="4"
      instruction="Turn RIGHT onto Middlefield Rd (Going Southeast)"
      distance="2.96746411421623" 
      time="7.235666685303053"/>
    <segment sequence="5"
      instruction="Stay STRAIGHT to go onto Old Middlefield Way (Going East)"
      distance="0.8495432761786168" 
      time="1.789845637480418"/>
    <segment sequence="6"
      instruction="Stay STRAIGHT to go onto RAMP (Going East)"
      distance="0.22642142849860966" 
      time="0.37956250508626305"/>
    <segment sequence="7" 
      instruction="Stay STRAIGHT to go onto US-101 S (Going Southeast)"
      distance="9.176685525492026" 
      time="7.939806487659613"/>
    <segment sequence="8"
      instruction="Take RAMP toward Brokaw Road" 
      distance="0.20942024511139234"
      time="0.3510625004768372"/>
    <segment sequence="9" 
      instruction="Stay STRAIGHT to go onto Old Bayshore Hwy (Going East)" 
      distance="0.1670850676627406"
      time="0.2800937493642171"/>
    <segment sequence="10" 
      instruction="Turn SLIGHT RIGHT onto N 1st St (Going Southeast)" 
      distance="1.9476604686858663"
      time="3.9989981204271317"/>
    <segment sequence="11" 
      instruction="Turn LEFT onto Jackson St (Going Northeast)" 
      distance="0.07099981550357595"
      time="0.17312120993932087"/>
    <segment sequence="12" 
      instruction="Turn RIGHT onto 2nd St (Going Southeast)" 
      distance="2.3224258991749434"
      time="5.6628484646479285"/>
    <segment sequence="13" 
      instruction="Stay STRAIGHT to go onto S 1st St (Going Southeast)" 
      distance="0.18884608205270126"
      time="0.31657291650772096"/>
    <segment sequence="14" 
      instruction="Stay STRAIGHT to go onto Monterey Rd (Going Southeast)" 
      distance="3.887951286200716"
      time="5.287046383817991"/>
    <segment sequence="15" 
      instruction="Turn SLIGHT RIGHT onto RAMP (Going South)" 
      distance="0.0414465897894999"
      time="0.1010606050491333"/>
    <segment sequence="16" 
      instruction="Turn RIGHT onto Skyway Dr (Going Southwest)" 
      distance="0.34504443027423093"
      time="0.5849081456661225"/>
    <segment sequence="17" 
      instruction="Turn LEFT onto Snell Ave (Going East)" 
      distance="1.279357478030909" 
      time="2.1446562389532726"/>
    <segment sequence="18" 
      instruction="Turn RIGHT onto Blossom Hill Rd (Going West)" 
      distance="0.20292052293456395"
      time="0.34016666412353513"/>
    <end_location>
      <location id="2" 
        longitude="" latitude="" 
        house_number="" street="" city="" 
        state="" country=""
        driving_side="N" 
        postal_code="" 
        edge_id="812218080" percent="0.0"/>
    </end_location>
  </route>
</route_response>
<route_response>
  <route id="3" step_count="14" 
    distance="25.906590792580626" distance_unit="mile"
    time="29.140561930338542" time_unit="minute" 
    start_location="1" end_location="2">
    <start_location>
      <location id="1" 
        longitude="-122.15901" latitude="37.4403" 
        house_number="900" street="ALMA ST" city="PALO ALTO"
        state="CA" country="US" 
        driving_side="R" 
        postal_code="94301"
        edge_id="23694267" percent="1.0"/>
    </start_location>
    <segment sequence="1"
      instruction="Start out on Alma St (Going Northwest)" 
      distance="0.0"
      time="0.0"/>
    <segment sequence="2" 
      instruction="Turn RIGHT onto Channing Ave(Going Northeast)" 
      distance="2.1771018293093087"
      time="5.30849996805191"/>
    <segment sequence="3" 
      instruction="Turn RIGHT onto W Bayshore Rd (Going Southwest)" 
      distance="0.12998197519156232"
      time="0.31693938573201497"/>
    <segment sequence="4" 
      instruction="Turn LEFT onto Embarcadero Rd (Going Northeast)" 
      distance="0.006878766976215882"
      time="0.016772727171579998"/>
    <segment sequence="5" 
      instruction="Take RAMP toward San Jose" 
      distance="0.4222705568230516"
      time="0.707875007390976"/>
    <segment sequence="6" 
      instruction="Stay STRAIGHT to go onto US-101 S (Going Southeast)" 
      distance="11.747225529883993"
      time="10.16387637803952"/>
    <segment sequence="7" 
      instruction="Take RAMP toward Guadalupe Pkwy" 
      distance="0.40232399596959373"
      time="0.6744375069936116"/>
    <segment sequence="8" 
      instruction="Stay STRAIGHT to go onto CA-87 S (Going Southeast)"
      distance="2.6388802347934055"
      time="2.2831989218791326"/>
    <segment sequence="9" 
      instruction="Stay STRAIGHT to go onto CA-87 S (Going Southeast)" 
      distance="4.708519202974121"
      time="4.073881677289804"/>
    <segment sequence="10" 
      instruction="Take EXIT 1D toward Capitol Expwy Auto Mall" 
      distance="0.23860684637032842"
      time="0.3948361724615097"/>
    <segment sequence="11" 
      instruction="Turn LEFT onto W Capitol Expy (Going East)" 
      distance="1.2198347095111897"
      time="1.4871818164984385"/>
    <segment sequence="12" 
      instruction="Turn SLIGHT RIGHT onto RAMP (Going East)" 
      distance="0.029621573459855412"
      time="0.049656248092651366"/>
    <segment sequence="13" 
      instruction="Turn SLIGHT RIGHT onto Snell Ave (Going Southeast)" 
      distance="1.9824209209108623"
      time="3.3232395708560944"/>
    <segment sequence="14" 
      instruction="Turn RIGHT onto Blossom Hill Rd (Going West)" 
      distance="0.20292052293456395"
      time="0.34016666412353513"/>
    <end_location>
      <location id="2"
        longitude="-121.83459" latitude="37.25125" 
        house_number="499" street="BLOSSOM HILL RD" city="SAN JOSE" 
        state="CA" country="US" 
        driving_side="R"
        postal_code="95123" 
        edge_id="812218080" percent="0.0"/>
    </end_location>
  </route>
</route_response>
<route_response>
  <route id="4" step_count="28" 
    distance="25.43010499518424" distance_unit="mile"
    time="41.812373860677084" time_unit="minute" 
    start_location="1" end_location="2">
    <segment sequence="1" 
    instruction="Start out on Alma St (Going Southeast)" 
    distance="2.512197865475656"
    time="4.438056838512421"/>
    <segment sequence="2" 
      instruction="Turn RIGHT onto W Meadow Dr (Going Southwest)" 
      distance="0.259249367249032"
      time="0.6321363727251689"/>
    <segment sequence="3" 
      instruction="Turn LEFT onto El Camino Way (Going Southeast)" 
      distance="0.19732181646496028"
      time="0.48113636175791424"/>
    <segment sequence="4" 
      instruction="Stay STRAIGHT to go onto RAMP (Going Southwest)" 
      distance="0.009935996875112263"
      time="0.02422727147738139"/>
    <segment sequence="5" 
      instruction="Turn LEFT onto El Camino Real (Going Southeast)" 
      distance="0.7259305251035061"
      time="1.2169166604677837"/>
    <segment sequence="6" 
      instruction="Stay STRAIGHT to go onto El Camino Real (Going Southeast)" 
      distance="10.18052570327847"
      time="17.06616668154796"/>
    <segment sequence="7" 
      instruction="Turn RIGHT onto Madison St (Going Southeast)" 
      distance="0.1341639244777912"
      time="0.32713637351989744"/>
    <segment sequence="8" 
      instruction="Turn LEFT onto Harrison St (Going East)" 
      distance="0.06893059350020074"
      time="0.16807576020558676"/>
    <segment sequence="9" 
      instruction="Turn RIGHT onto Monroe St (Going Southeast)" 
      distance="0.0705648403396469"
      time="0.1720606009165446"/>
    <segment sequence="10" 
      instruction="Turn LEFT onto Fremont St (Going East)" 
      distance="0.07203753203577691"
      time="0.17565151850382488"/>
    <segment sequence="11" 
      instruction="Turn RIGHT onto Jackson St (Going Southeast)" 
      distance="0.2098303612161659"
      time="0.5116363684336345"/>
    <segment sequence="12" 
      instruction="Turn LEFT onto Homestead Rd (Going East)" 
      distance="0.13950164667868017"
      time="0.3401515007019043"/>
    <segment sequence="13" 
      instruction="Turn RIGHT onto Washington St (Going Southeast)" 
      distance="0.14307462872056173"
      time="0.3488636334737142"/>
    <segment sequence="14" 
      instruction="Turn LEFT onto Santa Clara St (Going East)" 
      distance="0.06947120055412777"
      time="0.16939393679300943"/>
    <segment sequence="15" 
      instruction="Turn RIGHT onto Lafayette St (Going Southeast)" 
      distance="0.06759460559205673"
      time="0.16481818358103434"/>
    <segment sequence="16" 
      instruction="Turn LEFT onto Market St (Going East)" 
      distance="0.17456658015544202"
      time="0.4256515165170034"/>
    <segment sequence="17" 
      instruction="Turn RIGHT onto The Alameda (Going Southeast)" 
      distance="2.317572876182314"
      time="4.207776539524397"/>
    <segment sequence="18" 
      instruction="Stay STRAIGHT to go onto W Santa Clara St (Going East)" 
      distance="0.03303921082684557"
      time="0.05538541873296102"/>
    <segment sequence="19" 
      instruction="Stay STRAIGHT to go onto CA-82 (Going East)" 
      distance="0.05555210434715647"
      time="0.09312500158945719"/>
    <segment sequence="20" 
      instruction="Stay STRAIGHT to go onto W Santa Clara St (Going East)" 
      distance="0.17006772690279195"
      time="0.33163256843884786"/>
    <segment sequence="21" 
      instruction="Turn RIGHT onto Delmas Ave (Going Southeast)" 
      distance="0.49640216162493195"
      time="1.2103939274946849"/>
    <segment sequence="22" 
      instruction="Take CA-87 RAMP toward Guadalupe Pky" 
      distance="0.1178586975602079"
      time="0.197572918732961"/>
    <segment sequence="23" 
      instruction="Stay STRAIGHT to go onto CA-87 S (Going Southeast)" 
      distance="3.628403629205081"
      time="3.139349430302779"/>
    <segment sequence="24" 
      instruction="Take EXIT 1D toward Capitol Expwy Auto Mall" 
      distance="0.23860684637032842"
      time="0.3948361724615097"/>
    <segment sequence="25" 
      instruction="Turn LEFT onto W Capitol Expy (Going East)" 
      distance="0.9895544609762458"
      time="1.2064318120479585"/>
    <segment sequence="26" 
      instruction="Turn SLIGHT RIGHT onto Rosenbaum Ave (Going East)" 
      distance="0.49535202237807563"
      time="1.2078333616256713"/>
    <segment sequence="27" 
      instruction="Turn RIGHT onto Snell Ave (Going Southeast)" 
      distance="1.649872606747162"
      time="2.7657708187898"/>
    <segment sequence="28" 
      instruction="Turn RIGHT onto Blossom Hill Rd (Going West)" 
      distance="0.20292052293456395" 
      time="0.34016666412353513"/>
  </route>
</route_response>
</batch_route_response>

例14-7 ルート・プリファレンスにトラフィックを指定したルート・リクエスト

この例では、route_preferencetrafficに、return_route_time‘true’に設定したルート・リクエストを示します。前者はルーターにトラフィックを使用するよう指示し、後者はレスポンスに出発時間と到着時間を含めるよう指示します。

<?xml version="1.0" standalone="yes"?>
<route_request id="2" 
               route_preference="traffic"
               return_route_time="true"
               road_preference="highway" 
               return_driving_directions="true"
               distance_unit="mile" 
               time_unit="minute"
               return_route_geometry="false">
  <start_location>
     <input_location id="1">
       <input_address>
         <us_form1 street="1 Oracle Drive" lastline="Nashua, NH" />
       </input_address>
     </input_location>
  </start_location>
  <end_location>
     <input_location id="2">
       <input_address>
         <us_form1 street="77 Massachusetts Ave" lastline="cambridge, ma" />
       </input_address>
     </input_location>
  </end_location>
</route_request>

例14-8 ルート・プリファレンスにトラフィックを指定したルート・リクエストのレスポンス

前述のリクエストに対するレスポンスは、次のとおりです。

<!--
 Oracle Routeserver version 12.2.0.1.2 (data version 12.1.0.2.0) 
-->
<route_response>
<route id="2" step_count="24" distance="40.08" distance_unit="mile" time="44.92" time_unit="minute" start_location="1" end_location="2" start_time="17-Aug-2016 11:04 EDT" end_time="17-Aug-2016 11:48 EDT">
<segment sequence="1" instruction="Start out on Oracle Dr (Going South)" distance="0.16" time="0.79"/>
<segment sequence="2" instruction="Turn LEFT onto Spit Brook Rd (Going East)" distance="0.38" time="1.01"/>
<segment sequence="3" instruction="Take RAMP toward Boston" distance="0.31" time="0.35"/>
<segment sequence="4" instruction="Stay STRAIGHT to go onto US-3 S (Going South)" distance="9.28" time="9.58"/>
<segment sequence="5" instruction="Take EXIT 31-30B-A toward Lawrence" distance="1.38" time="1.42"/>
<segment sequence="6" instruction="Stay STRAIGHT to go onto US-3 S (Going Southeast)" distance="9.85" time="10.16"/>
<segment sequence="7" instruction="Continue on toward Boston" distance="0.35" time="0.36"/>
<segment sequence="8" instruction="Stay STRAIGHT to go onto RAMP (Going West)" distance="0.95" time="0.98"/>
<segment sequence="9" instruction="Merge onto I-95 N/RT-128 N (Going East)" distance="4.82" time="4.97"/>
<segment sequence="10" instruction="Take EXIT 37A toward Boston" distance="0.44" time="0.45"/>
<segment sequence="11" instruction="Stay STRAIGHT to go onto I-93 S (Going South)" distance="8.64" time="8.21"/>
<segment sequence="12" instruction="Take EXIT 26 toward N. Station" distance="0.18" time="0.19"/>
<segment sequence="13" instruction="Turn SLIGHT LEFT onto Leverett Circle Conn (Going South)" distance="1.45" time="1.91"/>
<segment sequence="14" instruction="Take RAMP toward Leverett Cir" distance="0.03" time="0.07"/>
<segment sequence="15" instruction="Turn LEFT onto Nashua St (Going Southwest)" distance="0.04" time="0.10"/>
<segment sequence="16" instruction="Turn RIGHT onto Monsignor Obrien Hwy/RT-28 N (Going Northwest)" distance="0.31" time="0.75"/>
<segment sequence="17" instruction="Turn LEFT onto RAMP (Going Southwest)" distance="0.01" time="0.02"/>
<segment sequence="18" instruction="Stay STRAIGHT to go onto Edwin H Land Blvd (Going Southwest)" distance="0.53" time="1.29"/>
<segment sequence="19" instruction="Stay STRAIGHT to go onto 1st St (Going South)" distance="0.05" time="0.11"/>
<segment sequence="20" instruction="Stay STRAIGHT to go onto RT-3 N (Going South)" distance="0.03" time="0.08"/>
<segment sequence="21" instruction="Take RAMP toward Boston" distance="0.07" time="0.17"/>
<segment sequence="22" instruction="Stay STRAIGHT to go onto Memorial Dr (Going West)" distance="0.59" time="1.10"/>
<segment sequence="23" instruction="Take RT-2A RAMP toward Mass. Ave. North" distance="0.12" time="0.19"/>
<segment sequence="24" instruction="Turn RIGHT onto Massachusetts Ave/RT-2A (Going Northwest)" distance="0.12" time="0.66"/>
</route>
</route_response>

例14-9 ルート・プリファレンスにトラフィックを指定し、出発日時を指定したルート・リクエスト

この例では、出発日と出発時間が指定されたリクエストを示します。

<?xml version="1.0" standalone="yes"?>
<route_request id="2" 
               route_preference="traffic"
               return_route_time="true"
               start_time="16:30"
               start_date="19-Aug-2016"
               road_preference="highway" 
               return_driving_directions="true"
               distance_unit="mile" 
               time_unit="minute"
               return_route_geometry="false">
  <start_location>
     <input_location id="1">
       <input_address>
         <us_form1 street="1 Oracle Drive" lastline="Nashua, NH" />
       </input_address>
     </input_location>
  </start_location>
  <end_location>
     <input_location id="2">
       <input_address>
         <us_form1 street="77 Massachusetts Ave" lastline="cambridge, ma" />
       </input_address>
     </input_location>
  </end_location>
</route_request>

例14-10 ルート・プリファレンスにトラフィックを指定し、出発日時を指定したルート・リクエストのレスポンス

前述のリクエストに対するレスポンスは、次のとおりです。

<!--
 Oracle Routeserver version 12.2.0.1.2 (data version 12.1.0.2.0) 
-->
<route_response>
<route id="2" step_count="24" distance="40.08" distance_unit="mile" time="44.96" time_unit="minute" start_location="1" end_location="2" start_time="19-Aug-2016 16:30 EDT" end_time="19-Aug-2016 17:14 EDT">
<segment sequence="1" instruction="Start out on Oracle Dr (Going South)" distance="0.16" time="0.79"/>
<segment sequence="2" instruction="Turn LEFT onto Spit Brook Rd (Going East)" distance="0.38" time="1.03"/>
<segment sequence="3" instruction="Take RAMP toward Boston" distance="0.31" time="0.34"/>
<segment sequence="4" instruction="Stay STRAIGHT to go onto US-3 S (Going South)" distance="9.28" time="9.58"/>
<segment sequence="5" instruction="Take EXIT 31-30B-A toward Lawrence" distance="1.38" time="1.42"/>
<segment sequence="6" instruction="Stay STRAIGHT to go onto US-3 S (Going Southeast)" distance="9.85" time="10.16"/>
<segment sequence="7" instruction="Continue on toward Boston" distance="0.35" time="0.36"/>
<segment sequence="8" instruction="Stay STRAIGHT to go onto RAMP (Going West)" distance="0.95" time="0.98"/>
<segment sequence="9" instruction="Merge onto I-95 N/RT-128 N (Going East)" distance="4.82" time="4.97"/>
<segment sequence="10" instruction="Take EXIT 37A toward Boston" distance="0.44" time="0.45"/>
<segment sequence="11" instruction="Stay STRAIGHT to go onto I-93 S (Going South)" distance="8.64" time="8.21"/>
<segment sequence="12" instruction="Take EXIT 26 toward N. Station" distance="0.18" time="0.19"/>
<segment sequence="13" instruction="Turn SLIGHT LEFT onto Leverett Circle Conn (Going South)" distance="1.45" time="1.91"/>
<segment sequence="14" instruction="Take RAMP toward Leverett Cir" distance="0.03" time="0.07"/>
<segment sequence="15" instruction="Turn LEFT onto Nashua St (Going Southwest)" distance="0.04" time="0.10"/>
<segment sequence="16" instruction="Turn RIGHT onto Monsignor Obrien Hwy/RT-28 N (Going Northwest)" distance="0.31" time="0.75"/>
<segment sequence="17" instruction="Turn LEFT onto RAMP (Going Southwest)" distance="0.01" time="0.02"/>
<segment sequence="18" instruction="Stay STRAIGHT to go onto Edwin H Land Blvd (Going Southwest)" distance="0.53" time="1.29"/>
<segment sequence="19" instruction="Stay STRAIGHT to go onto 1st St (Going South)" distance="0.05" time="0.11"/>
<segment sequence="20" instruction="Stay STRAIGHT to go onto RT-3 N (Going South)" distance="0.03" time="0.08"/>
<segment sequence="21" instruction="Take RAMP toward Boston" distance="0.07" time="0.17"/>
<segment sequence="22" instruction="Stay STRAIGHT to go onto Memorial Dr (Going West)" distance="0.59" time="1.10"/>
<segment sequence="23" instruction="Take RT-2A RAMP toward Mass. Ave. North" distance="0.12" time="0.19"/>
<segment sequence="24" instruction="Turn RIGHT onto Massachusetts Ave/RT-2A (Going Northwest)" distance="0.12" time="0.67"/>
</route>
</route_response>

例14-11 ルート・プリファレンスにトラフィックを指定し、出発日時を指定した(デフォルト書式を使用しない)ルート・リクエスト

この例では、入力と出力の日付と時間の書式が前述のリクエストとは異なるリクエストを示します。

<?xml version="1.0" standalone="yes"?>
<route_request id="2" 
               route_preference="traffic"
               return_route_time="true"
               date_format="yy/MM/dd"
               time_format="hh:mm a"
               output_time_format="yyyy-MM-dd hh:mm:ss a"
               start_time="4:30 pm"
               start_date="16/08/19"
               road_preference="highway" 
               return_driving_directions="true"
               distance_unit="mile" 
               time_unit="minute"
               return_route_geometry="false">
  <start_location>
     <input_location id="1">
       <input_address>
         <us_form1 street="1 Oracle Drive" lastline="Nashua, NH" />
       </input_address>
     </input_location>
  </start_location>
  <end_location>
     <input_location id="2">
       <input_address>
         <us_form1 street="77 Massachusetts Ave" lastline="cambridge, ma" />
       </input_address>
     </input_location>
  </end_location>
</route_request>

例14-12 ルート・プリファレンスにトラフィックを指定し、出発日時を指定した(デフォルト書式を使用しない)ルート・リクエストのレスポンス

前述のリクエストに対するレスポンスは、次のとおりです。

<!--
 Oracle Routeserver version 12.2.0.1.2 (data version 12.1.0.2.0) 
-->
<route_response>
<route id="2" step_count="24" distance="40.08" distance_unit="mile" time="44.96" time_unit="minute" start_location="1" end_location="2" start_time="2016-08-19 04:30:00 PM" end_time="2016-08-19 05:14:57 PM">
<segment sequence="1" instruction="Start out on Oracle Dr (Going South)" distance="0.16" time="0.79"/>
<segment sequence="2" instruction="Turn LEFT onto Spit Brook Rd (Going East)" distance="0.38" time="1.03"/>
<segment sequence="3" instruction="Take RAMP toward Boston" distance="0.31" time="0.34"/>
<segment sequence="4" instruction="Stay STRAIGHT to go onto US-3 S (Going South)" distance="9.28" time="9.58"/>
<segment sequence="5" instruction="Take EXIT 31-30B-A toward Lawrence" distance="1.38" time="1.42"/>
<segment sequence="6" instruction="Stay STRAIGHT to go onto US-3 S (Going Southeast)" distance="9.85" time="10.16"/>
<segment sequence="7" instruction="Continue on toward Boston" distance="0.35" time="0.36"/>
<segment sequence="8" instruction="Stay STRAIGHT to go onto RAMP (Going West)" distance="0.95" time="0.98"/>
<segment sequence="9" instruction="Merge onto I-95 N/RT-128 N (Going East)" distance="4.82" time="4.97"/>
<segment sequence="10" instruction="Take EXIT 37A toward Boston" distance="0.44" time="0.45"/>
<segment sequence="11" instruction="Stay STRAIGHT to go onto I-93 S (Going South)" distance="8.64" time="8.21"/>
<segment sequence="12" instruction="Take EXIT 26 toward N. Station" distance="0.18" time="0.19"/>
<segment sequence="13" instruction="Turn SLIGHT LEFT onto Leverett Circle Conn (Going South)" distance="1.45" time="1.91"/>
<segment sequence="14" instruction="Take RAMP toward Leverett Cir" distance="0.03" time="0.07"/>
<segment sequence="15" instruction="Turn LEFT onto Nashua St (Going Southwest)" distance="0.04" time="0.10"/>
<segment sequence="16" instruction="Turn RIGHT onto Monsignor Obrien Hwy/RT-28 N (Going Northwest)" distance="0.31" time="0.75"/>
<segment sequence="17" instruction="Turn LEFT onto RAMP (Going Southwest)" distance="0.01" time="0.02"/>
<segment sequence="18" instruction="Stay STRAIGHT to go onto Edwin H Land Blvd (Going Southwest)" distance="0.53" time="1.29"/>
<segment sequence="19" instruction="Stay STRAIGHT to go onto 1st St (Going South)" distance="0.05" time="0.11"/>
<segment sequence="20" instruction="Stay STRAIGHT to go onto RT-3 N (Going South)" distance="0.03" time="0.08"/>
<segment sequence="21" instruction="Take RAMP toward Boston" distance="0.07" time="0.17"/>
<segment sequence="22" instruction="Stay STRAIGHT to go onto Memorial Dr (Going West)" distance="0.59" time="1.10"/>
<segment sequence="23" instruction="Take RT-2A RAMP toward Mass. Ave. North" distance="0.12" time="0.19"/>
<segment sequence="24" instruction="Turn RIGHT onto Massachusetts Ave/RT-2A (Going Northwest)" distance="0.12" time="0.67"/>
</route>
</route_response>

例14-13 ルート・プリファレンスが最短パスで時間を組み込む(return_route_timeがtrue)ルート・リクエスト

この例では、route_preferenceshortest(trafficではない)に、return_route_timetrueに設定したルート・リクエストを示します。

<?xml version="1.0" standalone="yes"?>
<route_request id="1" 
               route_preference="shortest"
               return_route_time="true"
               road_preference="highway" 
               return_driving_directions="true"
               distance_unit="mile" 
               time_unit="minute"
               return_route_geometry="false"
          >
  <start_location>
     <input_location id="1" country="us" longitude="-86.49826" latitude="41.464588" />
  </start_location>
  <end_location>
     <input_location id="2" country="us" longitude="-86.562759" latitude="41.476311" />
  </end_location>
</route_request>

例14-14 ルート・プリファレンスが最短パスで時間を組み込む(return_route_timeがtrue)ルート・リクエストのレスポンス

前述のリクエストに対するレスポンスは、次のとおりです。出発地と目的地のタイム・ゾーンが異なり、その結果、目的地への到着時間が出発地の出発時間より前であることを示しています

<!--
 Oracle Routeserver version 12.2.0.1.2 (data version 12.1.0.2.0) 
-->
<route_response>
<route id="1" step_count="4" distance="4.11" distance_unit="mile" time="5.01" time_unit="minute" start_location="1" end_location="2" start_time="17-Aug-2016 11:13 EDT" end_time="17-Aug-2016 10:18 CDT">
<segment sequence="1" instruction="Start out on Industrial Park Dr (Going East)" distance="0.52" time="1.27"/>
<segment sequence="2" instruction="Turn LEFT onto US-6 (Going West)" distance="0.61" time="0.67"/>
<segment sequence="3" instruction="Stay STRAIGHT to go onto Zietler Trl/US-6 (Going Northwest)" distance="0.49" time="0.51"/>
<segment sequence="4" instruction="Stay STRAIGHT to go onto US-6 (Going West)" distance="2.49" time="2.56"/>
</route>
</route_response>

例14-15 トラフィック・プリファレンス、デフォルト日時書式および指定した時間書式を使用するマルチストップ・ルート・リクエスト

この例では、入力にデフォルトの日時書式を使用し、出力に異なる時間書式を使用するマルチストップ・ルートのリクエストを示します。return_subroute_timetrueに設定することで、ルートの各ステップにかかる時間を表示するようルーターに指示します。

<?xml version="1.0" standalone="yes"?>
<route_request id="3"
              route_preference="traffic"
              return_route_time="true"
              return_subroute_time="true"
              output_time_format="yyyy-MM-dd hh:mm:ss a"
              start_time="23:40"
              start_date="25-Aug-2016"
              road_preference="highway"
              optimize_route="false"
              route_type="open"
              return_driving_directions="true"
              return_locations="true"
              return_subroutes="true"
              distance_unit="mile"
              time_unit="minute"
              return_route_geometry="false"
              return_subroute_geometry="false"
              return_segment_geometry="false">
 <start_location>
    <input_location id="1">
      <input_address>
        <us_form1 street="world trade center " lastline="san francisco, ca" />
      </input_address>
    </input_location>
 </start_location>
 <location>
    <input_location id="2">
      <input_address>
        <us_form1 street="golden gate park" lastline="san francisco, ca" />
      </input_address>
    </input_location>
 </location>
 <location>
    <input_location id="3">
      <input_address>
        <us_form1 street="3001 Larkin St" lastline="san francisco, ca" />
      </input_address>
    </input_location>
 </location>
 <end_location>
    <input_location id="4">
      <input_address>
        <us_form1 street="100 flower st" lastline="san francisco, ca" />
      </input_address>
    </input_location>
 </end_location>
</route_request>

例14-16 トラフィック・プリファレンス、デフォルト日時書式および指定した時間書式を使用するマルチストップ・ルート・リクエストのレスポンス

前述のリクエストに対するレスポンスは、次のとおりです。このレスポンスでは、ルートの途中で午前0時を過ぎるため、日付が変わることを示しています。

<!--
 Oracle Routeserver version 12.2.0.1.2 (data version 12.1.0.2.0) 
-->
<route_response>
<route id="3" step_count="42" distance="15.25" distance_unit="mile" time="33.69" time_unit="minute" start_location="1" end_location="4" start_time="2016-08-25 11:40:00 PM" end_time="2016-08-26 12:13:42 AM">
<start_location>
<location id="1" longitude="-122.39436" latitude="37.79579" house_number="161" street="WORLD TRADE CTR" city="SAN FRANCISCO" state="CA" country="US" driving_side="R" postal_code="94111" edge_id="724791175"percent="0.0"/>
</start_location>
<end_location>
<location id="4" longitude="-122.40459" latitude="37.74211" house_number="99" street="FLOWER ST" city="SAN FRANCISCO BAY AREA" state="CA" country="US" driving_side="R" postal_code="94124" edge_id="23604155"percent="0.0"/>
</end_location>
<subroute id="1" step_count="13" distance="5.42" distance_unit="mile" time="11.23" time_unit="minute" start_location="1" end_location="2" start_time="2016-08-25 11:40:00 PM" end_time="2016-08-25 11:51:14 PM">
<start_location>
<location id="1" longitude="-122.39436" latitude="37.79579" house_number="161" street="WORLD TRADE CTR" city="SAN FRANCISCO" state="CA" country="US" driving_side="R" postal_code="94111"edge_id="724791175" percent="0.0"/>
</start_location>
<segment sequence="1" instruction="Start out on The Embarcadero (Going Northwest)" distance="0.02" time="0.04"/>
<segment sequence="2" instruction="Turn SLIGHT LEFT onto RAMP (Going West)" distance="0.03" time="0.08"/>
<segment sequence="3" instruction="Turn SLIGHT LEFT onto The Embarcadero (Going Southeast)" distance="0.31" time="0.77"/>
<segment sequence="4" instruction="Turn RIGHT onto Howard St (Going Southwest)" distance="0.89" time="2.61"/>
<segment sequence="5" instruction="Turn LEFT onto 4th St (Going Southeast)" distance="0.24" time="0.59"/>
<segment sequence="6" instruction="Turn RIGHT onto RAMP (Going South)" distance="0.18" time="0.21"/>
<segment sequence="7" instruction="Stay STRAIGHT to go onto I-80 W (Going Southwest)" distance="0.70" time="0.85"/>
<segment sequence="8" instruction="Take EXIT 1B toward Golden Gate Bridge" distance="0.35" time="0.43"/>
<segment sequence="9" instruction="Stay STRAIGHT to go onto Central Fwy/US-101 N (Going West)" distance="0.76" time="0.93"/>
<segment sequence="10" instruction="Stay STRAIGHT to go onto Octavia Blvd (Going Northwest)" distance="0.27" time="0.64"/>
<segment sequence="11" instruction="Turn LEFT onto Fell St (Going West)" distance="1.65" time="4.01"/>
<segment sequence="12" instruction="Stay STRAIGHT to go onto Kezar Dr (Going Southwest)" distance="0.01" time="0.02"/>
<segment sequence="13" instruction="Stay STRAIGHT to go onto John F Kennedy Dr (Going West)" distance="0.02" time="0.05"/>
<end_location>
<location id="2" longitude="-122.45414" latitude="37.77144" house_number="7" street="JOHN F KENNEDY DR" city="SAN FRANCISCO BAY AREA" state="CA" country="US" driving_side="R" postal_code="94118"edge_id="728011751" percent="0.0"/>
</end_location>
</subroute>
<subroute id="2" step_count="13" distance="4.46" distance_unit="mile" time="10.61" time_unit="minute" start_location="2" end_location="3" start_time="2016-08-25 11:51:14 PM" end_time="2016-08-26 12:01:51 AM">
<start_location>
<location id="2" longitude="-122.45414" latitude="37.77144" house_number="7" street="JOHN F KENNEDY DR" city="SAN FRANCISCO BAY AREA" state="CA" country="US" driving_side="R" postal_code="94118"edge_id="728011751" percent="0.0"/>
</start_location>
<segment sequence="1" instruction="Start out on John F Kennedy Dr (Going West)" distance="0.02" time="0.05"/>
<segment sequence="2" instruction="Stay STRAIGHT to go onto Kezar Dr (Going Southwest)" distance="0.15" time="0.38"/>
<segment sequence="3" instruction="Stay STRAIGHT to go onto John F Kennedy Dr (Going East)" distance="0.04" time="0.11"/>
<segment sequence="4" instruction="Stay STRAIGHT to go onto Oak St (Going Northeast)" distance="0.46" time="1.11"/>
<segment sequence="5" instruction="Turn LEFT onto Masonic Ave (Going North)" distance="0.71" time="2.27"/>
<segment sequence="6" instruction="Turn RIGHT onto Geary Blvd (Going East)" distance="1.26" time="2.12"/>
<segment sequence="7" instruction="Stay STRAIGHT to go onto Starr King Way (Going East)" distance="0.10" time="0.23"/>
<segment sequence="8" instruction="Stay STRAIGHT to go onto O'Farrell St (Going East)" distance="0.02" time="0.06"/>
<segment sequence="9" instruction="Turn LEFT onto Franklin St (Going North)" distance="0.13" time="0.32"/>
<segment sequence="10" instruction="Turn RIGHT onto Post St (Going East)" distance="0.09" time="0.23"/>
<segment sequence="11" instruction="Turn LEFT onto Van Ness Ave (Going North)" distance="1.29" time="3.15"/>
<segment sequence="12" instruction="Turn RIGHT onto North Point St (Going East)" distance="0.18" time="0.61"/>
<segment sequence="13" instruction="Turn LEFT onto Larkin St (Going North)" distance="0.00" time="0.00"/>
<end_location>
<location id="3" longitude="-122.422" latitude="37.80551" house_number="3001" street="LARKIN ST" city="SAN FRANCISCO" state="CA" country="US" driving_side="R" postal_code="94109" edge_id="23609030"percent="0.0"/>
</end_location>
</subroute>
<subroute id="3" step_count="16" distance="5.38" distance_unit="mile" time="11.85" time_unit="minute" start_location="3" end_location="4" start_time="2016-08-26 12:01:51 AM" end_time="2016-08-26 12:13:42 AM">
<start_location>
<location id="3" longitude="-122.422" latitude="37.80551" house_number="3001" street="LARKIN ST" city="SAN FRANCISCO" state="CA" country="US" driving_side="R" postal_code="94109" edge_id="23609030"percent="0.0"/>
</start_location>
<segment sequence="1" instruction="Start out on Larkin St (Going South)" distance="0.00" time="0.00"/>
<segment sequence="2" instruction="Turn RIGHT onto North Point St (Going West)" distance="0.19" time="0.66"/>
<segment sequence="3" instruction="Turn LEFT onto Van Ness Ave (Going South)" distance="1.88" time="4.58"/>
<segment sequence="4" instruction="Turn LEFT onto Grove St (Going East)" distance="0.10" time="0.56"/>
<segment sequence="5" instruction="Turn RIGHT onto Polk St (Going South)" distance="0.15" time="0.35"/>
<segment sequence="6" instruction="Stay STRAIGHT to go onto 10th St (Going Southeast)" distance="0.60" time="1.47"/>
<segment sequence="7" instruction="Take RAMP toward San Jose" distance="0.28" time="0.34"/>
<segment sequence="8" instruction="Stay STRAIGHT to go onto US-101 S (Going Southeast)" distance="1.14" time="1.39"/>
<segment sequence="9" instruction="Take EXIT 432 toward C Chavez St" distance="0.30" time="0.37"/>
<segment sequence="10" instruction="Stay STRAIGHT to go onto Bayshore Blvd (Going Southeast)" distance="0.21" time="0.45"/>
<segment sequence="11" instruction="Turn SLIGHT LEFT onto RAMP (Going East)" distance="0.03" time="0.05"/>
<segment sequence="12" instruction="Turn LEFT onto Bayshore Blvd (Going North)" distance="0.10" time="0.17"/>
<segment sequence="13" instruction="Turn RIGHT onto Jerrold Ave (Going Southeast)" distance="0.09" time="0.33"/>
<segment sequence="14" instruction="Turn SLIGHT RIGHT onto Barneveld Ave (Going South)" distance="0.18" time="0.61"/>
<segment sequence="15" instruction="Turn SLIGHT RIGHT onto Loomis St (Going Southwest)" distance="0.14" time="0.53"/>
<segment sequence="16" instruction="Turn RIGHT onto Flower St (Going West)" distance="0.00" time="0.00"/>
<end_location>
<location id="4" longitude="-122.40459" latitude="37.74211" house_number="99" street="FLOWER ST" city="SAN FRANCISCO BAY AREA" state="CA" country="US" driving_side="R" postal_code="94124"edge_id="23604155" percent="0.0"/>
</end_location>
</subroute>
</route>
</route_response>

14.3.2 ルート・リクエストXMLスキーマ定義

次に、ルート・リクエストのXMLスキーマ定義を示します。スキーマ定義の主要な要素と属性については、後続の項で説明しています。

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
     elementFormDefault="qualified">
<xsd:include schemaLocation="geocoder_request.xsd"/>
<xsd:simpleType name="positiveDecimal">
  <xsd:restriction base="xsd:decimal">
    <xsd:minExclusive value="0"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="distanceUnit">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="mile"/>
    <xsd:enumeration value="km"/>
    <xsd:enumeration value="kilometer"/>
    <xsd:enumeration value="meter"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="timeUnit">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="minute"/>
    <xsd:enumeration value="hour"/>
    <xsd:enumeration value="second"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="unitType">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="us"/>
    <xsd:enumeration value="metric"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="edgePercentage">
  <xsd:restriction base="xsd:decimal">
    <xsd:minInclusive value="0.0"/>
    <xsd:maxInclusive value="1.0"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="roadPreference">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="highway"/>
    <xsd:enumeration value="local"/>
  </xsd:restriction>
</xsd:simpleType>               
 
<xsd:simpleType name="routePreference">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="shortest"/>
    <xsd:enumeration value="fastest"/>
    <xsd:enumeration value=”traffic”/>
  </xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="truckType">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="delivery"/>
    <xsd:enumeration value="public"/>
    <xsd:enumeration value="resident"/>
    <xsd:enumeration value="trailer"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="vehicleType">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="auto"/>
    <xsd:enumeration value="truck"/>
  </xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="pregeocodedType">
  <xsd:all>
    <xsd:element name="edge_id" type="xsd:long" />
    <xsd:element name="percent" type="edgePercentage"/>
    <xsd:element name="side">
      <xsd:simpleType>
        <xsd:restriction base="xsd:string">
          <xsd:enumeration value="L"/>
          <xsd:enumeration value="R"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:element>
  </xsd:all>
</xsd:complexType>
 
<xsd:complexType name="routerInputLocation">
  <xsd:choice>
    <xsd:element name="router_input_location"  type="input_locationType"/>
    <xsd:element name="router_pregeocoded_location" type="pregeocodedType"/>
  </xsd:choice>
</xsd:complexType>
<xsd:element name="batch_route_request" type="batchRouteRequest" />
<xsd:complexType name="batchRouteRequest">
  <xsd:sequence>
    <xsd:element name="route_request" type="routeRequest" 
                 minOccurs="1" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="id" type="xsd:nonNegativeInteger" use="required"/>
</xsd:complexType>
                
<xsd:element name="route_request" type="routeRequest" />
<xsd:complexType name="routeRequest">
  <xsd:sequence>
    <xsd:element name="start_location" type="routerInputLocation"
                 minOccurs="0" maxOccurs="1"/>
    <xsd:element name="location" type="routerInputLocation" 
                 minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="end_location" type="routerInputLocation"
                 minOccurs="0" maxOccurs="1"/>
  </xsd:sequence>
  <xsd:attribute name="id" type="xsd:nonNegativeInteger" use="required"/>
  <xsd:attribute name="pre_geocoded_locations" type="xsd:boolean" 
                 use="optional"/> 
  <xsd:attribute name="route_preference" type="routePreference" 
                 use="optional"/>
  <xsd:attribute name="road_preference" type="roadPreference"
                 use="optional"/>
  <xsd:attribute name="start_date" type="xsd:date"
                 use="optional"/>
  <xsd:attribute name="start_time" type="xsd:time"
                 use="optional"/>
  <xsd:attribute name="date_format" type="xsd:date"
                 use="optional"/>
  <xsd:attribute name="time_format" type="xsd:time"
                 use="optional"/>
  <xsd:attribute name="output_time_format" type="xsd:date"
                 use="optional"/>

  <xsd:attribute name="optimize_route" type="xsd:boolean" use="optional"/>
  <xsd:attribute name="route_type" use="optional">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="open"/>
        <xsd:enumeration value="closed"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="driving_directions_detail" use="optional">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="medium"/>
        <xsd:enumeration value="high"/>
        <xsd:enumeration value="low"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="language" use="optional">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="English"/>
        <xsd:enumeration value="French"/>
        <xsd:enumeration value="German"/>
        <xsd:enumeration value="Italian"/>
        <xsd:enumeration value=”Portuguese”/>
        <xsd:enumeration value="Spanish"/>
              </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="distance_unit" type="distanceUnit" use="optional"/>
  <xsd:attribute name="length_unit" type="unitType" use="optional"/>
  <xsd:attribute name="time_unit" type="timeUnit" use="optional"/>
  <xsd:attribute name="weight_unit" type="unitType" use="optional"/>
  <xsd:attribute name="return_locations" type="xsd:boolean"
                 use="optional"/>
  <xsd:attribute name="return_subroutes" type="xsd:boolean"
                 use="optional"/>
  <xsd:attribute name="return_route_time" type="xsd:boolean" 
                 use="optional"/>
  <xsd:attribute name="return_subroute_time" type="xsd:boolean" 
                 use="optional"/>

  <xsd:attribute name="return_driving_directions" type="xsd:boolean" 
                 use="optional"/>
  <xsd:attribute name="return_hierarchical_directions" type="xsd:boolean" 
                 use="optional"/>
  <xsd:attribute name="return_route_geometry" type="xsd:boolean" 
                 use="optional"/>
  <xsd:attribute name="return_subroute_geometry" type="xsd:boolean" 
                 use="optional"/>
  <xsd:attribute name="return_segment_geometry" type="xsd:boolean" 
                 use="optional"/>
  <xsd:attribute name="return_detailed_geometry" type="xsd:boolean" 
                 use="optional"/>
  <xsd:attribute name="return_route_edge_ids" type="xsd:boolean" 
                 use="optional"/>
  <xsd:attribute name="return_subroute_edge_ids" type="xsd:boolean" 
                 use="optional"/>
  <xsd:attribute name="return_segment_edge_ids" type="xsd:boolean" 
                 use="optional"/>
  <xsd:attribute name="vehicle_type" type="vehicleType" use="optional"/>
  <xsd:attribute name="truck_type" type="truckType" use="optional"/>
  <xsd:attribute name="truck_height" type="positiveDecimal"
                 use="optional"/>
  <xsd:attribute name="truck_length" type="positiveDecimal"
                 use="optional"/>
  <xsd:attribute name="truck_per_axle_weight" type="positiveDecimal" 
                 use="optional"/>
  <xsd:attribute name="truck_weight" type="positiveDecimal"
                 use="optional"/>
  <xsd:attribute name="truck_width" type="positiveDecimal" use="optional"/>
</xsd:complexType>
14.3.2.1 route_request要素

<route_request>要素は、次のとおり定義されています。

<xsd:element name="route_request" type="routeRequest" />

ルート・リクエストのルート要素には、常にroute_requestという名前が付けられます。

子要素の<start_location>は、住所指定、ジオコード済住所または経度/緯度座標として、ルートの出発地を示します。ルート・リクエストに応じて、0または1個の<start_location>要素があります。単純ルート・リクエストには<start_location>要素が必要ですが、開いた行程のTSPリクエストには不要です。

子要素の<location>は、住所指定、ジオコード済住所または経度/緯度座標として、セグメントの場所を示します。単純ルート・リクエストでは、<location>要素が存在しません。1つ以上の<location>要素が存在する場合はマルチアドレス・ルートです。

子要素の<end_location>は、住所指定、ジオコード済住所または経度/緯度座標として、ルートの目的地を示します。ルート・リクエストに応じて、0または1個の<end_location>要素があります。単純ルート・リクエストには<end_location>要素が必要ですが、閉じた行程のマルチアドレスまたはTSP行程には<end_location>要素が含まれていてはなりません。

ルート・リクエストでは、次のように指定します。

  • <start_location>が住所指定または経度/緯度座標である場合、各<end_location>および<location>要素には住所指定または経度/緯度座標のいずれかを使用できますが、事前ジオコード済住所は使用できません。

  • <start_location>が事前ジオコード済住所である場合、<end_location>および任意の<location>指定にも事前ジオコード済住所を使用する必要があります。

一括ルート・リクエストでは、個々のルート・リクエストはそれぞれ前述のルールに従う必要があります。ただし、バッチ内では、個々のリクエストは独立しているため、個々のリクエスト内で一貫しているかぎり、住所、事前ジオコード済および経度/緯度の場所を組み合せることができます。

14.3.2.2 route_request属性

ルート要素の<route_request>には、複数の属性があります(そのほとんどはオプションです)。これらの属性は次のように定義されます。

vendorはオプションの属性です。デフォルト値の場合は、Oracleがルーティング・プロバイダになります。

idは必須属性で、リクエストに関連付けるID番号を指定します。

route_preferenceはオプションの属性で、予想運転時間が最短のルート(FASTEST)、過去のトラフィック・パターンを計算の考慮に入れたルート(TRAFFIC)、または運転距離が最短のルート(SHORTEST、デフォルト)のいずれを希望するのかを示します。

road_preferenceはオプションの属性で、高速道路を優先するルーティング・プロセス(HIGHWAY、デフォルト)と、地方道路(LOCAL)を優先するルーティング・プロセスを可能にします。

return_driving_directionsはオプションの属性で、ルートの運転方向を戻すかどうかを指定します。TRUEを指定すると運転方向が戻され、FALSE (デフォルト)を指定すると運転方向は戻されません。

return_hierarchical_driving_directionsはオプションの属性で、開いたり閉じたりすることができる階層でルートの運転方向を戻すかどうかを指定します。TRUEを指定すると運転方向が開いたり閉じたりすることができる階層で戻され、FALSE (デフォルト)を指定すると運転方向が階層なしのリストで戻されます。

return_route_timeは、時間をルート・レベルで戻すかどうかを指定するオプションの属性です。このパラメータをTRUEに設定すると、タイム・ゾーン・ユーザー・データが使用可能な場合、ルーティング・エンジンは出発時間と到着時間をルート・レスポンスに追加します。

return_subroute_timeは、時間をサブルート・レベルで戻すかどうかを指定するオプションの属性です。このパラメータをTRUEに設定すると、ルーティング・エンジンはマルチルートまたはTSP(巡回セールスマン)リクエストの各サブルートに出発時間と到着時間を追加します。

return_locationsはオプションの属性で、ルート内のすべての場所のジオコード情報を戻すかどうかを指定します。TRUEはジオコード情報を戻し、FALSE (デフォルト)は戻しません。

return_subroutesはオプションの属性で、マルチアドレス・ルートのサブルートを戻すかどうかを指定します。TRUE (マルチアドレス・ルートの場合はデフォルト)を指定するとサブルートが戻され、FALSEを指定するとサブルートは戻されません。(単純ルートの場合、この属性は無視されます。)

return_route_geometryはオプションの属性で、ルートを表す線ストリングの座標を戻すかどうかを示します。TRUEを指定すると座標が戻され、FALSE (デフォルト)を指定すると座標は戻されません。

return_subroute_geometryはオプションの属性で、ルート内のサブルートを表す線ストリングの座標を戻すかどうかを示します。TRUEを指定すると座標が戻され、FALSE (マルチアドレス・ルートの場合はデフォルト)を指定すると座標は戻されません。(単純ルートの場合、この属性は無視されます。)

return_segment_geometryはオプションの属性で、ルートのマヌーバを表す線ストリングの座標を戻すかどうかを示します。TRUEを指定すると座標が戻され、FALSE (デフォルト)を指定すると座標は戻されません。return_segment_geometryTRUEの場合、return_driving_directions属性の値に関係なく、ルートの運転方向が戻されます。

return_detailed_geometryはオプションの属性で、戻されるジオメトリに含まれる詳細のレベルを示します。TRUE (デフォルト)は詳細なジオメトリを戻し、FALSEは総合的な(通常は座標の少ない)ジオメトリを戻します。

return_route_edge_idsはオプションの属性で、ルートのエッジのエッジID値を戻すかどうかを指定します。TRUEを指定するとエッジID値が戻され、FALSE (デフォルト)を指定するとエッジID値は戻されません。

return_subroute_edge_idsはオプションの属性で、サブルートのエッジのエッジID値を戻すかどうかを指定します。TRUEを指定するとエッジID値が戻され、FALSE (マルチアドレス・ルートの場合はデフォルト)を指定するとエッジID値は戻されません。(単純ルートの場合、この属性は無視されます。)

return_segment_edge_idsはオプションの属性で、ルートのすべてのマヌーバのエッジについてエッジID値を戻すかどうかを指定します。TRUEを指定するとエッジID値が戻され、FALSE (デフォルト)を指定するとエッジID値は戻されません。return_segment_edge_idsTRUEの場合、return_driving_directions属性の値に関係なく、ルートの運転方向が戻されます。

languageはオプションの属性で、運転方向の生成に使用するデフォルトの言語を上書きします。デフォルトの言語はweb.xmlファイルで設定されており、この属性を使用してリクエストごとにデフォルトを上書きできます。サポートされている属性値は、ENGLISHFRENCHGERMANITALIANPORTUGUESEおよびSPANISHです。

distance_unitはオプションの属性で、戻される距離の値の測定単位を指定します。有効な値は、KILOMETERまたはKM(キロメートル)、MILE(マイル、デフォルト)およびMETER(メートル)です。

length_unitはオプションの属性で、長さ値の入力に使用する長さ測定法を指定します。有効な値は、US (フィート、デフォルト)またはMETRIC (メートル)です。この属性は、トラックの高さ、長さ、幅の指定に使用されます。

time_unitはオプションの属性で、戻される時間値の単位を示します。有効な値は、HOUR (時間)、MINUTE (分、デフォルト)およびSECOND (秒)です。

weight_unitはオプションの属性で、重量値の入力に使用する重量測定法を指定します。有効な値は、US (トン、デフォルト)またはMETRIC (メートル・トン)です。この属性は、トラックの重量の指定に使用されます。

pre_geocoded_locationsはオプションの属性で、場所の指定方法を示します。TRUEは、両方の場所が、<pre_geocoded_location>要素を使用してジオコード済の場所として指定されることを示します。FALSE (デフォルト)は、両方の場所が、<input_location>要素を使用して住所または経度/緯度のペアとして指定されることを示します。

driving_directions_detailはオプションの属性で、運転の案内における詳細レベルと個別のステップの数に影響を与えます。指定可能な値は、HIGH (最も詳細でステップ数が最も多い)、MEDIUM (デフォルト)およびLOW (最も大まかでステップ数が最も少ない)です。たとえば、LOWを指定すると、セグメントに右または左へのわずかなマヌーバが含まれている場合でも、1つのセグメントが1つのステップとして処理される場合があります。戻される運転方向の長さに対してこの属性の値が与える影響は、要素の正確な名前とマヌーバによって異なります。return_driving_directionsまたはreturn_hierarchical_driving_directionsに対してTRUEを指定しない場合、この属性は無視されます。

optimize_routeはオプションの属性で、マルチアドレス・ルート・リクエストがその非固定の場所を並べ替えて全体的なルートを最適化する必要があるかどうかを指定します。TRUEは場所を並べ替えて全体的なルートを最適化し(巡回セールスマン)、FALSE (デフォルト)は場所を並べ替えません(マルチアドレス)。マルチアドレス・リクエストは最適化されないため、すべての場所はリクエストで指定された順序で戻されます。マルチアドレスおよびTSPの開いた行程リクエストでは、START_LOCATIONおよびEND_LOCATIONはオプションです。これらが指定されている場合、これらは固定の場所であり、TSPリクエストで並替えの対象にはなりません。マルチアドレスおよびTSPリクエストでは、1つ以上の中間地(LOCATION)を指定する必要があり、これらは非固定の場所で、TSPリクエストで並替えの対象になります。

route_typeはオプションの属性で、マルチアドレス・ルートがOPEN (デフォルト)行程とCLOSED行程のどちらであるかを指定します。開いた行程は、START_LOCATIONまたは最初のLOCATIONからEND_LOCATIONまたは最後のLOCATIONまでのルートです。閉じた行程では、START_LOCATIONが必須で、出発地および目的地の両方として使用されます。閉じた行程に対してEND_LOCATIONが指定されている場合は、例外が発生します。

start_dateは、ルート・リクエストの出発日を指定するオプションの属性です。トラフィック・パターンがルートの計算に含まれる場合、リンク・コストは時間によって異なります。この属性を使用すると、リンクを通過する時間のリンク・コストがわかります。

start_timeは、ルート・リクエストの出発時間を指定するオプションの属性で、ルーターがトラフィック・パターンを計算に含める場合に適用されます。リンクを通過する時間の移動時間のフェッチに過去のトラフィック・パターン・データが使用されます。

output_time_formatは、出力ルートの到着時間を表示する書式を指定するオプションの属性です。この書式は、JavaのSimpleDateFormatでサポートされるものである必要があります。

vehicle_typeはオプションの属性で、車両のタイプがAUTO (デフォルト)とTRUCKのどちらであるかを指定します。トラックの場合は説明サブ属性が使用され、車両タイプはTRUCKに設定されている必要があります。車両タイプがAUTOの場合、これらのサブ属性は無視されます。

truck_typeはオプションの属性で、TRUCKに設定されたvehicle_typeのサブ属性です。この属性は、具体的なトラック・タイプを説明し、より一般的なトラック・ルールをオーバーライドできます。サポートされている属性値は、DELIVERYPUBLICRESIDENTおよびTRAILERです。DELIVERYPUBLICおよびRESIDENTトラック・タイプは、これらのタイプのトラックのトラック・ルールに例外を提供します。ごみ収集トラックおよび公共事業トラックはPUBLICトラックの例です。RESIDENTトラック・タイプは、地元のトラックを説明します。TRAILERトラック・タイプは、セミトレーラー・トラックが対象となり、他のトラックは対象とならない追加の制限を説明します。

truck_heightはオプションの属性で、TRUCKに設定されたvehicle_typeのサブ属性です。この属性では、length_unitsでのトラックの高さを浮動小数点数として指定します。この高さは、ルートの一部とみなされているエッジ上に存在する可能性のある高さ制限に対してチェックするために使用されます。

truck_lengthはオプションの属性で、TRUCKに設定されたvehicle_typeのサブ属性です。この属性では、length_unitsでのトラックの長さを浮動小数点数として指定します。この長さは、ルートの一部とみなされているエッジ上に存在する可能性のある長さ制限に対してチェックするために使用されます。

truck_per_axle_weightはオプションの属性で、TRUCKに設定されたvehicle_typeのサブ属性です。この属性では、weight_unitsでのトラックの車軸単位の重量を浮動小数点数として指定します。この重量は、ルートの一部とみなされているエッジ上に存在する可能性のある車軸当たりの重量制限に対してチェックするために使用されます。

truck_weightはオプションの属性で、TRUCKに設定されたvehicle_typeのサブ属性です。この属性では、weight_unitsでのトラックの重量を浮動小数点数として指定します。この重量は、ルートの一部とみなされているエッジ上に存在する可能性のある重量制限に対してチェックするために使用されます。

truck_widthはオプションの属性で、TRUCKに設定されたvehicle_typeのサブ属性です。この属性では、length_unitsでのトラックの幅を浮動小数点数として指定します。この幅は、ルートの一部とみなされているエッジ上に存在する可能性のある幅制限に対してチェックするために使用されます。

14.3.2.3 input_location要素

<input_location>要素は、Oracle Spatial and Graphのジオコーディング・リクエストXMLスキーマ(「ジオコーディング・リクエストのXMLスキーマ定義および例」を参照)に適した形式で、住所を指定します。経度/緯度のペアまたは<input_address>要素を使用して入力の場所を指定できます。「ルート・リクエストおよびルート・レスポンスの例」例14-1では、<input_location>要素とその子要素の<input_address>を使用して出発地と目的地の住所が指定されています。

<input_location>要素を使用する場合は、<route_request>要素のpre_geocoded_locations属性の値をFALSE (デフォルト)に設定する必要があります。経度/緯度のペアおよび<input_address>要素をリクエストで一緒に使用できます。

14.3.2.4 pre_geocoded_location要素

<pre_geocoded_location>要素は、その住所が通り(エッジ)に沿ってどれくらい離れているのか、また、通りのどちら側にあるのかを示す、ジオコード済の場所を指定します。「ルート・リクエストおよびルート・レスポンスの例」例14-5では、<pre_geocoded_location>要素を使用して出発地と目的地の住所が指定されています。

<pre_geocoded_location>要素を使用する場合は、<route_request>要素でpre_geocoded_locations="TRUE"を指定し、すべての場所を<pre_geocoded_location>要素で指定する必要があります。

14.3.3 ルート・レスポンスXMLスキーマ定義

次に、ルート・レスポンスのXMLスキーマ定義を示します。

<!-- XML Schema definition for Route Response from the routing engine -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:gml="http://www.opengis.net/gml" 
     elementFormDefault="qualified">

<xsd:simpleType name="nonNegativeDecimal">
  <xsd:restriction base="xsd:decimal">
    <xsd:minInclusive value="0"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="positiveDecimal">
  <xsd:restriction base="xsd:decimal">
    <xsd:minExclusive value="0"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="distanceUnit">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="mile"/>
    <xsd:enumeration value="km"/>
    <xsd:enumeration value="kilometer"/>
    <xsd:enumeration value="meter"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="timeUnit">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="minute"/>
    <xsd:enumeration value="hour"/>
    <xsd:enumeration value="second"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="edgeIdElement">
  <xsd:restriction base="xsd:string">
    <xsd:pattern value="[-0-9,]+"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="edgeIdList">
  <xsd:list itemType="edgeIdElement"/>
</xsd:simpleType>
 
<xsd:simpleType name="emptyString">
  <xsd:restriction base="string">
    <xsd:maxLength value="0"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="latitude">
  <xsd:restriction base="decimal">
    <xsd:minInclusive value="-90.0" />
    <xsd:maxInclusive value="90.0" />
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="longitude">
  <xsd:restriction base="decimal">
    <xsd:minInclusive value="-180.0"/>
    <xsd:maxInclusive value="180.0"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:complexType name="geometry">
  <xsd:sequence>
    <xsd:element ref="gml:LineString"/>
  </xsd:sequence>
</xsd:complexType>
 
<xsd:complexType name="outputLocation">
  <xsd:attribute name="id" type="xsd:positiveInteger" use="required"/>
  <xsd:attribute name="longitude" use="required">
    <xsd:simpleType>
      <xsd:union memberTypes="longitude emptyString" />
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="latitude" use="required">
    <xsd:simpleType>
      <xsd:union memberTypes="latitude emptyString" />
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="house_number" type="xsd:string" use="required"/>
  <xsd:attribute name="street" type="xsd:string" use="required"/>
  <xsd:attribute name="city" type="xsd:string" use="required"/>
  <xsd:attribute name="state" type="xsd:string" use="required"/>
  <xsd:attribute name="country" type="xsd:string" use="required"/>
  <xsd:attribute name="driving_side" use="required">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="L"/>
        <xsd:enumeration value="N"/>
        <xsd:enumeration value="R"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="postal_code" type="xsd:string" use="required"/>
  <xsd:attribute name="edge_id" type="xsd:long" use="required"/>
  <xsd:attribute name="percent" type="edgePercentage" use="required"/>
</xsd:complexType>
 
<xsd:complexType name="segmentType">
  <xsd:sequence>
    <xsd:element name="segment_geometry" type="geometry" 
                 minOccurs="0" maxOccurs="1"/>
    <xsd:element name="segment_edge_ids" type="edgeIdList" 
                 minOccurs="0" maxOccurs="1"/>
  </xsd:sequence>
  <xsd:attribute name="sequence" type="xsd:positiveInteger" use="required"/>
  <xsd:attribute name="instruction" type="xsd:string" use="required"/>
  <xsd:attribute name="distance" type="nonNegativeDecimal" use="required"/>
  <xsd:attribute name="time" type="nonNegativeDecimal" use="required"/>
</xsd:complexType>
 
 <xsd:element name="route_response">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element name="route" minOccurs="1" maxOccurs="1">
        <xsd:simpleType>
          <xsd:union memberTypes="multiRouteType routeType"/>
        </xsd:simpleType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element> 
 
<xsd:complexType name="multiRouteType">
  <xsd:sequence>
    <xsd:element name="route_geometry" type="geometry" 
                 minOccurs="0" maxOccurs="1"/>
    <xsd:element name="route_edge_ids" type="edgeIdList" 
                 minOccurs="0" maxOccurs="1"/>
    <xsd:element name="start_location" type="outputLocation" 
                 minOccurs="0" maxOccurs="1"/>
    <xsd:element name="end_location" type="outputLocation" 
                 minOccurs="0" maxOccurs="1"/>
    <xsd:element name="subroute" minOccurs="1" maxOccurs="unbounded">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="subroute_geometry" type="geometry"
                       minOccurs="0" maxOccurs="1"/>
          <xsd:element name="subroute_edge_ids" type="edgeIdList" 
                       minOccurs="0" maxOccurs="1"/>
          <xsd:element name="start_location" type="outputLocation" 
                       minOccurs="0" maxOccurs="1"/>
          <xsd:element name="segment" type="segmentType" 
                      minOccurs="0" maxOccurs="unbounded"/>
          <xsd:element name="end_location" type="outputLocation" 
                       minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>       
        <xsd:attribute name="id" type="xsd:nonNegativeInteger"
                       use="required"/>
        <xsd:attribute name="step_count" type="xsd:nonNegativeInteger" 
                       use="required"/>
        <xsd:attribute name="distance" type="nonNegativeDecimal"
                       use="required"/>
        <xsd:attribute name="distance_unit" type="distanceUnit"
                       use="required"/>
        <xsd:attribute name="time" type="nonNegativeDecimal" use="required"/>
        <xsd:attribute name="time_unit" type="timeUnit" use="required"/>
        <xsd:attribute name="start_location" type="xsd:positiveInteger"
                       use="required"/>
        <xsd:attribute name="end_location" type="xsd:positiveInteger"
                       use="required"/> 
      </xsd:complexType>
    </xsd:element>
  </xsd:sequence>
</xsd:complexType>
 
<xsd:complexType name="routeType">
  <xsd:sequence>
    <xsd:element name="route_geometry" type="geometry" 
                 minOccurs="0" maxOccurs="1"/>
    <xsd:element name="route_edge_ids" type="edgeIdList" 
                 minOccurs="0" maxOccurs="1"/>
    <xsd:element name="start_location" type="outputLocation" 
                 minOccurs="0" maxOccurs="1"/>
    <xsd:element name="segment" type="segmentType"
                 minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="end_location" type="outputLocation" 
                 minOccurs="0" maxOccurs="1"/>
  </xsd:sequence>       
  <xsd:attribute name="id" type="xsd:nonNegativeInteger" use="required"/>
  <xsd:attribute name="step_count" type="xsd:nonNegativeInteger" 
                 use="required"/>
  <xsd:attribute name="distance" type="nonNegativeDecimal" use="required"/>
  <xsd:attribute name="distance_unit" type="distanceUnit" use="required"/>
  <xsd:attribute name="time" type="nonNegativeDecimal" use="required"/>
  <xsd:attribute name="time_unit" type="timeUnit" use="required"/>
  <xsd:attribute name="start_location" type="xsd:positiveInteger"
                 use="required"/>
  <xsd:attribute name="end_location" type="xsd:positiveInteger"
                 use="required"/>
</xsd:complexType>
</xsd:schema>

14.3.4 バッチ・モード・ルート・リクエストおよびバッチ・モード・ルート・レスポンスの例

この項では、バッチ・モード・ルート・リクエストと、そのリクエストによって生成されるルート・レスポンスのXMLの例を示します。1つのリクエストでは、指定した住所を使用しています。もう1つのリクエストでは、ジオコード済の場所を使用しています。使用可能な要素および属性のリファレンス情報は、リクエストについては「一括ルート・リクエストXMLスキーマ定義」を、レスポンスについては「一括ルート・レスポンスXMLスキーマ」を参照してください。

例14-17 指定した住所を使用した場合の一括ルート・リクエスト

例14-17では、指定した住所を使用する一括ルート・リクエストを示しています。このリクエストは、Massachusetts州Waltham市にあるオフィスと3つの目的地(New Hampshire州Nashua市のオラクル社のオフィス、Massachusetts州Concord町役場、およびBoston市庁舎)との間の最速ルート(可能な場合は高速道路を使用)を求めます。このリクエストでは、戻されるルートを、出発地と目的地の距離でソートするように要求しています。また、距離が35マイルを超えるルートは戻さないようにしています。

<?xml version="1.0" standalone="yes"?>
<batch_route_request 
          id="8" 
          route_preference="fastest"
          road_preference="highway" 
          return_driving_directions="false"
          sort_by_distance = "true" 
          cutoff_distance="35" 
          distance_unit="mile" 
          time_unit="minute">
  <start_location>
    <input_location id="1">
      <input_address>
        <us_form1 
          street="399 Winter St" 
          lastline="Waltham, MA" />
      </input_address>
    </input_location>
  </start_location>
  <end_location>
    <input_location id="10">
      <input_address>
        <us_form1 
          street="1 Oracle Dr" 
          lastline="Nashua, NH" />
      </input_address>
    </input_location>
  </end_location>
  <end_location>
    <input_location id="11">
      <input_address>
        <us_form1 
          street="2 Monument Sq" 
          lastline="Concord, MA" />
      </input_address>
    </input_location>
  </end_location>
  <end_location>
    <input_location id="12">
      <input_address>
        <us_form1 
          street="1 City Hall Plaza" 
          lastline="Boston, MA" />
      </input_address>
    </input_location>
  </end_location>
</batch_route_request>

例14-18 指定した住所を使用した場合の一括ルート・レスポンス

例14-18に、例14-17のリクエストによって生成されたレスポンスを示します。(出力は、読みやすくするために変更が加えられています。)sort_by_distance = "true"がリクエストで指定されたため、戻されるルートはルートIDの順序(11、12、10)ではなく、ルート距離の順序になります。

<!-- Oracle Routeserver version 12.1.0.2.0 (data version 11.1.0.7.1) -->
<batch_route_response id="8">
  <route id="11" step_count="0"
         distance="7.796855460254458" distance_unit="mile" 
         time="11.343014526367188" time_unit="minute"/>
  <route id="12" step_count="0"
         distance="17.201688768020258" distance_unit="mile" 
         time="21.577909342447917" time_unit="minute"/>
  <route id="10" step_count="0"
          distance="28.628700657894736" distance_unit="mile" 
          time="31.133371988932293" time_unit="minute"/>
</batch_route_response>

例14-19 ジオコード済の場所を使用した場合の一括ルート・リクエスト

例14-19は、ジオコード済の場所を使用する一括ルート・リクエストを示しています。このリクエストは、可能であれば高速道路を使用し、ある場所と他の3つの場所の間の最速ルートを求めます。距離にはマイル、時間には分を使用しています。このリクエストでは、戻されるルートを、出発地と目的地の距離でソートするように要求しています。また、距離が28.5マイルを超えるルートは戻さないようにしています。

<?xml version="1.0" standalone="yes"?>
<batch_route_request id="8" 
                     route_preference="fastest"
                     road_preference="highway" 
                     return_driving_directions="false"
                     distance_unit="mile" 
                     time_unit="minute"
                     pre_geocoded_locations="true"
                     cutoff_distance="28.5"
                     sort_by_distance="true">
    <start_location>
        <pre_geocoded_location id="1">
            <edge_id>906810462</edge_id>
            <percent>0.0</percent>
            <side>R</side>
        </pre_geocoded_location>
    </start_location>
    <end_location>
        <pre_geocoded_location id="11">
            <edge_id>22325991</edge_id>
            <percent>0.0</percent>
            <side>R</side>
        </pre_geocoded_location>
    </end_location>
    <end_location>
        <pre_geocoded_location id="12">
            <edge_id>22027853</edge_id>
            <percent>0.0</percent>
            <side>R</side>
        </pre_geocoded_location>
    </end_location>
    <end_location>
        <pre_geocoded_location id="13">
            <edge_id>31102851</edge_id>
            <percent>0.0</percent>
            <side>R</side>
        </pre_geocoded_location>
    </end_location>
</batch_route_request>

例14-20 ジオコード済の場所を使用した場合の一括ルート・レスポンス

例14-20に、例14-19のリクエストに対するレスポンスを示します。3番目のルートは、指定したカットオフ距離の28.5マイルよりも長いため、2つのルートのみが戻されます。(出力は、読みやすくするために変更が加えられています。)

<!-- Oracle Routeserver version 12.1.0.2.0 (data version 11.1.0.7.1) -->
<batch_route_response id="8">
  <route id="11" step_count="0"
          distance="7.796855460254458" distance_unit="mile" 
          time="11.343014526367188" time_unit="minute"/>
  <route id="12" step_count="0"
         distance="17.201688768020258" distance_unit="mile" 
         time="21.577909342447917" time_unit="minute"/>
</batch_route_response>

14.3.5 一括ルート・リクエストXMLスキーマ定義

次に、一括ルート・リクエストのXMLスキーマ定義を示します。XMLスキーマ定義の主要な要素と属性については、後続の項で説明しています。

<?xml version="1.0" encoding="UTF-8"?>
<!-- XML Schema definition for a Batch Route Request to the routing engine ->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified">
<xsd:include schemaLocation "geocoder_request.xsd" />
 
<xsd:simpleType name="positiveDecimal">
  <xsd:restriction base="xsd:decimal">
    <xsd:minExclusive value="0"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="distanceUnit">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="mile"/>
    <xsd:enumeration value="km"/>
    <xsd:enumeration value="kilometer"/>
    <xsd:enumeration value="meter"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="timeUnit">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="minute"/>
    <xsd:enumeration value="hour"/>
    <xsd:enumeration value="second"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="unitType">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="us"/>
    <xsd:enumeration value="metric"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="roadPreference">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="highway"/>
    <xsd:enumeration value="local"/>
  </xsd:restriction>
</xsd:simpleType>               
 
<xsd:simpleType name="routePreference">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="shortest"/>
    <xsd:enumeration value="fastest"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="truckType">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="delivery"/>
    <xsd:enumeration value="public"/>
    <xsd:enumeration value="resident"/>
    <xsd:enumeration value="trailer"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="vehicleType">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="auto"/>
    <xsd:enumeration value="truck"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:complexType name="routerInputLocation">
  <xsd:choice>
    <xsd:element name="router_input_location"  type="input_locationType"/>
    <xsd:element name="router_pregeocoded_location" type="pregeocodedType"/>
  </xsd:choice>
</xsd:complexType>
 
<xsd:element name="batch_route_request" type="batch_route_requestType" />
             
<xsd:complexType name="batch_route_requestType">
  <xsd:sequence>
    <xsd:element name="start_location" type="routerInputLocation"
                 minOccurs="1" maxOccurs="1"/>
    <xsd:element name="end_location" type="routerInputLocation"
                 minOccurs="1" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="id" type="xsd:nonNegativeInteger" use="required"/>
  <xsd:attribute name="pre_geocoded_locations" type="xsd:boolean"
                 use="optional"/>
  <xsd:attribute name="route_preference" type="routePreference" 
                 use="optional"/>
  <xsd:attribute name="road_preference" type="roadPreference"
                 use="optional"/>
  <xsd:attribute name="distance_unit" type="distanceUnit" use="optional"/>
  <xsd:attribute name="length_unit" type="unitType" use="optional"/>
  <xsd:attribute name="time_unit" type="timeUnit" use="optional"/>
  <xsd:attribute name="weight_unit" type="unitType" use="optional"/>
  <xsd:attribute name="vehicle_type" type="vehicleType" use="optional">
  <xsd:attribute name="truck_type" type="truckType" use="optional"/>
  <xsd:attribute name="truck_height" type="positiveDecimal" use="optional"/>
  <xsd:attribute name="truck_length" type="positiveDecimal" use="optional"/>
  <xsd:attribute name="truck_per_axle_weight" type="positiveDecimal"
                 use="optional"/>
  <xsd:attribute name="truck_weight" type="positiveDecimal" use="optional"/>
  <xsd:attribute name="truck_width" type="positiveDecimal" use="optional"/>
  <xsd:attribute name="cutoff_distance" type="positiveDecimal"
                 use="optional"/>
  <xsd:attribute name="sort_by_distance" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:schema>
14.3.5.1 batch_route_request要素

バッチ・モード・ルート・リクエストのルート要素には、常にbatch_route_requestという名前が付けられます。

子要素の<start_location>は、住所指定、事前ジオコード済住所または経度/緯度の点として、ルートの出発地を指定します。

1つ以上ある子要素の<end_location>は、それぞれが、住所指定、ジオコード済住所または経度/緯度の点として、ルートの目的地を示します。

<location>子要素は、バッチ・モード・ルート・リクエストでは使用されません。

14.3.5.2 batch_route_request属性

ルート要素<batch_route_request>には、複数の属性があります(そのほとんどはオプションです)。これらの属性をこの項で定義します。

<batch_route_request>要素は、いくつかの属性を<route_request>要素と共有します。これらの属性は、<route_request>の属性と同じ意味を持ちます(「batch_route_request属性」を参照)。また、sort_by_distance属性およびcutoff_distance属性は、単一ルートのリクエストには適用されません。

sort_by_distanceはオプションの属性で、戻されるルートを、出発地から目的地までの距離で昇順にソートするかどうかを示します。TRUEを指定すると距離でソートされたルートが戻され、FALSE (デフォルト)を指定するとソートは行われません。

cutoff_distanceはオプションの属性で、この属性を指定すると、出発地から目的地までの距離が、指定した距離以下のルートのみが戻されます。デフォルトでは、すべてのルートが戻されます。

ノート:

バッチ内のいずれかのルートがレスポンスに<router_error>要素(「一括ルート・レスポンスXMLスキーマ」を参照)を生成する場合、そのルートはレスポンスから除外され表示されません。

14.3.6 一括ルート・レスポンスXMLスキーマ

次に、一括ルート・レスポンスのXMLスキーマ定義を示します。

<?xml version="1.0" encoding="UTF-8"?>
<!-- XML Schema definition for a Batch Mode Route Request -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     elementFormDefault="qualified">
 
<xsd:simpleType name="nonNegativeDecimal">
  <xsd:restriction base="xsd:decimal">
    <xsd:minInclusive value="0"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="distanceUnit">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="mile"/>
    <xsd:enumeration value="km"/>
    <xsd:enumeration value="kilometer"/>
    <xsd:enumeration value="meter"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:simpleType name="timeUnit">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="minute"/>
    <xsd:enumeration value="hour"/>
    <xsd:enumeration value="second"/>
  </xsd:restriction>
</xsd:simpleType>
 
<xsd:element name="batch_route_response">
  <xsd:complexType>               
    <xsd:sequence>
      <xsd:element name="route" maxOccurs="unbounded">
        <xsd:complexType>
          <xsd:attribute name="id" type="xsd:nonNegativeInteger" 
                         use="required"/>
          <xsd:attribute name="step_count" type="xsd:nonNegativeInteger" 
                         fixed="0" use="required"/>
          <xsd:attribute name="distance" type="nonNegativeDecimal" 
                         use="required"/>
          <xsd:attribute name="distance_unit" type="distanceUnit" 
                         use="required"/>
          <xsd:attribute name="time" type="nonNegativeDecimal"             
                         use="required">
          <xsd:attribute name="time_unit" type="timeUnit" use="required"/>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:nonNegativeInteger" use="required"/>
  </xsd:complexType>
</xsd:element>
</xsd:schema>

14.4 WSServlet XML APIを使用した場所ベースの問合せ

WSServletは、制限速度および走行速度に関連する軽量な場所ベースの問合せを実行するためのルーティング・エンジン・サーブレットです。

HTTPプロトコルを使用して、XML形式でリクエストを送信します。HTTPリクエスト(GETまたはPOSTメソッド)を使用する場合、そのリクエストには、xml_requestというパラメータがあり、その値は、リクエストのXML文書が含まれる文字列であると想定されます。

サーブレットへのリクエストの書式は、次のとおりです。

http://hostname:port/routeserver/ws/WSServlet?xml_request=xml-request

この書式の詳細は次のとおりです。

  • hostname: ルーティング・エンジンが実行されているサーバーのネットワーク・パスです。

  • port: アプリケーション・サーバーがリスニングするポートです。

  • routeserver/ws/WSServlet: サーブレットのディレクトリです。

  • xml-request: URLエンコードされたXMLリクエストです。HTMLのGETまたはPOSTメソッドを使用して送信されます。

入力XMLは、すべてのリクエストに必須です。出力は、XML文書になります。

WSServletでは次の異なるリクエストを処理します。

  • 制限速度: 場所の最も近いエッジの制限速度を戻します。

  • 走行速度: 場所の最も近いエッジの平均走行速度を戻します。

関連トピックのリクエストおよびレスポンスは、読みやすくするために必要に応じて書式設定されます。

14.4.1 1つ以上の場所の指定

WSServletサーブレットへのリクエストでは、単一または複数の場所を指定できます。単一の場所を指定するリクエストには、<location>要素が1つあります。複数の場所を指定するリクエストには、<location>要素が複数あり、batchリクエストと呼ばれます。

WSServletサーブレットへのリクエストは、locationTypeタイプ(単一または複数の場所を指定するために使用されるXMLスキーマ定義タイプ)およびその他の関連属性を参照します。このタイプは次のように定義します。

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xsd:complexType name="locationType">
		<xsd:attribute name="id" type="xsd:string" use="required"/>
		<xsd:attribute name="longitude" type="xsd:string" use="required"/>
		<xsd:attribute name="latitude" type="xsd:string" use ="required"/> 
		<xsd:attribute name="requestTime" type="xsd:string"/>
		<xsd:attribute name="timeFormat" type="xsd:string" default="dd MMM yyyy HH:mm"/>
	</xsd:complexType>
</xsd:schema>

このタイプの内容は次のとおりです。

  • id: 場所のID (識別子)値が含まれる文字列(必須属性)。

  • longitude: 場所の経度が含まれる文字列(必須属性)。

  • latitude: 場所の緯度が含まれる文字列(必須属性)。

  • requestTime: リクエスト時間が含まれる文字列。デフォルトの時間書式(dd MMM yyyy HH:mm)またはカスタマイズされた書式に従う必要があります。

  • timeFormat: リクエスト時間書式が含まれる文字列。デフォルト値は"dd MMM yyyy HH:mm"ですが、"yyyy/mm/dd HH:mm""mm-dd-yyyy HH:mm"といった時間書式にカスタマイズできます。

14.4.2 WSServletでの制限速度のサポート

このトピックでは、制限速度に関連するリクエストおよびレスポンスの例と、リクエストおよびレスポンスのスキーマ定義を示します。リクエストとそれに対応するレスポンスは、単一または複数の場所に対して作成できます。

14.4.2.1 制限速度リクエストおよび制限速度レスポンスの例

例14-21 制限速度リクエスト(単一の場所)

この例は、場所ID (location id="1291")と経度/緯度ペアを使用して単一の場所を指定している制限速度リクエストを示しています。

<speedLimitRequest requestId="0001">
	<location id="1291" longitude="-93.2857" latitude="45.1705"/>
</speedLimitRequest>

このリクエストからのレスポンスは次のようになります。

<speedLimitResponse requestId="0001" unit="mph">
	<edgeResponse locationId="1291" edgeId="-20190321" speedLimit="24.9"/>
</speedLimitResponse>

リクエストで速度単位を指定しなかったため、サーブレットではデフォルト単位のマイル/時間(mph)が使用されます。この場合、制限速度は実際には40km/時間(kmph)としてポストされますが、サーブレットではレスポンスでmph (24.9)に変換されます。レスポンスでkm/時間を示すようにするには、リクエストにunit="kmph"を含める必要があります。

例14-22 制限速度リクエスト(複数の場所)

この例は、それぞれが独自の場所IDを持ち、経度/緯度ペアによって指定されている3つの場所での制限速度に関するバッチ・リクエストです。リクエストには単位のkm/時間(kmph)を指定します。

<speedLimitRequest requestId="0002" unit="kmph">
	<location id="1291" longitude="-93.2857" latitude="45.1705"/>
	<location id="211" longitude="-93.24049" latitude="46.69592"/>
	<location id="376" longitude="-71.46006" latitude="42.71004"/>
</speedLimitRequest>

このリクエストからのレスポンスは次のようになります。

<speedLimitResponse requestId="0002" unit="kmph">
	<edgeResponse locationId="1291" edgeId="-20190321" speedLimit="40.0"/>
	<edgeResponse locationId="211" edgeId="125949436" speedLimit="95.0"/>
	<edgeResponse locationId="376" edgeId="22325991" speedLimit="20.0"/>
</speedLimitResponse>

レスポンスには、リクエストされた各場所の<edgeResponse>要素が含まれています。つまり、場所ごとに、その場所に関連付けられている点(経度/緯度)での道路または通りについて制限速度を戻します。

14.4.2.2 制限速度リクエストおよび制限速度レスポンスのスキーマ定義

制限速度リクエストのXMLスキーマ定義(XSD)は次のとおりです。

<?xml version="1.0"  ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="speedLimitRequest">
		<xs:complexType>
			<xs:sequence>
				<xs:element maxOccurs="unbounded" name="location" type="locationType"/>
			</xs:sequence>
			<xs:attribute name="requestId" type="xs:string" use="required"/>
			<xs:attribute name="requestType" type="xs:string" fixed="speedLimit"/>
			<xs:attribute name="unit" default="mph">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="mph"/>
						<xs:enumeration value="kmph"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
</xs:schema>

この定義での<speedLimitRequest>の内容は次のとおりです。

  • requestId: リクエストのIDが含まれる文字列(必須属性)。

  • requestType: 固定値"speedLimit"が含まれる文字列(オプション属性)。この属性は、リクエストに指定する必要はなく、JSON解析で後で使用できるようにするためのものです。

  • unit: 速度単位が含まれる文字列(オプション属性)。"mph" (マイル/時間)および"kmph" (km/時間)のみがサポートされます。

  • location要素: 単一の場所または場所のリストを指定できます(「1つ以上の場所の指定」を参照)。

制限速度レスポンスのXMLスキーマ定義(XSD)は次のとおりです。

<?xml version="1.0"  ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="speedLimitResponse">
		<xs:complexType>
			<xs:sequence>
				<xs:element maxOccurs="unbounded" name="edgeResponse">
					<xs:complexType>
						<xs:attribute name="locationId" type="xs:string"/>
						<xs:attribute name="edgeId" type="xs:long"/>
						<xs:attribute name="speedLimit" type="xs:double"/>
						<xs:attribute name="error" type="xs:string"/>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="requestId" use="required"/>
			<xs:attribute name="unit" default="mph">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="mph"/>
						<xs:enumeration value="kmph"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
</xs:schema> 

この定義での<speedLimitResponse>の内容は次のとおりです。

  • requestId: リクエストのIDが含まれる文字列(必須属性)。

  • unit: 速度単位が含まれる文字列(オプション属性)。サポートされているのは、mph (マイル/時間)およびkmph (km/時間)のみです。デフォルトはmphです。

  • edgeResponse: 1つ以上の要素。単一のエッジまたはエッジのリストのいずれかです。次の属性があります。

    • locationId: 場所のIDが含まれる文字列。

    • edgeId: 入力場所の最も近いエッジのIDが含まれる文字列。

    • speedLimit: 制限速度。

  • error: リクエストが正しくない場合に、エラー・メッセージが含まれる文字列。

14.4.3 WSServletでの走行速度のサポート

このトピックでは、走行速度に関連するリクエストおよびレスポンスの例と、リクエストおよびレスポンスのスキーマ定義を示します。リクエストとそれに対応するレスポンスは、単一または複数の場所に対して作成できます。

走行速度のAPIは、制限速度のAPIと似ていますが、主な相違点は入力で時間(requestTime属性)が必須であることです。

14.4.3.1 走行速度リクエストおよび走行速度レスポンスの例

例14-23 走行速度リクエスト(単一の場所)

この例は、場所ID (location id="1291")、経度/緯度ペア、平均走行速度を求める時間(requestTime="08 Feb 2017 15:00")を使用して単一の場所を指定している走行速度リクエストを示しています。指定された時間ではデフォルト書式の"dd MMM yyyy HH:mm"が使用されるため、リクエストで書式を指定する必要はありません。

<trafficSpeedRequest requestId="0005">
  <location id="1291" longitude="-93.2857" latitude="45.1705" requestTime="08 Feb 2017 15:00"/>
</trafficSpeedRequest>

このリクエストからのレスポンスは次のようになります。

<trafficSpeedResponse requestId="0005" unit="mph">
	<edgeResponse locationId="1291" edgeId="-20190321" speedLimit="24.9" 
		requestTime="08 Feb 2017 15:00" trafficSpeed="16.0"/>
</trafficSpeedResponse>

つまり、2017年2月5日15:00 (3 pm)に、そのエッジの平均速度は16.0マイル/時間でした。

例14-24 走行速度リクエスト(複数の場所)

この例は、それぞれが独自の場所IDを持ち、経度/緯度ペアによって指定され、リクエスト時間を指定している3つの場所での走行速度に関するバッチ・リクエストです。

<trafficSpeedRequest requestId="0006" unit="kmph">
	<location id="1291" longitude="-93.2857" latitude="45.1705" requestTime="08 Feb 2017 15:00"/>
	<location id="211" longitude="-93.24049" latitude="46.69592" requestTime="09 Feb 2017 10:00"/>
	<location id="42" longitude="-103.31349" latitude="20.6308" requestTime="10 Feb 2017 09:00"/>
</trafficSpeedRequest>

このリクエストからのレスポンスは次のようになります。

<trafficSpeedResponse requestId="0006" unit="kmph">
	<edgeResponse locationId="1291" edgeId="-20190321" speedLimit="40.0"
		requestTime="08 Feb 2017 15:00" trafficSpeed="26.0"/>
	<edgeResponse locationId="211" edgeId="125949436" speedLimit="95.0" 
		requestTime="09 Feb 2017 10:00" trafficSpeed="79.0"/>
	<edgeResponse locationId="42" edgeId="-1073515692" speedLimit="20.0" 
		requestTime="10 Feb 2017 09:00" trafficSpeed="9.0"/>
</trafficSpeedResponse>

レスポンスには、リクエストされた各場所の<edgeResponse>要素が含まれています。つまり、場所ごとに、その場所に関連付けられている点(経度/緯度)での道路または通りについて指定日時の平均走行速度を戻します。

14.4.3.2 走行速度リクエストおよび走行速度レスポンスのスキーマ定義

走行速度リクエストのXMLスキーマ定義(XSD)は次のとおりです。

<?xml version="1.0"  ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >
	<xs:element name="trafficSpeedRequest">
		<xs:complexType>
			<xs:sequence>
				<xs:element maxOccurs="unbounded" name="location" type="locationType" />
			</xs:sequence>
			<xs:attribute name="requestId" type="xs:string" use="required"/>
			<xs:attribute name="requestType" type="xs:string" fixed="trafficSpeed"/>
			<xs:attribute name="unit" default="mph">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="mph"/>
						<xs:enumeration value="kmph"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
</xs:schema>

この定義での<speedLimitRequest>の内容は次のとおりです。

  • requestId: リクエストのIDが含まれる文字列(必須属性)。

  • requestType: 固定値"trafficSpeed"が含まれる文字列(オプション属性)。この属性は、リクエストに指定する必要はなく、JSON解析で後で使用できるようにするためのものです。

  • unit: 速度単位が含まれる文字列(オプション属性)。"mph" (マイル/時間)および"kmph" (km/時間)のみがサポートされます。

  • location要素: 単一の場所または場所のリストを指定できます(「1つ以上の場所の指定」を参照)。

さらに、場所ごとに、走行速度リクエストには時間(requestTime)を指定する必要があります。時間の書式を指定しないと、デフォルトの"dd MMM yyyy HH:mm"が使用されます。

走行速度レスポンスのXMLスキーマ定義(XSD)は次のとおりです。

<?xml version="1.0"  ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="trafficSpeedResponse">
		<xs:complexType>
			<xs:sequence>
				<xs:element maxOccurs="unbounded" name="edgeResponse">
					<xs:complexType>
						<xs:attribute name="locationId" type="xs:string"/>
						<xs:attribute name="edgeId" type="xs:long"/>
						<xs:attribute name="speedLimit" type="xs:double"/>
						<xs:attribute name="requestTime" type="xs:string"/>
						<xs:attribute name="trafficSpeed" type="xs:double"/>
						<xs:attribute name="error" type="xs:string"/>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="requestId" use="required"/>
			<xs:attribute name="unit" default="mph">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="mph"/>
						<xs:enumeration value="kmph"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
</xs:schema> 

この定義での<trafficSpeedResponseの内容は次のとおりです。

  • requestId: リクエストのIDが含まれる文字列(必須属性)。

  • unit: 速度単位が含まれる文字列(オプション属性)。サポートされているのは、mph (マイル/時間)およびkmph (km/時間)のみです。デフォルトはmphです。

  • edgeResponse: 1つ以上の要素。単一のエッジまたはエッジのリストのいずれかです。次の属性があります。

    • locationId: 場所のIDが含まれる文字列。

    • edgeId: 入力場所の最も近いエッジのIDが含まれる文字列。

    • speedLimit: 制限速度。

    • requestTime: リクエスト時間が含まれる文字列。

    • trafficSpeed: 走行速度。

  • error: リクエストが正しくない場合に、エラー・メッセージが含まれる文字列。

14.4.4 WSServletの例外処理

入力XMLリクエストが正しくないまたは必要な値が欠落している場合、WSServletはXMLレスポンスに1つ以上の例外をスローします。

例外レスポンスのスキーマ定義は次のとおりです。

<?xml version="1.0"  ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="RouteServerException"  type="xs:string"/>
</xs:schema>

例外がスローされると、処理フローは中断されるため、バッチ・リクエストを処理する際の効率が低下します。

WSServletの例外リスト

WSServletサーブレットでは次の例外をスローできます。

WSE-0001: Cannot parse your xml request
WSE-0002: Cannot traverse xml request doc
WSE-0003: WSServlet can only process speedLimitRequest and trafficSpeedRequest
WSE-0004: Database is not connected
WSE-0100: Speed Limit Request Proccessing Exception
WSE-0101: Speed Limit requestId is null
WSE-0102: Speed Limit requestId is empty
WSE-0300: Traffic Speed Request Proccessing Exception
WSE-0301: Traffic Speed requestId is null
WSE-0302: Traffic Speed requestId is empty

WSServletエラー・ケースの例

次に、エラー・ケースの例をいくつか示します。

例14-25 リクエスト解析エラー

<?xml version="1.0" encoding="UTF-8"?>
<RouteServerException>[WSE-0001: Cannot parse your xml request]</RouteServerException>

例14-26 場所IDなし

<speedLimitRequest requestId="1" unit="mph">
	<location id="1291" longitude="-93.2857" latitude="45.1705"/>
	<location longitude="-93.24049" latitude="46.69592"/>
	<location id="376" longitude="-71.46006" latitude="42.71004"/>
</speedLimitRequest>

このバッチ制限速度リクエストでは3つの異なる場所を指定しています。2つ目の場所要素に必須のIDがありませんが、このエラーは、リクエストの他の場所には影響しません。

例14-27 その他の場所入力エラー

<speedLimitResponse requestId="1" unit="mph">
	<edgeResponse locationId="1291" edgeId="-20190321" speedLimit="24.85"/>
	<edgeResponse error="No location id."/>
	<edgeResponse locationId="376" edgeId="22325991" speedLimit="12.43"/>
</speedLimitResponse>

その他のエラーには、無効な場所の入力や、データベース表に結果が存在しない、走行速度リクエストにリクエスト時間が入力されていないなどがあります。

例14-28 エッジなし

<speedLimitResponse requestId="1" unit="mph">
	<edgeResponse locationId="1291" edgeId="-20190321" speedLimit="24.85"/>
	<edgeResponse locationId="211" edgeId="125949436" speedLimit="59.03"/>
	<edgeResponse locationId="376" error="Invalid location input."/>
</speedLimitResponse>

このバッチ制限速度レスポンスでは、3つ目のedgeResponseに「場所の入力が無効です。」というエラーがあります。これは、データベース問合せで表のエッジが微調整されなかった、つまり、場所の入力がそのデータ・セットによってカバーされていないために発生しています。

例14-29 バッチ・レスポンスでの複数のエラー

<trafficSpeedResponse requestId="1" unit="mph">
	<edgeResponse locationId="11" edgeId="-20190321" speedLimit="24.85" 
		requestTime="08 Feb 2017 15:00" trafficSpeed="16.0"/>
	<edgeResponse locationId="92" error="Invalid location input."/>
	<edgeResponse locationId="42" edgeId="-1073515692" speedLimit="12.43" error="No request time."/>
	<edgeResponse locationId="561" edgeId="22325991" speedLimit="12.43" error="No traffic speed data."/>
</trafficSpeedResponse>

このバッチ走行速度レスポンスには、複数のエラーがあります。

  • 2つ目のedgeResponseの場所92では、エラー"Invalid location input"が発生しています。

  • 3つ目のedgeResponseの場所42では、リクエストでrequestTimeが指定されていないため、エラー"No request time"が発生しています。

  • 4つ目のedgeResponseの場所561では、requestTimeが無効であるか、または走行速度データが表に存在しないため、エラー"No traffic speed data"が発生しています。

14.5 ルーティング・エンジンで使用されるデータ構造

古いバージョンのルーティング・エンジン(リリース12.1より前)では、スキーマに次の表が必要です。

  • EDGE

  • NODE

  • PARTITION

  • SIGN_POST

EDGE表およびNODE表には、ルーティング・エンジンで使用する街路ネットワークに関するエッジおよびノードの情報が格納されます。街路ネットワークの通りセグメント、交差点およびその他のエンティティを、エッジおよびノードを使用して表現する方法を理解するには、Oracle Spatial and Graphネットワーク・データ・モデル・グラフ(『Oracle Spatial and Graphトポロジ・データ・モデルおよびネットワーク・データ・モデル・グラフ開発者ガイド』を参照)を熟知している必要があります。

これ以降の項では、ルーティング・エンジンで使用する表について、表名のアルファベット順に説明します。

14.5.1 EDGE表

EDGE表には、街路ネットワークの方向付きエッジごとに1つの行が含まれます。それぞれの通りセグメント(2つのノード間の道路の一部)は、方向のないエッジで、EDGE表内の1つ以上の方向付きエッジに対応します。このEDGE表に含まれる列を、表14-1に示します。

表14-1 EDGE表

列名 データ型 説明

EDGE_ID

NUMBER

エッジID番号です。「ルーティング・エンジンとジオコーダ間の関係」で説明されているように、値は正または負にできます。(主キー。)

START_NODE_ID

NUMBER

このエッジの開始ノードのノードID番号です。

END_NODE_ID

NUMBER

このエッジの終了ノードのノードID番号です。

PARTITION_ID

NUMBER

このエッジが含まれるネットワーク・パーティションのパーティションID番号です。

FUNC_CLASS

NUMBER

1から5の数字で表す道路機能クラスです。1は大規模で交通量が多い高速道路を示し、通常、数字が大きくなるに従って、規模、走行速度および交通量が小さくなります。クラス2の道路は安定した速度が維持され、クラス1の道路へのアクセスに使用されます。クラス3の道路は交通量が多く、クラス2の道路への接続に使用されます。クラス4の道路は、近隣の地区の間の輸送に使用されます(たとえば、交通量が多い市内の主要道など)。クラス5の道路は、その他のすべての道路です(たとえば、郊外の小規模な交通量の少ない通りなど)。

LENGTH

NUMBER

このエッジの長さ(m)です。

SPEED_LIMIT

NUMBER

このエッジに割り当てられた制限速度(m/s)です。

GEOMETRY

SDO_GEOMETRY

このエッジを表す線ストリング・ジオメトリです(座標は、開始ノードから終了ノードの順に並びます)。

NAME

VARCHAR2(128)

このエッジの名前です。

DIVIDER

VARCHAR2(1)

値がNの場合は、エッジが分割されていないことを示します。他の値は、分割されたエッジ上の回転を許容するかどうか、許容する場合はその場所および方法を示します。(現在のルーティング・エンジンでは、エッジが分割されているかどうかのみを考慮しています。)

14.5.2 NODE表

NODE表には、街路ネットワーク内の1つ以上のエッジの開始ノードまたは終了ノードごとに1つの行が含まれます。ノードは、ほとんどの場合、交差点(2つのエッジの交差部分)に対応しますが、交差点と無関係な場合もあります(たとえば、袋小路や行き止まりの通りの終点など)。NODE表に含まれる列を、表14-2に示します。

表14-2 NODE表

列名 データ型 説明

NODE_ID

NUMBER

ノードID番号です。(主キー。)

GEOMETRY

SDO_GEOMETRY

このノードを表す点ジオメトリです。

PARTITION_ID

NUMBER

このノードが含まれるネットワーク・パーティションのパーティションID番号です。

14.5.3 PARTITION表

PARTITION表は、EDGE表とNODE表の内容に基づいて、ルーティング・エンジンによって生成されます。PARTITION表に含まれる列を、表14-3に示します。

表14-3 PARTITION表

列名 データ型 説明

PARTITION_ID

NUMBER

パーティションID番号です。(主キー。)

SUBNETWORK

BLOB

このパーティションに含まれているネットワークの一部です。

NUM_NODES

NUMBER

このパーティションのノード数です。

NUM_NON_BOUNDARY_EDGES

NUMBER

このパーティション内のエッジであり、このパーティションに完全に含まれるエッジの数です。

NUM_OUTGOING_BOUNDARY_EDGES

NUMBER

このパーティション内のエッジであり、開始点がこのパーティションで、終了点が別のパーティションであるエッジの数です。(1つのエッジが2つを超えるパーティションにまたがることはできません。たとえば、あるパーティションを起点とするエッジが、2番目のパーティションを通過して3番目のパーティションで終了することはできません。)

NUM_INCOMING_BOUNDARY_EDGES

NUMBER

このパーティション内のエッジであり、開始点が別のパーティションで、終了点がこのパーティションであるエッジの数です。(1つのエッジが2つを超えるパーティションにまたがることはできません。たとえば、あるパーティションを起点とするエッジが、2番目のパーティションを通過して3番目のパーティションで終了することはできません。)

14.5.4 SIGN_POST表

SIGN_POST表には、運転方向の生成に使用する標識情報が格納されます。たとえば、ある標識は、US Route 3 South上のExit 33AがWinchesterに向かうことを示すことができます。SIGN_POSTの行は、高速道路の出口ランプの物理的な標識に対応させることができますが、必ずしも物理的な標識に対応させる必要はありません。SIGN_POST表に含まれる列を、表14-4に示します。

表14-4 SIGN_POST表

列名 データ型 説明

FROM_EDGE_ID

NUMBER

この標識が適用されるエッジのエッジID番号です(たとえば、出口ランプが含まれる通りセグメント)。(主キー。)

TO_EDGE_ID

NUMBER

この標識が指す先のエッジのエッジID番号です(たとえば、出口ランプの先にある通りセグメント)。

RAMP

VARCHAR2(64)

ランプのテキストです(たとえば、US-3 SOUTH)。

EXIT

VARCHAR2(8)

出口番号です(たとえば、33A)。

TOWARD

VARCHAR2(64)

出口の先にある場所を示すテキストです(たとえば、WINCHESTER)。

LANGUAGE_CODE

CHAR (3 CHAR)

標識に使用される言語を示す3文字の言語コードです。たとえば、英語はENG、フランス語はFRE、スペイン語はSPAです。

14.6 ルーティング・エンジンで使用されるユーザー・データ構造

ルーティング・エンジンでは、ユーザー・データとルーティング・エンジン・データを使用します。右左折制限ユーザー・データなどの一部のユーザー・データは、ルーティング・エンジン・スキーマに存在する必要があります。トラック輸送ユーザー・データなどのその他のユーザー・データはオプションです。

ノート:

リリース12.1からは、リリース12.1以降のデータに対して実行されるルーティング・エンジンは、右左折制限ユーザー・データが存在することを前提とします。ルーティング・エンジンは以前のデータ・バージョンに対しても実行できますが、この操作が行われた場合は、PARTITION表のはるかに制限されたバージョンの右左折制限データが使用されます。

この項では、次のタイプのユーザー・データに使用される表について説明します。

14.6.1 右左折制限ユーザー・データ

右左折制限は、次の各表で記述されます。

エッジ(またはリンク)は、方向のないエッジで、EDGE表(「EDGE表」で説明)内の1つ以上の方向付きエッジに対応します。右左折制限は、2つ以上のエッジのグループであるナビゲーション・ストランド(nav_strand)に適用されます。単純な右左折制限は2エッジ(右左折が開始するエッジと右左折が終了するエッジ)のnav_strandに適用されます。nav_strandでは、3つ以上のエッジを使用して、非常に複雑な制限付きマヌーバを記述できます。

14.6.1.1 ROUTER_CONDITION表

ROUTER_CONDITION表には、単純な条件の右左折制限ユーザー・データを構築するために使用されるRAWデータが含まれます。この表は、ルーティング・プロセス中は使用されません。かわりに、ROUTER_TURN_RESTRICTION_DATAユーザー・データ表の構築に使用されます。これはルーティング・エンジン・データ・セットの一部であるため、ルーティング・エンジン・データが再パーティション化される場合に右左折制限ユーザー・データを再構築できます。ROUTER_CONDITION表に含まれる列を、表14-5に示します。

表14-5 ROUTER_CONDITION表

列名 データ型 説明

NAV_STRAND_ID

NUMBER

nav_strandの一意ID番号。

APPLIES_TO

NUMBER

右左折制限が適用される車両のリストを表す数値。

14.6.1.2 ROUTER_NAV_STRAND表

ROUTER_NAV_STRAND表には、複雑なマヌーバの右左折制限ユーザー・データを構築するために使用されるRAWデータが含まれます。この表は、ルーティング・プロセス中は使用されません。かわりに、ROUTER_TURN_RESTRICTION_DATAユーザー・データ表の構築に使用されます。これはルーティング・エンジン・データ・セットの一部であるため、ルーティング・エンジン・データが再パーティション化される場合に右左折制限ユーザー・データを再構築できます。ROUTER_NAV_STRAND表に含まれる列を、表14-6に示します。

表14-6 ROUTER_NAV_STRAND表

列名 データ型 説明

NAV_STRAND_ID

NUMBER

このエッジを含むnav_strandの一意ID番号。

SEQ_NUM

NUMBER

nav_strand内のエッジIDの位置。

LINK_ID

NUMBER

このnav_strandの一部であるエッジのリンク(エッジ) ID。

NODE_ID

NUMBER

nav_strand内の最初と2番目のリンクIDを接続するノードのノードID。これは、nav_strand内の他のすべてのリンクに対してはゼロです。

APPLIES_TO

NUMBER

右左折制限が適用される車両のリストを表す数値。

14.6.1.3 ROUTER_TURN_RESTRICTION_DATA表

ROUTER_TURN_RESTRICTION_DATA表には、右左折制限を記述するユーザー・データが含まれます。この表は、ルーティング・プロセス中に右左折制限を適用するために使用されます。この表は、EDGE表のパーティション化に合せてパーティション化されます。特定のルーティング・エンジン・データ・パーティションがキャッシュに入れられた場合、同じ番号の右左折制限ユーザー・データ・パーティションもキャッシュに入れられます。

ROUTER_TURN_RESTRICTION_DATA表に含まれる列を、表14-7に示します。

表14-7 ROUTER_TURN_RESTRICTION_DATA表

列名 データ型 説明

PARTITION_ID

NUMBER

この右左折制限ユーザー・データが関連付けられるルーティング・エンジン・データ・パーティションIDです。

NUM_EDGES

NUMBER

右左折制限が適用されるエッジ数です。

TURN_RESTRICTION_DATA

BLOB

右左折制限を記述するnav_strand情報と右左折制限が適用されるエッジを含むBLOBです。

14.6.2 トラック輸送ユーザー・データ

トラック輸送情報は、次の各表で記述されます。

14.6.2.1 ROUTER_TRANSPORT表

ROUTER_TRANSPORT表には、トラック輸送ユーザー・データを構築するために使用されるRAWデータが含まれます。この表は、ルーティング・プロセス中は使用されません。かわりに、ROUTER_TRUCKING_DATA表 (ユーザー・データ表)の構築に使用されます。これはルーティング・エンジン・データ・セットの一部であるため、ルーティング・エンジン・データが再パーティション化される場合にトラック輸送ユーザー・データを再構築できます。

ROUTER_TRANSPORT表がルーティング・エンジン・スキーマに最初にインポートされる際に、SDO_ROUTER_PARTITION.CREATE_TRUCKING_DATAプロシージャ(「CREATE_TRUCKING_DATAプロシージャ」を参照)を実行してROUTER_TRUCKING_DATAパーティション・ユーザー・データ表を生成する必要があります。

ROUTER_TRANSPORT表に含まれる列を、表14-8に示します。

表14-8 ROUTER_TRANSPORT表

列名 データ型 説明

EDGE_ID

NUMBER

制限が適用されるエッジのエッジID番号。

MAINTYPE

NUMBER(2)

トラック輸送制限のタイプ: 高さ、長さ、車軸当たり重量、重量、幅または法定。

SUBTYPE

NUMBER(2)

制限のメイン・タイプの拡張または例外の提供に使用されるサブタイプ。たとえば、配送サブタイプでは、配送トラックに、他のトラックが禁止されている場所へのアクセスを許可することがあります。

VALUE

NUMBER(6,2)

メイン・タイプに関連付けられている値: たとえば、幅メイン・タイプに関連付けられている値20は、20メートル・トンを超えるトラックがエッジへのアクセスを許可されないことを示します。

14.6.2.2 ROUTER_TRUCKING_DATA表

ROUTER_TRUCKING_DATA表には、トラック制限を記述するユーザー・データが含まれます。この表は、ルーティング・プロセス中にトラック制限を適用するために使用されます。この表は、EDGE表のパーティション化に合せてパーティション化されます。特定のルーティング・エンジン・データ・パーティションがキャッシュに入れられた場合、ルーティングされる車両がトラックであれば、同じ番号のトラック制限ユーザー・データ・パーティションもキャッシュに入れられます。

ROUTER_TRUCKING_DATA表に含まれる列を、表14-9に示します。

表14-9 ROUTER_TRUCKING_DATA表

列名 データ型 説明

PARTITION_ID

NUMBER

このトラック輸送データが関連付けられるルーティング・エンジン・データ・パーティションのIDです。

NUM_EDGES

NUMBER

このパーティション内のトラック輸送制限があるエッジの数。

TRUCKING_DATA

BLOB

BLOB形式での、このパーティションのトラック輸送制限。

14.6.3 タイム・ゾーン・ユーザー・データ

ルーティング・エンジンは、ルート・トラバースの時間を追跡できますが、そのためにはタイム・ゾーンの情報が必要です。このデータは、次の表に格納されています。

14.6.3.1 ROUTER_TIMEZONES表

ROUTER_TIMEZONES表は、タイム・ゾーン名を一意の数値の識別子にマップします。この表は、タイム・ゾーン・ユーザー・データ表の構築に使用されます。ルートの計算プロセスでは使用されません。

これはルーティング・エンジン・データ・セットの一部であるため、ルーティング・エンジン・データが再パーティション化される場合にタイム・ゾーン・ユーザー・データを再構築できます。ルーター・データが再パーティション化されるたびに、CREATE_TIMEZONE_DATAプロシージャを実行してタイム・ゾーン・ユーザー・データ表ROUTER_TIMEZONE_DATAを作成する必要があります。

ROUTER_TIMEZONES表に含まれる列を、次の表に示します。

表14-10 ROUTER_TIMEZONES表

列名 データ型 説明

TIMEZONE_ID

NUMBER

タイム・ゾーンの一意の識別子。

TIMEZONE_NAME

VARCHAR2(30)

タイム・ゾーンの名前。

14.6.3.2 ROUTER_TIMEZONE_DATA表

ROUTER_TIMEZONE_DATA表には、各エッジをそれに対応するタイム・ゾーンに関連付けるユーザー・データが含まれています。この表はパーティション化され、ルーティング・エンジン・データ・パーティションがキャッシュに取り込まれる際に対応するタイム・ゾーン・ユーザー・データが同時に取り込まれます。

ROUTER_TIMEZONE_DATA表に含まれる列を、次の表に示します。

表14-11 ROUTER_TIMEZONE_DATA表

列名 データ型 説明

PARTITION_ID

NUMBER

このタイム・ゾーン・データが関連付けられるルーティング・データ・パーティションのID。

NUM_EDGES

NUMBER

このパーティションのエッジ数。

TIMEZONE_DATA

BLOB

このパーティションのエッジのタイム・ゾーン・データ。

14.6.4 トラフィック・ユーザー・データ

リリース12.2より、ルーティング・エンジンで過去のトラフィック・パターン・データを計算に含めることができるようになり、1日のうちの移動時間帯による変動を考慮に入れることができます。このオプションの機能を組み込むには、ルーティング・エンジンは、タイム・ゾーン・ユーザー・データおよびトラフィック・パターン・データが使用可能であることを必要とします。トラフィック・パターン・ユーザー・データは、次の表に格納されています。

14.6.4.1 TP_USER_DATA表

TP_USER_DATA表は、各エッジをトラフィック・パターン・データに関連付けるユーザー・データで構成されます。あるエッジのトラフィック・パターンは、一定の時間間隔で計測される、そのエッジを通るトラフィックの速度で構成されます。現在、データに使用できる粒度は、15分間隔と1時間間隔の2つです。粒度はSAMPLING_ID値で示します。1は15分間隔を表し、2は1時間間隔を表します。

TP_USER_DATA表に含まれる列を、次の表に示します。

表14-12 TP_USER_DATA表

列名 データ型 説明

PARTITION_ID

NUMBER

このトラフィック・データが関連付けられるルーティング・データ・パーティションのID。

SAMPLING_ID

NUMBER

トラフィック・パターン・データの粒度を表すサンプリングID。1は、データが15分間隔で収集されることを表し、2は1時間間隔で収集されることを表します

BLOB

BLOG

このパーティションのエッジのトラフィック・パターン・データ。