This section contains XML examples of batch mode route requests and the responses generated by those requests. One request uses specified addresses, and the other request uses previously geocoded locations. For reference information about the available elements and attributes, see Batch Route Request XML Schema Definition for requests and Batch Route Response XML Schema for responses.
Example 13-7 Batch Route Request with Specified Addresses
Example 13-7 shows a batch route request using specified addresses. The request is for the fastest routes, preferably using highways, between an office in Waltham, Massachusetts and three end locations (an Oracle office in Nashua, New Hampshire; the town offices in Concord, Massachusetts; and Boston City Hall), using miles for distances and minutes for times. The request calls for the returned routes to be sorted by distance between the start and end ___location, and for no routes over 35 miles to be returned.
<?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>
Example 13-8 Batch Route Response with Specified Addresses
Example 13-8 shows the response generated by the request in Example 13-7. (The output is reformatted for readability.) Note that because sort_by_distance = "true"
was specified in the request, the routes returned are not in order by route IDs (11, 12, 10), but instead by route distances.
<!-- 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>
Example 13-9 Batch Route Request with Previously Geocoded Locations
Example 13-9 shows a batch route request using previously geocoded locations. The request is for the fastest routes, preferably using highways, between one ___location and three other locations, using miles for distances and minutes for times. The request calls for the returned routes to be sorted by distance between the start and end ___location, and for no routes over 28.5 miles to be returned.
<?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>
Example 13-10 Batch Route Response with Previously Geocoded Locations
Example 13-10 shows the response to the request in Example 13-9. Only two routes are returned, because the third route is longer than the specified cutoff distance of 28.5 miles. (The output is reformatted for readability.)
<!-- 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>