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
:fastest
、traffic
またはshortest
(デフォルト) -
traffic_sampling_id
(route_preference
がtraffic
の場合):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_time
がtrue
に設定されている場合にルート・レスポンスの出発時間と到着時間の表示に使用される書式 -
language
: 運転方向の生成に使用する言語(ENGLISH
(デフォルト)、FRENCH
、GERMAN
、ITALIAN
、PORTUGUESE
またはSPANISH
) -
distance_unit
:kilometer
、mile
(デフォルト)またはmeter
-
length_unit
: フィートの場合はus
(デフォルト)、メートルの場合はmetric
-
time_unit
:hour
、minute
(デフォルト)またはsecond
-
weight_unit
: トンの場合はus
(デフォルト)、メートル・トンの場合はmetric
-
pre_geocoded_locations
(出発地および目的地を、入力場所(住所指定または点)とジオコード済の場所のどちらで指定するか):true
(ジオコード済の場所)またはfalse
(デフォルト。入力場所) -
driving_directions_detail
:high
、medium
(デフォルト)またはlow
-
optimize_route
:true
またはfalse
(デフォルト) -
route_type
:open
(デフォルト)またはclosed
-
vehicle_type
:auto
(デフォルト)またはtruck
-
truck_type
:delivery
、public
、resident
または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
:kilometer
、km
、mile
(デフォルト)またはmeter
-
time_unit
:hour
、minute
(デフォルト)またはsecond
-
sort_by_distance
(戻されるルートを、出発地から目的地までの距離で昇順にソートするかどうか):true
またはfalse
(デフォルト) -
cutoff_distance
(出発地から目的地までの距離が、指定された距離以下のルートのみを戻す): (数値。デフォルトは制限なし) -
pre_geocoded_locations
(出発地および目的地を、入力場所(住所指定または点)とジオコード済の場所のどちらで指定するか):true
(ジオコード済の場所)またはfalse
(デフォルト。入力場所)
- ルート・リクエストおよびルート・レスポンスの例
- ルート・リクエストXMLスキーマ定義
- ルート・レスポンスXMLスキーマ定義
- バッチ・モード・ルート・リクエストおよびバッチ・モード・ルート・レスポンスの例
- 一括ルート・リクエストXMLスキーマ定義
- 一括ルート・レスポンスXMLスキーマ
親トピック: ルーティング・エンジン
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_preference
をtraffic
に、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_preference
をshortest
(traffic
ではない)に、return_route_time
をtrue
に設定したルート・リクエストを示します。
<?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_time
をtrue
に設定することで、ルートの各ステップにかかる時間を表示するようルーターに指示します。
<?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>
親トピック: ルーティング・エンジンのXML API
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>
指定にも事前ジオコード済住所を使用する必要があります。
一括ルート・リクエストでは、個々のルート・リクエストはそれぞれ前述のルールに従う必要があります。ただし、バッチ内では、個々のリクエストは独立しているため、個々のリクエスト内で一貫しているかぎり、住所、事前ジオコード済および経度/緯度の場所を組み合せることができます。
親トピック: ルート・リクエストXMLスキーマ定義
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_geometry
がTRUE
の場合、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_ids
がTRUE
の場合、return_driving_directions
属性の値に関係なく、ルートの運転方向が戻されます。
language
はオプションの属性で、運転方向の生成に使用するデフォルトの言語を上書きします。デフォルトの言語はweb.xml
ファイルで設定されており、この属性を使用してリクエストごとにデフォルトを上書きできます。サポートされている属性値は、ENGLISH
、FRENCH
、GERMAN
、ITALIAN
、PORTUGUESE
および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
のサブ属性です。この属性は、具体的なトラック・タイプを説明し、より一般的なトラック・ルールをオーバーライドできます。サポートされている属性値は、DELIVERY
、PUBLIC
、RESIDENT
およびTRAILER
です。DELIVERY
、PUBLIC
および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
でのトラックの幅を浮動小数点数として指定します。この幅は、ルートの一部とみなされているエッジ上に存在する可能性のある幅制限に対してチェックするために使用されます。
親トピック: ルート・リクエストXMLスキーマ定義
14.3.2.3 input_location要素
<input_location>
要素は、Oracle Spatialのジオコーディング・リクエストのXMLスキーマ(ジオコーディング・リクエストのXMLスキーマ定義および例を参照)に適した形式で、住所を指定します。経度/緯度のペアまたは<input_address>
要素を使用して入力の場所を指定できます。「ルート・リクエストおよびルート・レスポンスの例」の例14-1では、<input_location>
要素とその子要素の<input_address>
を使用して出発地と目的地の住所が指定されています。
<input_location>
要素を使用する場合は、<route_request>
要素のpre_geocoded_locations
属性の値をFALSE
(デフォルト)に設定する必要があります。経度/緯度のペアおよび<input_address>
要素をリクエストで一緒に使用できます。
親トピック: ルート・リクエストXMLスキーマ定義
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>
要素で指定する必要があります。
親トピック: ルート・リクエストXMLスキーマ定義
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>
親トピック: ルーティング・エンジンのXML API
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>
親トピック: ルーティング・エンジンのXML API
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>
子要素は、バッチ・モード・ルート・リクエストでは使用されません。
親トピック: 一括ルート・リクエストXMLスキーマ定義
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スキーマ」を参照)を生成する場合、そのルートはレスポンスから除外され表示されません。
親トピック: 一括ルート・リクエスト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>
親トピック: ルーティング・エンジンのXML API