プライマリ・コンテンツに移動
Oracle® Spatial and Graph開発者ガイド
12cリリース1 (12.1)
B72470-07
目次へ移動
目次
索引へ移動
索引

前
次

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

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

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

例13-7では、指定した住所を使用する一括ルート・リクエストを示しています。このリクエストは、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>

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

例13-8に、例13-7のリクエストによって生成されたレスポンスを示します。(出力は、読みやすくするために変更が加えられています。)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>

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

例13-9は、ジオコード済の場所を使用する一括ルート・リクエストを示しています。このリクエストは、可能であれば高速道路を使用し、ある場所と他の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>

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

例13-10に、例13-9のリクエストに対するレスポンスを示します。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>