Docstoc

bing pdf

Document Sample
bing pdf Powered By Docstoc
					Contents
Bing Maps REST Services .............................................................................................................. 3
  Getting Started with the Bing Maps REST Services .................................................................... 4
  What's New in the REST Services ............................................................................................... 5
  Getting Traffic Incident Data ........................................................................................................ 6
  Bing Maps REST Services API Reference ................................................................................ 12
    Locations API .......................................................................................................................... 13
      Find a Location by Address ................................................................................................. 14
      Find a Location by Point ...................................................................................................... 29
      Find a Location by Query .................................................................................................... 39
      Location Data ...................................................................................................................... 56
    Imagery API ............................................................................................................................ 67
      Get a Static Map .................................................................................................................. 68
      Get Imagery Metadata ......................................................................................................... 92
      Imagery Metadata Data ..................................................................................................... 105
      Static Map Data ................................................................................................................. 110
    Routes API ............................................................................................................................ 119
      Calculate a Route .............................................................................................................. 120
        Driving Route Example .................................................................................................. 130
        Walking Route Example ................................................................................................. 153
        Transit Route Example .................................................................................................. 184
        Driving Route with Route Path Example ........................................................................ 212
        Driving Route using Tolerances Example ...................................................................... 260
      Calculate Routes from Major Roads ................................................................................. 267
      Route Data ........................................................................................................................ 307
      Maneuver Types ................................................................................................................ 324
      Warning Types .................................................................................................................. 327
    Traffic API ............................................................................................................................. 329
      Get Traffic Incidents .......................................................................................................... 329
      Traffic Incident Data .......................................................................................................... 341
    Common Parameters and Types .......................................................................................... 347
      Bing Maps REST URL Structure ....................................................................................... 348
      Culture Parameter ............................................................................................................. 349
      Output Parameters ............................................................................................................ 350
      User Context Parameters .................................................................................................. 353
      Location and Area Types .................................................................................................. 354
      Pushpin Syntax and Icon Styles ........................................................................................ 356
      Entity Types ....................................................................................................................... 363
      Supported Culture Codes .................................................................................................. 374
 Common Response Description ........................................................................................... 378
 Status Codes and Errors ...................................................................................................... 381
Developer Resources ............................................................................................................... 382
Bing Maps REST Services
The Bing™ Maps REST Services Application Programming Interface (API) provides a
Representational State Transfer (REST) interface to perform tasks such as creating a static map
with pushpins, geocoding an address, retrieving imagery metadata, or creating a route.
This Bing Maps REST Services documentation consists of a set of reference topics that cover the
Bing Maps REST Services Application Programming Interface (API), Version 1.0.
Transaction accounting is provided when you use the Bing Maps REST Services. For more
information about billable and non-billable transactions for the Bing Maps REST Services, see
Viewing Bing Maps Transaction Reports.
For information about geocoding large sets of spatial data using a REST Interface, see the Bing
Spatial Data Services.
If you are reading this documentation online, you can download the Bing Maps REST Services
documentation CHM file or PDF file for offline viewing.


In This Section
Getting Started with the Bing Maps REST          Use this topic as a starting point for using the
Services                                         Bing Maps REST Services.

What's New in the REST Services                  Use this topic to learn about the latest updates
                                                 to the Bing Maps REST Services.

Getting Traffic Incident Data                    Use this topic to learn about how you can get
                                                 traffic incident data by using the Routes API
                                                 and the Traffic API.

Bing Maps REST Services API Reference            Use the API reference to get detailed
                                                 information about REST URL templates to use
                                                 to make geocoding, imagery and routing
                                                 requests. Descriptions of the results returned
                                                 and example requests and responses are also
                                                 provided.




See Also
Terms and Conditions




                                                                                                    3
Getting Started with the Bing Maps REST Services
The Bing™ Maps REST Services Application Programming Interface (API) is a Representational
State Transfer (REST) API that you can use to do common tasks, such as finding an address,
retrieving a map with a pushpin and a label, or getting driving directions. You perform these tasks
by constructing a URL. URL templates are described in the Bing Maps REST Services API
Reference.


Getting a Bing Maps Key
To start working with the Bing Maps REST Services, you must have a Bing Maps Key. For
information about getting a Bing Maps Key, see Getting a Bing Maps Key.


Using the Bing Maps REST Services
The following table lists the Bing Maps REST Services components and the common tasks they
perform. For information about the URL templates to use to perform these tasks, click one of the
API links below. For complete information about the Bing Maps REST Services, see Bing Maps
REST Services API Reference.


REST API                                          Features

Locations API                                        Find a location based on an address, point,
                                                       or query.

Imagery API                                          Get a static map.
                                                     Get a static map that displays a route.
                                                     Get imagery metadata.

Routes API                                           Find a walking, driving or transit route.
                                                     Find routes from major routes to a location.
                                                     Get traffic information along a route.

Traffic API                                          Get traffic information for a geographical
                                                       area.



Additional Topics
The following topics show examples of how to use the Bing Maps REST Services with other Bing
Maps APIs or provide related information.


Displaying Location Search Results Using the      This topic shows how to use the Bing Maps
REST Services                                     REST Services with Bing Maps AJAX Control,
                                                  Version 7.0.

Accessing the Bing Maps REST Services using       This article shows how to write a PHP

                                                                                                    4
PHP                                                 application that can interact with the Bing Maps
                                                    REST Services APIs.

Bing Maps Transit Coverage                          Provides a list of transit agencies that are used
                                                    by Bing Maps REST Services to provide transit
                                                    routes.



Transaction Accounting
Transactions are counted for each Bing Maps REST Services request sent with a valid Bing
Maps Key. For information about billable and non-billable transactions for the Bing Maps REST
Services and how to view them, see Viewing Bing Maps Usage Reports.


What's New in the REST Services
The Bing Maps REST Services contains the following new features.
Routes API [Calculate a Route]
   ViaWaypoints help you define your route. You now have more control over your route with
     intermediate waypoints points called viaWaypoints. ViaWaypoints are route points that your
     route must pass through. Unlike a waypoint, a viaWaypoint does not create a new route leg.
     You can have up to 10 viaWaypoints between two waypoints. Waypoints and viaWaypoints
     are specified as a single series of points. See the following example and Calculate a Route
     for more information.
     The following example shows how to request a driving route between Seattle, Washington
     and Bend, Oregon that routes through Portland, Oregon. Note that both the wayPoints and
     the viaWaypoint are part of a single series of points with sequential indexes of ".1", ".2" and
     ".3".
       http://dev.virtualearth.net/REST/V1/Routes/Driving?o=xml&wp.1=Se
       attle,WA&vwp.2=Portland,OR&wp.3=Bend,OR&key=BingMapsKey
   Alternate driving routes are now available for the United Kingdom, Australia, and India.
     You can now request up to three (3) alternate driving routes in the United Kingdom, Australia,
     and India by setting the maxSolutions parameter when you Calculate a Route. Alternate
     routes are already supported for the United States, Canada, and Mexico.
Locations API [Find a Location by Address, Find a Location by Query]
   Specify the maximum number of location results to return. When you use the Locations
     API to geocode a location, you can now request up to a maximum of 20 location results in the
     response by setting the maxResults parameter. The default maximum is 5 (five) results. For
     more information, see Find a Location by Address and Find a Location by Query.
   Query parse information is now available when you geocode a location. You can now
     add include=QueryParse to your Find a Location by Query request URL to get parsed query
     string values in the response. For example, the query string
     q=1%20Microsoft%20Way%20Redmond%20WA%2098052 would return the following
     query parse values.
                                                                                                       5
     XML Query Parse Response
       <QueryParseValue Property="AddressLine" Value="1 Microsoft Way"
       />
       <QueryParseValue Property="Locality" Value="Redmond" />
       <QueryParseValue Property="PostalCode" Value="98052" />
       <QueryParseValue Property="AdminDistrict" Value="WA" />
     JSON Query Parse Response
       "queryParseValues":[
                                      {
                                           "property":"AddressLine",
                                           "value":"1 Microsoft Way"
                                      },
                                      {
                                           "property":"Locality",
                                           "value":"Redmond"
                                      },
                                      {
                                           "property":"PostalCode",
                                           "value":"98052"
                                      },
                                      {
                                           "property":"AdminDistrict",
                                           "value":"WA"
                                      }
                                  ]




Getting Traffic Incident Data

     Traffic incident information is available for the United States and Canada.
You can get traffic incident information along a route using the Routes API and for a geographical
area by using the Traffic API. Traffic incident information is provided in two ways:
   Traffic incident details including description, severity, location, type of incident.



                                                                                                 6
   Traffic location codes that specify incident information for a road segment or specific location
     as a code, such as 120-15918. A subscription is typically required to interpret and use the
     traffic location codes.


Traffic incident information along a route (Routes API)
Each route segment (itinerary item) returned by the Routes API may include a set of traffic
location codes and a set of warnings that specify traffic incident information along that part of the
route. The warnings include a description of the incident, the severity, and a warning type, such
as Accident or BlockedRoad. To see a list of the warning types, see Warning Types.
There is no specific correlation between traffic location codes and warnings. For example, an
itinerary item can contain traffic location codes without corresponding warnings.
The following is an example of an itinerary item that contains both warnings and traffic location
codes.
{

     "itineraryItems":[

       {

           "compassDirection":"south",

           "details":[

              {

                  "compassDegrees":180,

                  "endPathIndices":[

                       1

                  ],

                  "locationCodes":[

                       "114-08912",

                       "114-08911"

                  ],

                  "maneuverType":"DepartStart",

                  "mode":"Driving",

                  "names":[

                       "44TH Ave W"

                  ],

                  "roadType":"Arterial",

                  "startPathIndices":[

                       0

                  ]

                                                                                                        7
          }

     ],

     "exit":"",

     "iconType":"Auto",

     "instruction":{

          "maneuverType":"DepartStart",

          "text":"Depart 44TH Ave W toward 192ND St SW"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              47.825321,

              -122.292407

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "towardsRoadName":"192ND St SW",

     "transitTerminus":"",

     "travelDistance":1.029,

     "travelDuration":97,

     "travelMode":"Driving"

},

{

     "compassDirection":"southwest",

     "details":[

          {

              "compassDegrees":217,

              "endPathIndices":[

                   6

              ],

              "maneuverType":"TakeRampRight",

              "mode":"Driving",

              "roadType":"Ramp",

                                                          8
     "startPathIndices":[

          1

     ]

},

{

     "compassDegrees":241,

     "endPathIndices":[

          91

     ],

     "locationCodes":[

          "114-04212",

          "114N04212",

          "114-04211",

          "114N04211",

          "114N04207",

          "114-04195"

     ],

     "maneuverType":"Merge",

     "mode":"Driving",

     "names":[

          "I-5 South"

     ],

     "roadShieldRequestParameters":{

          "bucket":50402,

          "shields":[

               {

                   "labels":[

                        "5"

                   ],

                   "roadShieldType":1

               }

          ]

     },

     "roadType":"LimitedAccessHighway",

                                          9
                   "startPathIndices":[

                       6

                   ]

               }

          ],

          "exit":"",

          "iconType":"Auto",

          "instruction":{

               "maneuverType":"RampThenHighwayRight",

               "text":"Take ramp right for I-5 South"

          },

          "maneuverPoint":{

               "type":"Point",

               "coordinates":[

                   47.816019,

                   -122.292332

               ]

          },

          "sideOfStreet":"Unknown",

          "tollZone":"",

          "transitTerminus":"",

          "travelDistance":24.323,

          "travelDuration":908,

          "travelMode":"Driving",

          "warnings":[

               {

                   "severity":"Minor",

                   "text":"Minor Congestion: slow 1st Av\/Northgate Way (#173) to Express
Lanes Southern Entrance\/Exit",

                   "warningType":"Congestion"

               }

          ]

      }

  ]


                                                                                            10
}



Traffic incident information within a geographical area (Traffic
API)
The Traffic API returns a list of traffic incidents in a geographical area and provides incident
details and traffic location codes. Traffic incident details include information such as the incident
description, severity, location, road closures, type of incident, time of incident and detours. See
Traffic Incident Data for a list of the incident details that may be returned. Traffic incidents
reported by the Traffic API include common traffic problems, such as accidents and disabled
vehicles, as well as other potential causes of traffic, such as sports events.
To use the Traffic API, you must specify an area defined as a bounding box. A bounding box is a
set of longitudes and latitudes that define an area. See Location and Area Types for more
information about a bounding box.
The following is an example of traffic incident information returned in a JSON Traffic API
response.
{



"__type":"TrafficIncident:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

    "point":{

         "type":"Point",

         "coordinates":[

             38.64829,

             -94.36405

         ]

    },

    "congestion":"",

    "description":"in both directions between MO-2\/MO-7 and MO-291\/Cantrell Rd -
construction",

    "detour":"",

    "end":"\/Date(1316217600000)\/",

    "incidentId":214828828,

    "lane":"Total Lanes lane blocked",

    "lastModified":"\/Date(1310385750290)\/",

    "roadClosed":false,

    "severity":2,

    "start":"\/Date(1310126400000)\/",


                                                                                                    11
    "toPoint":{

         "type":"Point",

         "coordinates":[

             38.65831,

             -94.36706

         ]

    },

    "locationCodes":[

         "119+05041",

         "119+05042",

         "119-05041",

         "119-05042",

         "119N05041",

         "119N05042",

         "119P05041",

         "119P05042"

    ],

    "type":9,

    "verified":true

}




Bing Maps REST Services API Reference
This section contains reference documentation for the Bing Maps REST Services.


In this section

Locations API                                  Use the Locations API to geocode and reverse-
                                               geocode location data.

Imagery API                                    Use the Imagery API to get a static map and
                                               imagery data information such as map tiles and
                                               providers.

Routes API                                     Use the Routes API to get directions and route
                                               information for driving, walking or using transit.


                                                                                               12
Traffic API                                          Use the Traffic API to get information about
                                                     traffic incidents and issues in a specified area.

Common Parameters and Types                          Use common parameters and types to specify
                                                     values such as culture and pushpin styles.

Common Response Description                          Use this description to understand the results
                                                     returned for a Bing Maps REST Services
                                                     request.

Status Codes and Errors                              Use the status and error code descriptions for
                                                     troubleshooting.



Locations API
Use the Locations API to get location information.
For an example of how to use the Locations API with Bing Maps AJAX Control 7.0, see Using the
REST Services with the Core Map Control.


In this section

Find a Location by Address                           Use these URL templates to get latitude and
                                                     longitude coordinates for a location by
                                                     specifying values such as a locality, postal
                                                     code, and street address.

Find a Location by Point                             Use this URL template to get the location
                                                     information associated with latitude and
                                                     longitude coordinates.

Find a Location by Query                             Use these URL templates to get latitude and
                                                     longitude coordinates that correspond to
                                                     location information provided as a query string.

Location Data                                        Use this description to understand the results
                                                     returned in the response to a Locations API
                                                     request.



See Also
Displaying Location Search Results Using the REST Services and the AJAX 7 Control
Show Bing Results on a Map




                                                                                                      13
Find a Location by Address
Use the following URL templates to get latitude and longitude coordinates for a location by
specifying values such as a locality, postal code, and street address.
When you make a request by using one of the following URL templates, the response returns one
or more Location resources that contain location information associated with the URL parameter
values. The location information for each resource includes latitude and longitude coordinates,
the type of location, and the geographical area that contains the location. For more information
about the Location resource, see Location Data. You can also view the example URL and
response values in the Examples section.

URL Templates


    These templates support both HTTP and HTTPS protocols.


    You can increase the accuracy of a location result by specifying an IP address, user
    location or map area in the URL request. For more information about these parameters,
    see User Context Parameters.
Structured URLs: Get the latitude and longitude coordinates based on a set of address
values for specific countries


    You can substitute a hyphen (-) for any structured URL parameter when there is no
    value.
    For countries that do not have a structured URL template, use the Unstructured URL
    described below.
A structured URL specifies the location data for the country as part of the URL path.
Canada
http://dev.virtualearth.net/REST/v1/Locations/CA/adminDistrict/postalCode/locality/addres
sLine?includeNeighborhood=includeNeighborhood&maxResults=maxResults&key=BingMapsKey

France
http://dev.virtualearth.net/REST/v1/Locations/FR/postalCode/locality/addressLine?includeN
eighborhood=includeNeighborhood&maxResults=maxResults&key=BingMapsKey

Germany
http://dev.virtualearth.net/REST/v1/Locations/DE/postalCode/locality/addressLine?includeN
eighborhood=includeNeighborhood&maxResults=maxResults&key=BingMapsKey

United Kingdom
http://dev.virtualearth.net/REST/v1/Locations/UK/postalCode?includeNeighborhood=includeNe
ighborhood&maxResults=maxResults&key=BingMapsKey

United States

                                                                                              14
http://dev.virtualearth.net/REST/v1/Locations/US/adminDistrict/postalCode/locality/addres
sLine?includeNeighborhood=includeNeighborhood&maxResults=maxResults&key=BingMapsKey

http://dev.virtualearth.net/REST/v1/Locations/US/adminDistrict/locality/addressLine?inclu
deNeighborhood=includeNeighborhood&maxResults=maxResults&key=BingMapsKey

Unstructured URL: Get the latitude and longitude coordinates based on a set of address
values for any country
You can get information for a location in any country by setting one or more of the parameters in
the following URL.
An unstructured URL appends the location data to the URL path. In the URL below, address
information is specified by using URL address parameters such as addressLine, adminDistrict.
and postalCode. These parameters are appended to the URL path.
http://dev.virtualearth.net/REST/v1/Locations?countryRegion=countryRegion&adminDistrict=a
dminDistrict&locality=locality&postalCode=postalCode&addressLine=addressLine&userLocation
=userLocation&userIp=userIp&usermapView=usermapView&includeNeighborhood=includeNeighborho
od&maxResults=maxResults&key=BingMapsKey



    About Special Characters
    When you specify location information using one of the structured URLs, do not use
    values that contain special characters such as a period (.), a comma (,), a colon (:) or a
    plus sign (+). A hyphen is acceptable as a placeholder, but should not be used as part of
    a parameter value in a structured URL. If the location information contains any special
    characters, use the Unstructured URL template or the Find a Location by Query API.
    For example, if you want to get latitude and longitude values for the address “100 Main
    St. Somewhere, WA 98001” that contains a period (.), you can either of these queries.
    use the following
    Unstructured query:
    http://dev.virtualearth.net/REST/v1/Locations?CountryRegion=US&adminDistrict=WA&lo
    cality=Somewhere&postalCode=98001&addressLine=100%20Main%20St.&key=BingMapsKey

    Find a Location by Query query:
    http://dev.virtualearth.net/REST/v1/Locations?CountryRegion=US&adminDistrict=WA&lo
    cality=Somewhere&postalCode=98001&addressLine=100%20Main%20St.&key=BingMapsKey



    You can increase the accuracy of a location result by specifying an IP address, user
    location or map area in the URL request. For more information about these parameters,
    see User Context Parameters.
    If you are using the Locations API from server-side code, you can set the userIP
    parameter to 127.0.0.1 (localhost) to prevent the server’s location from affecting the
    location search results.
Template Parameters

                                                                                                 15
     See the Common Parameters and Types section for additional common parameters to
     use with these URLs.
     Common parameters include:
   Output Parameters: Includes response output types and the JSON callback parameters.
   Culture Parameter: Includes a list of the supported cultures.
   User Context Parameters: Includes parameters that set user location and viewport values to
     help with determining locations. For example, you can specify the user’s location to prioritize
     the set of locations returned when you query with incomplete address information.
     Parameter values are not case-sensitive.


Parameters                    Alias             Description                     Values

adminDistrict                                   Optional for unstructured       A string that contains
                                                URL. The subdivision            a subdivision, such
                                                name in the country or          as the abbreviation of
                                                region for an address. This     a US state.
                                                element is typically treated    Example: WA
                                                as the first order
                                                administrative subdivision,
                                                but in some cases it is the
                                                second, third, or fourth
                                                order subdivision in a
                                                country, dependency, or
                                                region.

locality                                        Optional for unstructured       A string that contains
                                                URL. The locality, such as      the locality, such as a
                                                the city or neighborhood,       US city.
                                                that corresponds to an          Example: Seattle
                                                address.

postalCode                                      Optional for unstructured       A string that contains
                                                URL. The post code,             the postal code, such
                                                postal code, or ZIP Code        as a US ZIP Code.
                                                of an address.                  Example: 98178

addressLine                                     Optional for unstructured       A string specifying
                                                URL. The official street line   the street line of an
                                                of an address relative to       address.
                                                the area, as specified by       Example: 1 Microsoft
                                                the Locality, or                Way
                                                PostalCode, properties.
                                                Typical use of this element
                                                                                                        16
Parameters            Alias    Description                  Values
                               would be to provide a
                               street address or any
                               official address.

countryRegion                  Optional for unstructured A string specifying
                               URL. The ISO country      the ISO country code.
                               code for the country.     Example: AU

includeNeighborhood   inclnb   Optional. Specifies to       One of the following
                               include the neighborhood     values:
                               in the response when it is      1: Include
                               available.                        neighborhood
                                                                 information when
                                                                 available.
                                   When you create
                                                               0 [default]: Do
                                   your URL request,             not include
                                   you can set the               neighborhood
                                   Locality parameter            information.
                                   to a neighborhood.
                                                                 Example:
                                   In this case, the
                                                                 inclnb=1
                                   neighborhood you
                                   provide may be
                                   returned in the
                                   neighborhood field
                                   of the response
                                   and a greater
                                   locality may be
                                   returned in the
                                   locality field.
                                   For example, you
                                   can create a
                                   request that
                                   specifies to include
                                   neighborhood
                                   information
                                   (inclnb=1) and that
                                   sets the Locality to
                                   Ballard and the
                                   AdminDistrict to
                                   WA (Washington
                                   State). In this case,
                                   the neighborhood


                                                                                   17
Parameters                  Alias             Description                   Values
                                                  field in the
                                                  response is set to
                                                  Ballard and the
                                                  locality field is set
                                                  to Seattle. You can
                                                  find this example in
                                                  the Examples
                                                  section.

maxResults                  maxRes            Optional. Specifies the       A string that contains
                                              maximum number of             an integer between 1
                                              locations to return in the    and 20. The default
                                              response.                     value is 5.
                                                                            Example:
                                                                            maxResults=10


Response
One or more Location resources are returned in the response when you make a request by using
these URL templates. For more information about the Location resource, see Location Data. For
more information about the common response syntax for the Bing Maps REST Services, see
Common Response Description. Responses are provided for some URL examples in the
following section.
These URLs support JSON (application/json) and XML (application/xml) response formats. A
JSON response is provided by default unless you request XML output by setting the output (o)
parameter. For more information, see Output Parameters.

Examples



Find location information for a United States street address including the ZIP Code.
This example provides location information for a street address in the United States and requests
the results in XML format.
http://dev.virtualearth.net/REST/v1/Locations/US/WA/98052/Redmond/1%20Microsoft%20Way?o=x
ml&key=BingMapsKey

XML Response
The Locations resource returned for this example provides the latitude and longitude of the
location and defines a geographical area (bounding box) that includes the location. The location
entity type is defined as an Address and the address information that was used as input
parameters is included and enhanced by adding the county (AdminDistrict2) and ZIP Code.


                                                                                                18
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

 <Copyright>

   Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

 </Copyright>

 <BrandLogoUri>

   http://dev.virtualearth.net/Branding/logo_powered_by.png

 </BrandLogoUri>

 <StatusCode>200</StatusCode>

 <StatusDescription>OK</StatusDescription>

 <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

 <TraceId>

   558732d648204c958546678579cbc5cb

 </TraceId>

 <ResourceSets>

   <ResourceSet>

     <EstimatedTotal>1</EstimatedTotal>

     <Resources>

       <Location>

         <Name>1 Microsoft Way, Redmond, WA 98052</Name>

         <Point>

             <Latitude>47.640120461583138</Latitude>

             <Longitude>-122.12971039116383</Longitude>

         </Point>

         <BoundingBox>

             <SouthLatitude>47.636257744012461</SouthLatitude>

             <WestLongitude>-122.13735364288299</WestLongitude>

             <NorthLatitude>47.643983179153814</NorthLatitude>

             <EastLongitude>-122.12206713944467</EastLongitude>

         </BoundingBox>

         <EntityType>Address</EntityType>



                                                                                         19
           <Address>

              <AddressLine>1 Microsoft Way</AddressLine>

              <AdminDistrict>WA</AdminDistrict>

              <AdminDistrict2>King Co.</AdminDistrict2>

              <CountryRegion>United States</CountryRegion>

              <FormattedAddress>1 Microsoft Way, Redmond, WA 98052</FormattedAddress>

              <Locality>Redmond</Locality>

              <PostalCode>98052</PostalCode>

           </Address>

           <Confidence>High</Confidence>

           <MatchCode>Good</MatchCode>

           <GeocodePoint>

              <Latitude>47.640120461583138</Latitude>

              <Longitude>-122.12971039116383</Longitude>

              <CalculationMethod>InterpolationOffset</CalculationMethod>

              <UsageType>Display</UsageType>

           </GeocodePoint>

           <GeocodePoint>

              <Latitude>47.640144601464272</Latitude>

              <Longitude>-122.12976671755314</Longitude>

              <CalculationMethod>Interpolation</CalculationMethod>

              <UsageType>Route</UsageType>

           </GeocodePoint>

         </Location>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>



JSON Response
The following JSON response contains the same information as the previous XML response and
is provided when the output (o) parameter is not set.
{

    "authenticationResultCode":"ValidCredentials",


                                                                                         20
  "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

  "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

  "resourceSets":[

     {

         "estimatedTotal":1,

         "resources":[

           {



"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                 "bbox":[

                      47.636257744012461,

                      -122.13735364288299,

                      47.643983179153814,

                      -122.12206713944467

                 ],

                 "name":"1 Microsoft Way, Redmond, WA 98052",

                 "point":{

                      "type":"Point",

                      "coordinates":[

                          47.640120461583138,

                          -122.12971039116383

                      ]

                 },

                 "address":{

                      "addressLine":"1 Microsoft Way",

                      "adminDistrict":"WA",

                      "adminDistrict2":"King Co.",

                      "countryRegion":"United States",

                      "formattedAddress":"1 Microsoft Way, Redmond, WA 98052",

                      "locality":"Redmond",

                      "postalCode":"98052"



                                                                                         21
                 },

                 "confidence":"High",

                 "entityType":"Address",

                 "geocodePoints":[

                      {

                           "type":"Point",

                           "coordinates":[

                                47.640120461583138,

                                -122.12971039116383

                           ],

                           "calculationMethod":"InterpolationOffset",

                           "usageTypes":[

                                "Display"

                           ]

                      },

                      {

                           "type":"Point",

                           "coordinates":[

                                47.640144601464272,

                                -122.12976671755314

                           ],

                           "calculationMethod":"Interpolation",

                           "usageTypes":[

                                "Route"

                           ]

                      }

                 ],

                 "matchCodes":[

                      "Good"

                 ]

             }

         ]

     }

],

                                                                        22
    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"b0b1286504404eafa7e7dad3e749d570"

}




Find location information for a United States street address without a postal code.
This example provides location information for the same street address as the previous example,
but does not specify the ZIP Code.
http://dev.virtualearth.net/REST/v1/Locations/US/WA/Redmond/1%20Microsoft%20Way?output=xm
l&key=BingMapsKey




Find location information and request up to 10 location results in the response.
This example provides location information for the locality "Greenville" and requests up to 10
location results in the response. The default maximum number of locations returned is five (5)
results.
http://dev.virtualearth.net/REST/v1/Locations?locality=Greenville&maxResults=10&key=BingM
apsKey




Find location information by using a structured URL where some parameters have no
value.
This example provides location information for the United States and uses hyphens (-) for
address values that are not specified.
http://dev.virtualearth.net/REST/v1/Locations/US/-/-/-?key=BingMapsKey




Find location information by using an unstructured URL and setting the userLocation
parameter.
This example provides location information for an unstructured query for Kings Road in the United
Kingdom and uses the userLocation value to prioritize the response. If you remove the
userLocation parameter in this example, the results change because the userLocation position


                                                                                                 23
prioritizes results that are closer to this location. For more information about the userLocation
parameter and other user context parameters, see User Context Parameters.
http://dev.virtualearth.net/REST/v1/Locations?culture=en-
GB&addressLine=Kings%20Road&o=xml&userLocation=51.504360719046616,-
0.12600176611298197&key=BingMapsKey




Find location information and request neighborhood information in the response.
This example provides location information for Ballard in Washington state (WA) and also returns
neighborhood information. Ballard is a neighborhood, but is specified as a locality in the request.
Note that in the response, Ballard is defined as the neighborhood and Seattle is defined as the
locality.
http://dev.virtualearth.net/REST/v1/Locations/US/WA/-/Ballard/-
?o=xml&inclnb=1&key=BingMapsKey

XML Response
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

  <Copyright>

    Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

  </Copyright>

  <BrandLogoUri>

    http://dev.virtualearth.net/Branding/logo_powered_by.png

  </BrandLogoUri>

  <StatusCode>200</StatusCode>

  <StatusDescription>OK</StatusDescription>

  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

  <TraceId>

    ce2998ccf7dc4985b689b091fb64b3e5

  </TraceId>

  <ResourceSets>

    <ResourceSet>

      <EstimatedTotal>1</EstimatedTotal>

      <Resources>

                                                                                                    24
       <Location>

         <Name>Ballard, WA</Name>

         <Point>

              <Latitude>47.675968170166016</Latitude>

              <Longitude>-122.38591003417969</Longitude>

         </Point>

         <BoundingBox>

              <SouthLatitude>47.6561164855957</SouthLatitude>

              <WestLongitude>-122.41252899169922</WestLongitude>

              <NorthLatitude>47.697746276855469</NorthLatitude>

              <EastLongitude>-122.36044311523438</EastLongitude>

         </BoundingBox>

         <EntityType>Neighborhood</EntityType>

         <Address>

              <AdminDistrict>WA</AdminDistrict>

              <AdminDistrict2>King Co.</AdminDistrict2>

              <CountryRegion>United States</CountryRegion>

              <FormattedAddress>Ballard, WA</FormattedAddress>

              <Locality>Seattle</Locality>

              <Neighborhood>Ballard</Neighborhood>

         </Address>

         <Confidence>High</Confidence>

         <MatchCode>Good</MatchCode>

         <GeocodePoint>

              <Latitude>47.675968170166016</Latitude>

              <Longitude>-122.38591003417969</Longitude>

              <CalculationMethod>Rooftop</CalculationMethod>

              <UsageType>Display</UsageType>

         </GeocodePoint>

       </Location>

     </Resources>

   </ResourceSet>

 </ResourceSets>

</Response>

                                                                   25
JSON Response
The following JSON response contains the same information as the previous XML response and
is provided when the output (o) parameter is not set.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

      {

          "estimatedTotal":1,

          "resources":[

            {



"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                 "bbox":[

                      47.6561164855957,

                      -122.41252899169922,

                      47.697746276855469,

                      -122.36044311523438

                 ],

                 "name":"Ballard, WA",

                 "point":{

                      "type":"Point",

                      "coordinates":[

                          47.675968170166016,

                          -122.38591003417969

                      ]

                 },

                 "address":{

                      "adminDistrict":"WA",

                      "adminDistrict2":"King Co.",

                                                                                           26
                          "countryRegion":"United States",

                          "formattedAddress":"Ballard, WA",

                          "locality":"Seattle",

                          "neighborhood":"Ballard"

                     },

                     "confidence":"High",

                     "entityType":"Neighborhood",

                     "geocodePoints":[

                          {

                              "type":"Point",

                              "coordinates":[

                                   47.675968170166016,

                                   -122.38591003417969

                              ],

                              "calculationMethod":"Rooftop",

                              "usageTypes":[

                                   "Display"

                              ]

                          }

                     ],

                     "matchCodes":[

                          "Good"

                     ]

                 }

             ]

         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"0fa6626c9aae482e968c45e465862f93"

}

Find location information for Canada.
This example provides location information for a street in Vancouver, Canada.



                                                                                27
http://dev.virtualearth.net/REST/v1/Locations/CA/BC/V6G/Vancouver/Stanley%20Park%20Causew
ay?key=BingMapsKey




Find location information for France.
This example provides location information for a street in Paris, France.
http://dev.virtualearth.net/REST/v1/Locations/FR/75007/Paris/Avenue%20Gustave%20Eiffel?ke
y=BingMapsKey




Find location information for Germany.
This example provides location information for an address in Berlin, Germany.
http://dev.virtualearth.net/REST/v1/Locations/DE/12010/Berlin/Platz%20Der%20Luftbrücke%20
5?key=BingMapsKey




Find location information for the United Kingdom.
These examples provide location information for a postal code in the United Kingdom.
http://dev.virtualearth.net/REST/v1/Locations/GB/SW1A?key=BingMapsKey

http://dev.virtualearth.net/REST/v1/Locations/GB/SW1A%202AA?key=BingMapsKey




Find location information by using an unstructured URL.
These examples provide location information based on the specified parameter values.
http://dev.virtualearth.net/REST/v1/Locations?postalCode=98052&key=BingMapsKey

http://dev.virtualearth.net/REST/v1/Locations?locality=Redmond&adminDistrict=WA&key=BingM
apsKey

http://dev.virtualearth.net/REST/v1/Locations?countryRegion=AU&adminDistrict=WA&key=BingM
apsKey

http://dev.virtualearth.net/REST/v1/Locations?locality=London&postalCode=SW1A&key=BingMap
sKey


HTTP Status Codes


    For more details about these HTTP status codes, see Status Codes and Errors.
When the request is successful, the following HTTP status code is returned.

                                                                                       28
   200
When the request is not successful, the response returns one of the following errors.
   400
   401
   500
   503


Find a Location by Point
Use the following URL template to get the location information associated with latitude and
longitude coordinates.
When you make a request by using the following URL template, the response returns one or
more Location resources that contain location information associated with the latitude and
longitude coordinate values that you specify. Location information can be as specific as an
address or more general such as the country or region. You can specify the type of location
information you want to receive by setting the includeEntityTypes parameter in the URL. For
example, you can specify to only receive information about the neighborhood that corresponds to
the coordinates. For more information about the Location resource, see Location Data. You can
also view the example URL and response values in the Examples section.

URL Template


     This template supports both HTTP and HTTPS protocols.
Get an address for a specified point (latitude and longitude).
http://dev.virtualearth.net/REST/v1/Locations/point?includeEntityTypes=entityTypes&includ
eNeighborhood=includeNeighborhood&key=BingMapsKey

Template Parameters


     See the Common Parameters and Types section for additional common parameters to
     use with these URLs.
     Common parameters include:
   Output Parameters: Includes response output types and the JSON callback parameters.
   Culture Parameter: Includes a list of the supported cultures.
     Parameter values are not case-sensitive.


Parameters                  Alias        Description         Values

includeEntityTypes                       Optional.           A comma separated
                                         Specifies the       list of entity types
                                         entity types that   selected from the


                                                                                              29
Parameters   Alias   Description        Values
                     you want to        following options.
                     return in the         Address
                     response. Only        Neighborhood
                     the types you
                                           PopulatedPlace
                     specify will be
                                           Postcode1
                     returned. If the
                     point cannot be       AdminDivision1
                     mapped to the         AdminDivision2
                     entity types you      CountryRegion
                     specify, no        These entity types are
                     location           ordered from the most
                     information is     specific entity to the
                     returned in the    least specific entity.
                     response.          When entities of more
                                        than one entity type
                                        are found, only the
                                        most specific entity is
                                        returned. For
                                        example, if you
                                        specify Address and
                                        AdminDistrict1 as
                                        entity types and
                                        entities were found for
                                        both types, only the
                                        Address entity
                                        information is
                                        returned in the
                                        response. One
                                        exception to this rule
                                        is when both
                                        PopulatedPlace and
                                        Neighborhood entity
                                        types are specified
                                        and information is
                                        found for both. In this
                                        case, the information
                                        for both entity types is
                                        returned. Also, more
                                        than one
                                        Neighborhood may be
                                        returned because the


                                                                   30
Parameters               Alias       Description          Values
                                                          area covered by two
                                                          different
                                                          neighborhoods can
                                                          overlap.

point                                Required. The        A point on the Earth
                                     coordinates of the   specified by a latitude
                                     location that you    and longitude. For
                                     want to reverse      more information, see
                                     geocode. A point     the definition of Point
                                     is specified by a    in Location and Area
                                     latitude and a       Types.
                                     longitude. For       Example: 47.64054,-
                                     more information,    122.12934
                                     see the definition
                                     of Point in
                                     Location and
                                     Area Types.

includeNeighborhood      inclnb      Optional.            One of the following
                                     Specifies to         values:
                                     include the             1: Include
                                     neighborhood in           neighborhood
                                     the response              information when
                                     when it is                available.
                                     available.              0 [default]: Do
                                                               not include
                                                               neighborhood
                                                               information.
                                                               Example:
                                                               inclnb=1


Response
One or more Location resources are returned in the response when you make a request using
this URL template. For more information about the Location resource, see Location Data. For
more information about the common response syntax for the Bing Maps REST Services, see
Common Response Description. JSON and XML responses are provided for the URL example in
the following section.
This URL supports JSON (application/json) and XML (application/xml) response formats. A JSON
response is provided by default unless you request XML output by setting the output (o)
parameter. For more information, see Output Parameters.

                                                                                          31
Examples
Find location information for a specified point on the Earth.
This example gets address information for a specified latitude and longitude and requests the
results in XML format.
http://dev.virtualearth.net/REST/v1/Locations/47.64054,-122.12934?o=xml&key=BingMapsKey

XML Response
This example returns the following XML response.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

  <Copyright>

    Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

  </Copyright>

  <BrandLogoUri>

    http://dev.virtualearth.net/Branding/logo_powered_by.png

  </BrandLogoUri>

  <StatusCode>200</StatusCode>

  <StatusDescription>OK</StatusDescription>

  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

  <TraceId>

    dd31ffaf098f4406b7ecdd0da36680ff

  </TraceId>

  <ResourceSets>

    <ResourceSet>

      <EstimatedTotal>1</EstimatedTotal>

      <Resources>

        <Location>

           <Name>1 Microsoft Way, Redmond, WA 98052</Name>

           <Point>

              <Latitude>47.640568390488625</Latitude>

              <Longitude>-122.1293731033802</Longitude>

           </Point>

           <BoundingBox>


                                                                                                32
              <SouthLatitude>47.636705672917948</SouthLatitude>

              <WestLongitude>-122.137016420622</WestLongitude>

              <NorthLatitude>47.6444311080593</NorthLatitude>

              <EastLongitude>-122.1217297861384</EastLongitude>

           </BoundingBox>

           <EntityType>Address</EntityType>

           <Address>

              <AddressLine>1 Microsoft Way</AddressLine>

              <AdminDistrict>WA</AdminDistrict>

              <AdminDistrict2>King Co.</AdminDistrict2>

              <CountryRegion>United States</CountryRegion>

              <FormattedAddress>1 Microsoft Way, Redmond, WA 98052</FormattedAddress>

              <Locality>Redmond</Locality>

              <PostalCode>98052</PostalCode>

           </Address>

           <Confidence>Medium</Confidence>

           <MatchCode>Good</MatchCode>

           <GeocodePoint>

              <Latitude>47.640568390488625</Latitude>

              <Longitude>-122.1293731033802</Longitude>

              <CalculationMethod>Interpolation</CalculationMethod>

              <UsageType>Display</UsageType>

              <UsageType>Route</UsageType>

           </GeocodePoint>

         </Location>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>



JSON Response
The following JSON response contains the same information as the XML response and is
provided when the output (o) parameter is not set.
{


                                                                                        33
  "authenticationResultCode":"ValidCredentials",

  "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

  "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

  "resourceSets":[

     {

         "estimatedTotal":1,

         "resources":[

           {



"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                 "bbox":[

                      47.636705672917948,

                      -122.137016420622,

                      47.6444311080593,

                      -122.1217297861384

                 ],

                 "name":"1 Microsoft Way, Redmond, WA 98052",

                 "point":{

                      "type":"Point",

                      "coordinates":[

                          47.640568390488625,

                          -122.1293731033802

                      ]

                 },

                 "address":{

                      "addressLine":"1 Microsoft Way",

                      "adminDistrict":"WA",

                      "adminDistrict2":"King Co.",

                      "countryRegion":"United States",

                      "formattedAddress":"1 Microsoft Way, Redmond, WA 98052",

                      "locality":"Redmond",



                                                                                         34
                          "postalCode":"98052"

                     },

                     "confidence":"Medium",

                     "entityType":"Address",

                     "geocodePoints":[

                          {

                              "type":"Point",

                              "coordinates":[

                                   47.640568390488625,

                                   -122.1293731033802

                              ],

                              "calculationMethod":"Interpolation",

                              "usageTypes":[

                                   "Display",

                                   "Route"

                              ]

                          }

                     ],

                     "matchCodes":[

                          "Good"

                     ]

                 }

             ]

         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"99b1256e09044490bce82bbbba1dab7a"

}

Find location information for a specified point and request that only CountryRegion entity
types be returned.
This example requests only country or region information for the same latitude and longitude as
the previous example.



                                                                                                  35
http://dev.virtualearth.net/REST/v1/Locations/47.64054,-
122.12934?includeEntityTypes=countryRegion&o=xml&key=BingMapsKey

XML Response
This example returns the following XML response.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

  <Copyright>

    Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

  </Copyright>

  <BrandLogoUri>

    http://dev.virtualearth.net/Branding/logo_powered_by.png

  </BrandLogoUri>

  <StatusCode>200</StatusCode>

  <StatusDescription>OK</StatusDescription>

  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

  <TraceId>

    ca4cc0ce946e4564a20a44db811ee954

  </TraceId>

  <ResourceSets>

    <ResourceSet>

      <EstimatedTotal>1</EstimatedTotal>

      <Resources>

        <Location>

          <Name>United States</Name>

          <Point>

              <Latitude>39.450000762939453</Latitude>

              <Longitude>-98.907997131347656</Longitude>

          </Point>

          <BoundingBox>

              <SouthLatitude>26.677207946777344</SouthLatitude>

              <WestLongitude>177.3487548828125</WestLongitude>

              <NorthLatitude>75.7627944946289</NorthLatitude>

                                                                                         36
              <EastLongitude>-55.848747253417969</EastLongitude>

            </BoundingBox>

            <EntityType>Sovereign</EntityType>

            <Address>

              <CountryRegion>United States</CountryRegion>

              <FormattedAddress>United States</FormattedAddress>

            </Address>

            <Confidence>High</Confidence>

            <MatchCode>Good</MatchCode>

            <GeocodePoint>

              <Latitude>39.450000762939453</Latitude>

              <Longitude>-98.907997131347656</Longitude>

              <CalculationMethod>Rooftop</CalculationMethod>

              <UsageType>Display</UsageType>

            </GeocodePoint>

           </Location>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>



JSON Response
The following JSON response contains the same information as the XML response and is
provided when the output (o) parameter is not set.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

       {

           "estimatedTotal":1,

           "resources":[

                                                                                           37
           {



"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

               "bbox":[

                    26.677207946777344,

                    177.3487548828125,

                    75.7627944946289,

                    -55.848747253417969

               ],

               "name":"United States",

               "point":{

                    "type":"Point",

                    "coordinates":[

                        39.450000762939453,

                        -98.907997131347656

                    ]

               },

               "address":{

                    "countryRegion":"United States",

                    "formattedAddress":"United States"

               },

               "confidence":"High",

               "entityType":"Sovereign",

               "geocodePoints":[

                    {

                        "type":"Point",

                        "coordinates":[

                             39.450000762939453,

                             -98.907997131347656

                        ],

                        "calculationMethod":"Rooftop",

                        "usageTypes":[

                             "Display"

                        ]


                                                                                   38
                           }

                      ],

                      "matchCodes":[

                           "Good"

                      ]

                  }

              ]

          }

     ],

     "statusCode":200,

     "statusDescription":"OK",

     "traceId":"df80a942ddb3440188d7f97a31979d1a"

}

HTTP Status Codes


     For more details about these HTTP status codes, see Status Codes and Errors.
When the request is successful, the following HTTP status code is returned.
   200
When the request is not successful, the response returns one of the following errors.
   400
   401
   500
   503

See Also
Displaying Location Search Results Using the REST Services and the AJAX 7 Control


Find a Location by Query
Use the following URL templates to get latitude and longitude coordinates that correspond to
location information provided as a query string. The strings Space Needle (a landmark) and 1
Microsoft Way Redmond WA (an address) are examples of query strings with location information.
These strings can be specified as a structured URL parameter or as a query parameter value.
This URL template can be used to geocode information from any country. For more accurate
results, use User Context Parameters, such as the coordinates of a user’s current location.
When you make a request by using one of the following URL templates, the response returns one
or more Location resources that contain location information associated with the URL parameter
values. The location information for each resource includes latitude and longitude coordinates,
                                                                                                 39
the type of location, and the geographical area that contains the location. For more information
about the Location resource, see Location Data. You can also view the example URL and
response values in the Examples section.

URL Template


     These templates support both HTTP and HTTPS protocols.


     You can increase the accuracy of a location result by specifying an IP address, user
     location or map area in the URL request. For more information about these parameters,
     see User Context Parameters.
     If you are using the Locations API from server-side code, you can set the userIP
     parameter to 127.0.0.1 (localhost) to prevent the server’s location from affecting the
     location search results.
Returns latitude and longitude coordinates for a location that is specified as query string.
Structured URL
A structured URL specifies the location data as part of the URL path.
http://dev.virtualearth.net/REST/v1/Locations/locationQuery?includeNeighborhood=includeNe
ighborhood&maxResults=maxResults&include=queryParse&key=BingMapsKey

Unstructured URL
An unstructured URL appends the location data to the URL path. In the following template, the
location data is specified by using a query parameter that is appended to the end of the URL
path.
http://dev.virtualearth.net/REST/v1/Locations?query=locationQuery&includeNeighborhood=inc
ludeNeighborhood&include=queryParse&maxResults=maxResults&key=BingMapsKey

Template Parameters


     See the Common Parameters and Types section for additional common parameters to
     use with these URLs.
     Common parameters include:
   Output Parameters: Includes response output types and the JSON callback parameters.
   Culture Parameter: Includes a list of the supported cultures.
   User Context Parameters: Includes parameters that set user location and viewport values to
     assist with determining locations. For example, you can prioritize the set of locations returned
     by a location query when you provide information about the user’s location.
     When an alias is provided, you can use the alias to shorten the length of the query
     parameter. For example, query=1600 Pennsylvania Ave NW Washington, DC can be
     shortened to q=1600 Pennsylvania Ave NW Washington, DC.


                                                                                                   40
   Parameters are not case-sensitive.


Parameters        Alias   Description    Values

query             q       Required. A string that contains information about a location, such
                          Location    as an address or landmark name.
                          information Structured URL examples:
                          .
                                      White%20House
                                         1600%20Pennsylvania%20Ave%20NW%20Washingto
                                         n,%20DC
                                         Unstructured URL examples:
                                         query=White%20House
                                         q=1600%20Pennsylvania%20Ave%20NW%20Washing
                                         ton,%20DC

includeNeighborh inclnb   Optional.      One of the following values:
ood                       Specifies         1: Include neighborhood information when
                          to include          available.
                          the               0 [default]: Do not include neighborhood
                          neighborho          information.
                          od with the
                                         Example:
                          address
                                         inclnb=1
                          information
                          the
                          response
                          when it is
                          available.

include           incl    Optional.      The only option for this parameter is queryParse. When
                          Specifies      this parameter value is specified, the response shows
                          to include     how the query string was parsed into address values,
                          the parsed     such as addressLine, locality, adminDistrict, and
                          query          postalCode.
                          string         Example: incl=queryParse
                          values in
                          the
                          response.

maxResults        maxR    Optional.      A string that contains an integer between 1 and 20. The
                  es      Specifies      default value is 5.
                          the            Example:
                          maximum
                                         maxResults=10
                          number of
                          locations to

                                                                                             41
Parameters         Alias    Description   Values
                            return in
                            the
                            response.


Response
One or more Location resources are returned in the response when you make a request by using
these URL templates. For more information about the Location resource, see Location Data. For
more information about the common response syntax for the Bing Maps REST Services, see
Common Response Description. JSON and XML responses are provided for the URL examples
in the following section.
These URLs support JSON (application/json) and XML (application/xml) response formats. A
JSON response is provided by default unless you request XML output by setting the output (o)
parameter. For more information, see Output Parameters.

Examples
Find location information for an address using a query string.
The following examples request latitude and longitude information for an address specified by the
query string 1 Microsoft way, Redmond WA 98052. Both URLs return the same information. The
results are requested in XML format.
http://dev.virtualearth.net/REST/v1/Locations/1%20Microsoft%20Way%20Redmond%20WA%2098052?
o=xml&key=BingMapsKey



http://dev.virtualearth.net/REST/v1/Locations?q=1%20Microsoft%20Way%20Redmond%20WA%209805
2&o=xml&key=BingMapsKey



XML Response
This example returns the following XML response.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

  <Copyright>

    Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

  </Copyright>

  <BrandLogoUri>

    http://dev.virtualearth.net/Branding/logo_powered_by.png

                                                                                               42
</BrandLogoUri>

<StatusCode>200</StatusCode>

<StatusDescription>OK</StatusDescription>

<AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

<TraceId>

 717bea918cca4a7b9a5dabebb6d23c20

</TraceId>

<ResourceSets>

 <ResourceSet>

   <EstimatedTotal>1</EstimatedTotal>

   <Resources>

     <Location>

       <Name>1 Microsoft Way, Redmond, WA 98052</Name>

       <Point>

            <Latitude>47.640120461583138</Latitude>

            <Longitude>-122.12971039116383</Longitude>

       </Point>

       <BoundingBox>

            <SouthLatitude>47.636257744012461</SouthLatitude>

            <WestLongitude>-122.13735364288299</WestLongitude>

            <NorthLatitude>47.643983179153814</NorthLatitude>

            <EastLongitude>-122.12206713944467</EastLongitude>

       </BoundingBox>

       <EntityType>Address</EntityType>

       <Address>

            <AddressLine>1 Microsoft Way</AddressLine>

            <AdminDistrict>WA</AdminDistrict>

            <AdminDistrict2>King Co.</AdminDistrict2>

            <CountryRegion>United States</CountryRegion>

            <FormattedAddress>1 Microsoft Way, Redmond, WA 98052</FormattedAddress>

            <Locality>Redmond</Locality>

            <PostalCode>98052</PostalCode>

       </Address>

       <Confidence>High</Confidence>

                                                                                      43
            <MatchCode>Good</MatchCode>

            <GeocodePoint>

              <Latitude>47.640120461583138</Latitude>

              <Longitude>-122.12971039116383</Longitude>

              <CalculationMethod>InterpolationOffset</CalculationMethod>

              <UsageType>Display</UsageType>

            </GeocodePoint>

            <GeocodePoint>

              <Latitude>47.640144601464272</Latitude>

              <Longitude>-122.12976671755314</Longitude>

              <CalculationMethod>Interpolation</CalculationMethod>

              <UsageType>Route</UsageType>

            </GeocodePoint>

           </Location>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>



JSON Response
The following JSON response contains the same information as the XML response and is
provided when the output (o) parameter is not set.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

       {

           "estimatedTotal":1,

           "resources":[

              {



                                                                                           44
"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

              "bbox":[

                   47.636257744012461,

                   -122.13735364288299,

                   47.643983179153814,

                   -122.12206713944467

              ],

              "name":"1 Microsoft Way, Redmond, WA 98052",

              "point":{

                   "type":"Point",

                   "coordinates":[

                       47.640120461583138,

                       -122.12971039116383

                   ]

              },

              "address":{

                   "addressLine":"1 Microsoft Way",

                   "adminDistrict":"WA",

                   "adminDistrict2":"King Co.",

                   "countryRegion":"United States",

                   "formattedAddress":"1 Microsoft Way, Redmond, WA 98052",

                   "locality":"Redmond",

                   "postalCode":"98052"

              },

              "confidence":"High",

              "entityType":"Address",

              "geocodePoints":[

                   {

                       "type":"Point",

                       "coordinates":[

                            47.640120461583138,

                            -122.12971039116383

                       ],


                                                                                   45
                               "calculationMethod":"InterpolationOffset",

                               "usageTypes":[

                                    "Display"

                               ]

                          },

                          {

                               "type":"Point",

                               "coordinates":[

                                    47.640144601464272,

                                    -122.12976671755314

                               ],

                               "calculationMethod":"Interpolation",

                               "usageTypes":[

                                    "Route"

                               ]

                          }

                     ],

                     "matchCodes":[

                          "Good"

                     ]

                 }

             ]

         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"f461627364d64fd58c81b1d849ff3ec8 "

}

Find location information and request query parse information.
The following URL performs the same query as the previous example, and also requests query
parse information
http://dev.virtualearth.net/REST/v1/Locations/1%20Microsoft%20Way%20Redmond%20WA%2098052?
include=queryParse&o=xml&key=BingMapsKey




                                                                                             46
This query returns the same response as above with the additional query parse information.
XML Query Parse Response
<QueryParseValue Property="AddressLine" Value="1 Microsoft Way" />

<QueryParseValue Property="Locality" Value="Redmond" />

<QueryParseValue Property="PostalCode" Value="98052" />

<QueryParseValue Property="AdminDistrict" Value="WA" />




JSON Query Parse Response
"queryParseValues":[

                       {

                            "property":"AddressLine",

                            "value":"1 Microsoft Way"

                       },

                       {

                            "property":"Locality",

                            "value":"Redmond"

                       },

                       {

                            "property":"PostalCode",

                            "value":"98052"

                       },

                       {

                            "property":"AdminDistrict",

                            "value":"WA"

                       }

                   ]



Find location information associated with a query string and relevant to the user’s
location.
The following example searches for locations associated with the search query "Kings Road".
Because the userLocation parameter is specified, the results returned are relevant to the user’s
location. For more information about the userLocation parameter and other user context
parameters, see User Context Parameters.



                                                                                                   47
http://dev.virtualearth.net/REST/v1/Locations?culture=en-
GB&query=Kings%20Road&o=xml&userLocation=51.504360719046616,-
0.12600176611298197&o=xml&key=BingMapsKey

For an example of how to use the Locations query URL with the AJAX Core Map Control, see
Displaying Location Search Results Using the REST Services and the AJAX 7 Control.




Find location information associated with a query string and request neighborhood
information.
The following example searches for locations associated with the search query "Greenwich,
United Kingdom". Because the includeNeighborhood (inclnb) parameter is set to 1, the
Neighborhood field is returned in the response.
http://dev.virtualearth.net/REST/v1/Locations/greenwich%20united%20kingdom?inclnb=1&o=xml
&key=BingMapsKey

XML Response
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

  <Copyright>

    Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

  </Copyright>

  <BrandLogoUri>

    http://dev.virtualearth.net/Branding/logo_powered_by.png

  </BrandLogoUri>

  <StatusCode>200</StatusCode>

  <StatusDescription>OK</StatusDescription>

  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

  <TraceId>

    54cfe1520aa2409ab45dc489f5287c8b

  </TraceId>

  <ResourceSets>

    <ResourceSet>

      <EstimatedTotal>1</EstimatedTotal>

      <Resources>

                                                                                            48
       <Location>

         <Name>Greenwich, London, United Kingdom</Name>

         <Point>

              <Latitude>51.484458923339844</Latitude>

              <Longitude>0.0024300001095980406</Longitude>

         </Point>

         <BoundingBox>

              <SouthLatitude>51.455488540347289</SouthLatitude>

              <WestLongitude>-0.0595597166159628</WestLongitude>

              <NorthLatitude>51.5134293063324</NorthLatitude>

              <EastLongitude>0.064419716835158874</EastLongitude>

         </BoundingBox>

         <EntityType>Neighborhood</EntityType>

         <Address>

              <AdminDistrict>England</AdminDistrict>

              <CountryRegion>United Kingdom</CountryRegion>

              <FormattedAddress>Greenwich, London, United Kingdom</FormattedAddress>

              <Locality>London</Locality>

              <Neighborhood>Greenwich</Neighborhood>

         </Address>

         <Confidence>High</Confidence>

         <MatchCode>Good</MatchCode>

         <GeocodePoint>

              <Latitude>51.484458923339844</Latitude>

              <Longitude>0.0024300001095980406</Longitude>

              <CalculationMethod>Rooftop</CalculationMethod>

              <UsageType>Display</UsageType>

         </GeocodePoint>

       </Location>

     </Resources>

   </ResourceSet>

 </ResourceSets>

</Response>



                                                                                       49
JSON Response
The following JSON response contains the same information as the XML response and is
provided when the output (o) parameter is not set.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

      {

          "estimatedTotal":1,

          "resources":[

            {



"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                 "bbox":[

                      51.455488540347289,

                      -0.0595597166159628,

                      51.5134293063324,

                      0.064419716835158874

                 ],

                 "name":"Greenwich, London, United Kingdom",

                 "point":{

                      "type":"Point",

                      "coordinates":[

                          51.484458923339844,

                          0.0024300001095980406

                      ]

                 },

                 "address":{

                      "adminDistrict":"England",

                      "countryRegion":"United Kingdom",

                      "formattedAddress":"Greenwich, London, United Kingdom",

                                                                                           50
                          "locality":"London",

                          "neighborhood":"Greenwich"

                     },

                     "confidence":"High",

                     "entityType":"Neighborhood",

                     "geocodePoints":[

                          {

                              "type":"Point",

                              "coordinates":[

                                   51.484458923339844,

                                   0.0024300001095980406

                              ],

                              "calculationMethod":"Rooftop",

                              "usageTypes":[

                                   "Display"

                              ]

                          }

                     ],

                     "matchCodes":[

                          "Good"

                     ]

                 }

             ]

         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"5049ac0bcbcb46198f851c516883d464"

}

Find location information for a landmark.
The following example requests location information for the Eiffel Tower.
http://dev.virtualearth.net/REST/v1/Locations/Eiffel%20Tower?o=xml&key=BingMapsKey

XML Response



                                                                                     51
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

 <Copyright>

   Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

 </Copyright>

 <BrandLogoUri>

   http://dev.virtualearth.net/Branding/logo_powered_by.png

 </BrandLogoUri>

 <StatusCode>200</StatusCode>

 <StatusDescription>OK</StatusDescription>

 <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

 <TraceId>

   4095ee6d5c73457495db49dacf2abc56

 </TraceId>

 <ResourceSets>

   <ResourceSet>

     <EstimatedTotal>1</EstimatedTotal>

     <Resources>

       <Location>

         <Name>Eiffel Tower, Paris, France</Name>

         <Point>

             <Latitude>48.857929229736328</Latitude>

             <Longitude>2.295259952545166</Longitude>

         </Point>

         <BoundingBox>

             <SouthLatitude>48.857460021972656</SouthLatitude>

             <WestLongitude>2.2933001518249512</WestLongitude>

             <NorthLatitude>48.859039306640625</NorthLatitude>

             <EastLongitude>2.2956900596618652</EastLongitude>

         </BoundingBox>

         <EntityType>Monument</EntityType>



                                                                                         52
            <Address>

              <AdminDistrict>IdF</AdminDistrict>

              <AdminDistrict2>Paris</AdminDistrict2>

              <CountryRegion>France</CountryRegion>

              <FormattedAddress>Eiffel Tower, Paris, France</FormattedAddress>

              <Locality>Paris</Locality>

              <Landmark>Eiffel Tower</Landmark>

            </Address>

            <Confidence>High</Confidence>

            <MatchCode>Good</MatchCode>

            <GeocodePoint>

              <Latitude>48.857929229736328</Latitude>

              <Longitude>2.295259952545166</Longitude>

              <CalculationMethod>Rooftop</CalculationMethod>

              <UsageType>Display</UsageType>

            </GeocodePoint>

           </Location>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>



JSON Response
The following JSON response contains the same information as the XML response and is
provided when the output (o) parameter is not set.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

       {

           "estimatedTotal":1,

                                                                                           53
        "resources":[

           {



"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

               "bbox":[

                    48.857460021972656,

                    2.2933001518249512,

                    48.859039306640625,

                    2.2956900596618652

               ],

               "name":"Eiffel Tower, Paris, France",

               "point":{

                    "type":"Point",

                    "coordinates":[

                        48.857929229736328,

                        2.295259952545166

                    ]

               },

               "address":{

                    "adminDistrict":"IdF",

                    "adminDistrict2":"Paris",

                    "countryRegion":"France",

                    "formattedAddress":"Eiffel Tower, Paris, France",

                    "locality":"Paris",

                    "landmark":"Eiffel Tower"

               },

               "confidence":"High",

               "entityType":"Monument",

               "geocodePoints":[

                    {

                        "type":"Point",

                        "coordinates":[

                           48.857929229736328,

                           2.295259952545166


                                                                                   54
                               ],

                               "calculationMethod":"Rooftop",

                               "usageTypes":[

                                    "Display"

                               ]

                           }

                      ],

                      "matchCodes":[

                           "Good"

                      ]

                  }

              ]

          }

     ],

     "statusCode":200,

     "statusDescription":"OK",

     "traceId":"fb2339699bd24beab9766baf6382f926"

}

Find location information and request up to 10 location results in the response.
This example provides location information for the query string "New York" and requests up to 10
location results in the response. The default maximum number of locations returned is five (5)
results.
http://dev.virtualearth.net/REST/v1/Locations?q=Greenville&maxResults=10&key=BingMapsKey




HTTP Status Codes


     For more details about these HTTP status codes, see Status Codes and Errors.
When the request is successful, the following HTTP status code is returned.
   200
When the request is not successful, the response returns one of the following errors.
   400
   401
   500

                                                                                              55
   503

See Also
Displaying Location Search Results Using the REST Services and the AJAX 7 Control


Location Data
Location Resource
The response returned by a Locations URL contains one or more Location resources. Each
Location resource contains location information that corresponds to the values provided in the
request. This topic provides descriptions of the Locations resource fields, followed by JSON and
XML examples.
For more information about the common response container for the Bing Maps REST Services,
see Common Response Description.


JSON                     XML                       Type                  Description

name                     Name                      string                The name of the
                                                                         resource.

point                    Point                     Point. For more       The latitude and
                                                   information about     longitude coordinates of
                                                   the Point type, see   the location.
                                                   Location and Area
                                                   Types.

bbox                     BoundingBox               BoundingBox. For      A geographic area that
                                                   more information      contains the location. A
                                                   about the             bounding box contains
                                                   BoundingBox type,     SouthLatitude,
                                                   see Location and      WestLongitude,
                                                   Area Types.           NorthLatitude, and
                                                                         EastLongitude values in
                                                                         units of degrees.

entityType               EntityType                string                The classification of the
                                                                         geographic entity
                                                                         returned, such as
                                                                         Address. For a list of
                                                                         entity types, see Entity
                                                                         Types.

address                  Address                   Address               The postal address for
                                                                         the location. An address
                                                                         can contain


                                                                                                56
JSON         XML          Type                 Description
                                               AddressLine,
                                               Neighborhood, Locality,
                                               AdminDistrict,
                                               AdminDistrict2,
                                               CountryRegion,
                                               FormattedAddress,
                                               PostalCode, and
                                               Landmark fields. For
                                               more information about
                                               these fields, see
                                               Location and Area
                                               Types.

confidence   Confidence   One of the following The level of confidence
                          values:              that the geocoded
                          High, Medium, Low location result is a
                                               match. Use this value
                                               with the match code to
                                               determine for more
                                               complete information
                                               about the match.
                                               The confidence of a
                                               geocoded location is
                                               based on many factors
                                               including the relative
                                               importance of the
                                               geocoded location and
                                               the user’s location, if
                                               specified. The following
                                               description provides
                                               more information about
                                               how confidence scores
                                               are assigned and how
                                               results are ranked.
                                               If the confidence is set
                                               to High, one or more
                                               strong matches were
                                               found. Multiple High
                                               confidence matches are
                                               sorted in ranked order
                                               by importance when
                                               applicable. For

                                                                     57
JSON   XML   Type   Description
                    example, landmarks
                    have importance but
                    addresses do not.
                    If a request includes a
                    user location or a map
                    area (see User Context
                    Parameters), then the
                    ranking may change
                    appropriately. For
                    example, a location
                    query for "Paris" returns
                    "Paris, France" and
                    "Paris, TX" both with
                    High confidence. "Paris,
                    France" is always
                    ranked first due to
                    importance unless a
                    user location indicates
                    that the user is in or
                    very close to Paris, TX
                    or the map view
                    indicates that the user is
                    searching in that area.
                    In some situations, the
                    returned match may not
                    be at the same level as
                    the information provided
                    in the request. For
                    example, a request may
                    specify address
                    information and the
                    geocode service may
                    only be able to match a
                    postal code. In this
                    case, if the geocode
                    service has a high
                    confidence that the
                    postal code matches
                    the data, the confidence
                    is set to High and the
                    match code is set to

                                           58
JSON   XML   Type   Description
                    UpHierarchy to specify
                    that it could not match
                    all of the information
                    and had to search up-
                    hierarchy.
                    If the location
                    information in the query
                    is ambiguous, and there
                    is no additional
                    information to rank the
                    locations (such as user
                    location or the relative
                    importance of the
                    location), the
                    confidence is set to
                    Medium. For example, a
                    location query for "148th
                    Ave, Bellevue" may
                    return "148th Ave SE"
                    and "148th Ave NE"
                    both with Medium
                    confidence.
                    If the location
                    information in the query
                    does not provide
                    enough information to
                    geocode a specific
                    location, a less precise
                    location value may be
                    returned and the
                    confidence is set to
                    Medium. For example, if
                    an address is provided,
                    but a match is not found
                    for the house number,
                    the geocode result with
                    a Roadblock entity type
                    may be returned. You
                    can check the
                    entityType field value to
                    determine what type of

                                          59
JSON         XML         Type                 Description
                                              entity the geocode
                                              result represents. For a
                                              list of entity types, see
                                              Entity Types.

matchCodes   MatchCode   One or more of the   One or more match
                         following values:    code values that
                         Good, Ambiguous,     represent the geocoding
                         UpHierarchy          level for each location in
                                              the response.
                                              For example, a
                                              geocoded location with
                                              match codes of Good
                                              and Ambiguous means
                                              that more than one
                                              geocode location was
                                              found for the location
                                              information and that the
                                              geocode service did not
                                              have search up-
                                              hierarchy to find a
                                              match.
                                              Similarly, a geocoded
                                              location with match
                                              codes of Ambiguous
                                              and UpHierarchy means
                                              that a geocode location
                                              could not be found that
                                              matched all of the
                                              location information, so
                                              the geocode service
                                              had to search up-
                                              hierarchy and found
                                              multiple matches at that
                                              level. An example of up
                                              an Ambiguous and
                                              UpHierarchy result is
                                              when you provide
                                              complete address
                                              information, but the
                                              geocode service cannot
                                              locate a match for the

                                                                     60
JSON   XML   Type   Description
                    street address and
                    instead returns
                    information for more
                    than one RoadBlock
                    value.
                    The possible values
                    are:
                    Good: The location has
                    only one match or all
                    returned matches are
                    considered strong
                    matches. For example,
                    a query for New York
                    returns several Good
                    matches.
                    Ambiguous: The
                    location is one of a set
                    of possible matches.
                    For example, when you
                    query for the street
                    address 128 Main St.,
                    the response may
                    return two locations for
                    128 North Main St. and
                    128 South Main St.
                    because there is not
                    enough information to
                    determine which option
                    to choose.
                    UpHierarchy: The
                    location represents a
                    move up the geographic
                    hierarchy. This occurs
                    when a match for the
                    location request was not
                    found, so a less precise
                    result is returned. For
                    example, if a match for
                    the requested address
                    cannot be found, then a
                    match code of

                                           61
JSON                     XML                       Type                   Description
                                                                          UpHierarchy with a
                                                                          RoadBlock entity type
                                                                          may be returned.

queryParseValues         QueryParseValue           collection             A collection of parsed
                                                                          values that shows how
                                                                          a location query string
                                                                          was parsed into one or
                                                                          more of the following
                                                                          address values.
                                                                             AddressLine
                                                                             Locality
                                                                             AdminDistrict
                                                                             AdminDistrict2
                                                                             PostalCode
                                                                             CountryRegion
                                                                             Landmark

geocodePoints            GeocodePoint              collection             A collection of
                                                                          geocoded points that
                                                                          differ in how they were
                                                                          calculated and their
                                                                          suggested use. For a
                                                                          description of the points
                                                                          in this collection, see
                                                                          the Geocode Point
                                                                          Fields section below.




Geocode Point Fields
The following fields are provided for each geocode point in the Geocode Points collection.


JSON                     XML                       Type                          Description

point                    Point                     Point. For more               The latitude and
                                                   information about the         longitude
                                                   Point type, see Location      coordinates of the
                                                   and Area Types.               geocode point.

calculationMethod        CalculationMethod         One of the following          The method that
                                                   values:                       was used to

                                                                                                  62
JSON         XML         Type                          Description
                            Interpolation: The       compute the
                              geocode point was        geocode point.
                              matched to a point on
                              a road using
                              interpolation.
                            InterpolationOffset:
                              The geocode point
                              was matched to a
                              point on a road using
                              interpolation with an
                              additional offset to
                              shift the point to the
                              side of the street.
                            ParcelCentroid: The
                              geocode point was
                              matched to the center
                              of a parcel.
                            Rooftop: The geocode
                              point was matched to
                              the rooftop of a
                              building.

usageTypes   usageType   One or more of the            The best use for
                         following values:             the geocode
                            Display                  point.
                            Route                    Each geocode
                                                       point is defined
                                                       as a Route point,
                                                       a Display point or
                                                       both.
                                                       Use Route points
                                                       if you are creating
                                                       a route to the
                                                       location. Use
                                                       Display points if
                                                       you are showing
                                                       the location on a
                                                       map. For
                                                       example, if the
                                                       location is a park,
                                                       a Route point
                                                       may specify an
                                                       entrance to the
                                                                        63
JSON                         XML                   Type                   Description
                                                                          park where you
                                                                          can enter with a
                                                                          car, and a
                                                                          Display point may
                                                                          be a point that
                                                                          specifies the
                                                                          center of the
                                                                          park.


Examples


JSON Example
{

    "__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

    "bbox":[

         47.636705672917948,

         -122.137016420622,

         47.6444311080593,

         -122.1217297861384

    ],

    "name":"1 Microsoft Way, Redmond, WA 98052",

    "point":{

         "type":"Point",

         "coordinates":[

             47.640568390488625,

             -122.1293731033802

         ]

    },

    "address":{

         "addressLine":"1 Microsoft Way",

         "adminDistrict":"WA",

         "adminDistrict2":"King Co.",

         "countryRegion":"United States",

         "formattedAddress":"1 Microsoft Way, Redmond, WA 98052",


                                                                                        64
     "locality":"Redmond",

     "postalCode":"98052"

},

"confidence":"Medium",

"entityType":"Address",

"queryParseValues":[

     {

          "property":"AddressLine",

          "value":"1 Microsoft Way"

     },

     {

          "property":"Locality",

          "value":"Redmond"

     },

     {

          "property":"PostalCode",

          "value":"98052"

     },

     {

          "property":"AdminDistrict",

          "value":"WA"

     }

     ]

"geocodePoints":[

     {

         "type":"Point",

         "coordinates":[

              47.640568390488625,

              -122.1293731033802

         ],

         "calculationMethod":"Interpolation",

         "usageTypes":[

              "Display",

              "Route"

                                                65
            ]

            "matchCodes":[

                "Good"

            ]

        }

    ]

}

XML Example
<Location>

    <Name>1 Microsoft Way, Redmond, WA 98052</Name>

    <Point>

     <Latitude>47.640568390488625</Latitude>

     <Longitude>-122.1293731033802</Longitude>

    </Point>

    <BoundingBox>

     <SouthLatitude>47.636705672917948</SouthLatitude>

     <WestLongitude>-122.137016420622</WestLongitude>

     <NorthLatitude>47.6444311080593</NorthLatitude>

     <EastLongitude>-122.1217297861384</EastLongitude>

    </BoundingBox>

    <EntityType>Address</EntityType>

    <Address>

     <AddressLine>1 Microsoft Way</AddressLine>

     <AdminDistrict>WA</AdminDistrict>

     <AdminDistrict2>King Co.</AdminDistrict2>

     <CountryRegion>United States</CountryRegion>

     <FormattedAddress>1 Microsoft Way, Redmond, WA 98052</FormattedAddress>

     <Locality>Redmond</Locality>

     <PostalCode>98052</PostalCode>

    </Address>

    <Confidence>Medium</Confidence>

    <MatchCode>Good</<MatchCode>

    <QueryParseValue Property="AddressLine" Value="1 Microsoft Way" />

    <QueryParseValue Property="Locality" Value="Redmond" />

                                                                               66
  <QueryParseValue Property="PostalCode" Value="98052" />

  <QueryParseValue Property="AdminDistrict" Value="WA" />

  <GeocodePoint>

    <Latitude>47.640568390488625</Latitude>

    <Longitude>-122.1293731033802</Longitude>

    <CalculationMethod>Interpolation</CalculationMethod>

    <UsageType>Display</UsageType>

    <UsageType>Route</UsageType>

  </GeocodePoint>

</Location>



Imagery API
Use the Imagery API to get static maps and Bing™ Maps imagery information.


   On July 6, 2011, the new enhanced road style that is already in use on
   http://www.bing.com/maps/ became the default and only road map style for Road,
   Birdseye with Labels and Aerial with Labels imagery sets.


In this section

Get a Static Map                                Use these URL templates to get a static map.
                                                You can also display a route on a static map.

Get Imagery Metadata                            Use these URL templates to get metadata for
                                                imagery that is hosted by Bing™ Maps, such as
                                                imagery tiles.

Imagery Metadata Data                           Use this description to understand the results
                                                returned in a response that contains imagery
                                                metadata.

Static Map Data                                 Use this description to understand the results
                                                returned in a response that contains static map
                                                metadata.



See Also
Show Bing Results on a Map
Displaying Location Search Results Using the REST Services


                                                                                                 67
Get a Static Map
Use the following URL templates to get a static map. You can also display a route on a static
map, and you can request static map metadata. Static map metadata includes the absolute
(latitude and longitude) and relative (with respect to the map) coordinates and size of pushpins as
well as the map area and center point.


    On July 6, 2011, the new enhanced road style that is already in use on
    http://www.bing.com/maps/ became the default and only road map style for Road,
    Birdseye with Labels and Aerial with Labels imagery sets.

URL Templates
The default map size is 350 pixels by 350 pixels.


    These templates support both HTTP and HTTPS protocols.
Static map metadata: To get the size and center point of the image and the locations and size of
the pushpins on the map, set the mapMetadata parameter to 1 (true). When you request static
map metadata, the metadata is returned instead of the map image.
Get a map that is centered at a specified point.
When you specify a center point, you must also specify a zoom level.
http://dev.virtualearth.net/REST/v1/Imagery/Map/imagerySet/centerPoint/zoomLevel?mapSize=
mapSize&pushpin=pushpin&mapLayer=mapLayer&format=format&mapMetadata=mapMetadata&key=BingM
apsKey

Get a map that shows a specified map area.
http://dev.virtualearth.net/REST/v1/Imagery/Map/imagerySet?mapArea=mapArea&mapSize=mapSiz
e&pushpin=pushpin&mapLayer=mapLayer&format=format&mapMetadata=mapMetadata&key=BingMapsKey



Get a map with pushpins that does not specify a center point or map area.
If you do not specify a center point or map area, the map area is chosen to optimize the display of
the pusphins.
http://dev.virtualearth.net/REST/v1/Imagery/Map/imagerySet?pushpin=pushpin_1&pushpin=push
pin_2&pushpin=pushpin_n&mapLayer=mapLayer&format=format&mapMetadata=mapMetadata&key=BingM
apsKey

Get a map that is centered at the specified point and that displays a route.
You can display a route on a map by specifying a set of waypoints.
http://dev.virtualearth.net/REST/v1/Imagery/Map/imagerySet/centerPoint/zoomLevel/Routes/t
ravelMode?waypoint.1=routeWaypoint1&waypoint.2=routeWaypoint2&waypoint.n=routeWaypointn&m
apSize=mapSize&avoid=avoidOptions&pushpin=pushpin&timeType=timetType&dateTime=dateTime&ma



                                                                                                68
xSolutions=maxSolutions&distanceBeforeFirstTurn=distanceBeforeFirstTurn&mapLayer=mapLayer
&format=format&mapMetadata=mapMetadata&key=BingMapsKey

Get a map that displays a route without specifying a center point. You can choose to
specify the map area or you can accept the default.
You can display a route on a map by specifying a set of waypoints. When a map area or a center
point and a zoom level are not specified, a map area is chosen to optimize the display of the
route.
http://dev.virtualearth.net/REST/v1/Imagery/Map/imagerySet/Routes/travelMode?waypoint.1=r
outeWaypoint1&waypoint.2=routeWaypoint2&waypoint.n=routeWaypointn&mapArea=mapArea&avoid=a
voidOptions&pushpin=pushpin&timeType=timeType&dateTime=dateTime&maxSolutions=maxSolutions
&distanceBeforeFirstTurn=distanceBeforeFirstTurn&mapLayer=mapLayer&format=format&mapMetad
ata=mapMetadata&key=BingMapsKey



Get a map that is based on a query.
http://dev.virtualearth.net/REST/v1/Imagery/Map/imagerySet/query?mapSize=mapSize&mapLayer
=mapLayer&format=format&mapMetadata=mapMetadata&key=BingMapsKey



Pushpin limits: If you use HTTP GET method with the following URL templates, you can specify
up to 18 pushpins in the URL. If you want to specify more than 18 pushpins, use the HTTP POST
method and specify up to 100 pushpins in the body of the HTTP POST request. If you use the
HTTP POST method, all pushpins must be in the body of the request and not in the URL, and you
must set the Content-Type to “text/plain” and the charset to “UTF-8” in the HTTP header. For a
sample request, see the Examples section.
Template Parameters


     See the Common Parameters and Types section for additional common parameters to
     use with these URLs.
     Common parameters include:
   Output Parameters: Includes response output types and the JSON callback parameters.
   Culture Parameter: Includes a list of the supported cultures.
   User Context Parameters: Includes parameters that set user location and viewport values to
     help determine locations. For example, these values may help prioritize a set of possible
     locations when you get a map based on a location query.
     Parameter values are not case-sensitive.
     When an alias is provided, you can use the alias to shorten the length of the query
     parameter. For example, pushpin=47.610,-122.107 can be shortened to pp=47.610,-
     122.107.
Map Parameters


                                                                                              69
Parameter       Alias   Description                    Values

centerPoint             Required. A point on the       A Point value (latitude and
                        Earth where the map is         longitude). For more
                        centered.                      information about Point
                                                       values, see Location and
                                                       Area Types.
                                                       Example:
                                                       centerPoint=47.610,-
                                                       122.107

declutterPins   dcl     Optional. Specifies            One of the following values:
                        whether to change the             1: Declutter pusphpin
                        display of overlapping              icons.
                        pushpins so that they             0 [default]: Do not
                        display separately on a             declutter pushpin icons.
                        map.
                                                       Examples:
                                                       declutter=1
                                                       dcl =1

format          fmt     Optional. The image            One of the following image
                        format to use for the static   format values:
                        map.                           1. gif: Use GIF image
                                                          format.
                                                       2. jpeg: Use JPEG image
                                                          format. JPEG format is
                                                          the default for Road,
                                                          Aerial and
                                                          AerialWithLabels
                                                          imagery.
                                                       3. png: Use PNG image
                                                          format. PNG is the
                                                          default format for
                                                          CollinsBart and
                                                          OrdnanceSurvey
                                                          imagery.
                                                       Examples:
                                                       format=jpeg
                                                       fmt=gif

imagerySet              Required. The type of          One of the following values:
                        imagery.                          Aerial – Aerial imagery.
                                                          AerialWithLabels –


                                                                                    70
Parameter      Alias   Description                  Values
                                                         Aerial imagery with a
                                                         road overlay.
                                                       Road – Roads without
                                                         additional imagery.
                                                       OrdnanceSurvey --
                                                         Ordnance Survey
                                                         imagery.
                                                       CollinsBart – Collins
                                                         Bart imagery.

mapArea        ma      Required when a center       A rectangular area specified
                       point or set of route        as a bounding box. For
                       points are not specified.    more information, see
                       The geographic area to       Location and Area Types.
                       display on the map.          Example: 45.219,-
                                                    122.325,47.610,-122.107

mapLayer       ml      Optional. A display layer    The only value for this
                       that renders on top of the   parameter is TrafficFlow.
                       imagery set.                 Example:
                                                    mapLayer=TrafficFlow

mapSize        ms      Optional. The width and      A string that contains a
                       height in pixels of the      width and a height
                       static map output.           separated by a comma. The
                                                    width must be between 80
                                                    and 900 pixels and the
                                                    height must be between 80
                                                    and 834 pixels. The default
                                                    map size for static maps is
                                                    350 pixels by 350 pixels.
                                                    Example:
                                                    mapSize=100,600

mapVersion     mv
[deprecated]               This parameter is             This parameter is
                           deprecated. On                deprecated. The
                           July 6, 2011, the             value "v1" was
                           new enhanced                  previously used to
                           road style became             opt-in to road
                           the default and               imagery that is now
                           only road map                 the default.
                           style for Road,

                                                                                 71
Parameter     Alias   Description                 Values
                         Birdseye with            One of the following values:
                         Labels and Aerial           v0 [default]: The new
                         with Labels                   enhanced road map
                         imagery sets.                 style used.
                      Optional. Specifies            v1: The new enhanced
                      whether to use the new           road map style is used.
                      “road” map style to create
                      the map. The new “road”
                      map style is designed for
                      improved readability and
                      improved interaction
                      between imagery with data
                      overlays.

pushpin       pp      Optional. One or more       A series of values that
                      pushpin locations to        include a Point value
                      display on the map.         (latitude and longitude) with
                                                  options to add a label of up
                                                  to three (3) characters and
                                                  to specify an icon style. For
                                                  more information about
                                                  specifying pushpins, see
                                                  Pushpin Syntax and Icon
                                                  Styles. You can specify up
                                                  to 18 pushpins within a URL
                                                  and 100 if you use the
                                                  HTTP POST method and
                                                  specify the pushpins in the
                                                  body of the request. See
                                                  the Examples section for
                                                  examples.
                                                  Example: pushpin=47.610,-
                                                  122.107;5;P10

mapMetadata   mmd     Optional. Specifies         One of the following values:
                      whether to return              1: Return metadata for
                      metadata for the static          the specific image. An
                      map instead of the image.        image is not returned.
                      The static map metadata        0: Do not return
                      includes the size of the         metadata. [default]
                      static map and the               When you request
                      placement and size of the        metadata, the response

                                                                               72
Parameter          Alias   Description                 Values
                           pushpins on the static          returns metadata for the
                           map.                            map instead of the map
                                                           image. For more
                                                           information about the
                                                           static map metadata,
                                                           see Static Map Data.
                                                           Example: mmd=1

query                      Required. A query string    A string that contains query
                           that is used to determine   terms for the location of the
                           the map location to         static map.
                           display.                    Example:
                                                       Seattle%20Center

zoomLevel                  Required. The level of      An integer between 1 and
                           zoom to display.            21.


                                                           Some imagery may
                                                           not be available at
                                                           all zoom levels for
                                                           all locations. If
                                                           imagery is not
                                                           available at a
                                                           location, a message
                                                           is returned in the
                                                           ErrorDetails
                                                           collection that is
                                                           part of the common
                                                           response fields.
                                                           See Common
                                                           Response
                                                           Description for a list
                                                           of common
                                                           response fields.
                                                       Example: 10




Route Parameters


                                                                                    73
Parameter               Alias   Descriptio      Values
                                n

avoid                           Optional.       A comma-separated list of values that limit the
                                Specifies       use of highways and toll roads in the route. In
                                the road        the definitions below, “highway” also refers to a
                                types to        “limited-access highway”.
                                minimize        If no values are specified, highways and tolls are
                                or avoid        allowed in the route.
                                when the
                                                   highways: Avoids the use of highways in the
                                route is             route.
                                created
                                                   tolls: Avoids the use of toll roads in the route.
                                for the
                                                   minimizeHighways: Minimizes (tries to avoid)
                                driving
                                                     the use of highways in the route.
                                travel
                                mode.              minimizeTolls: Minimizes (tries to avoid) the
                                                     use of toll roads in the route.


                                                     If you specify more than one option for a
                                                     road type, then the most restrictive
                                                     option is used. For example, if you set
                                                     the avoid parameter to both highways
                                                     and minimizeHighways, the highways
                                                     option is used and all highways are
                                                     avoided.
                                                Examples:
                                                avoid=highways
                                                avoid=highways,tolls

distanceBeforeFirstTu   dbft    Optional.       An integer distance specified in meters. Use this
rn                              Specifies       parameter to make sure that the moving vehicle
                                the             has enough distance to make the first turn.
                                distance        Examples:
                                before the
                                                distanceBeforeFirstTurn=500
                                first turn is
                                                dbft=500
                                allowed in
                                the route.
                                This
                                option
                                only
                                applies to
                                the driving
                                travel

                                                                                                   74
Parameter      Alias     Descriptio   Values
                         n
                         mode.

dateTime       dt        Required     A string that contains the date and time
                         when the     formatted as a DateTime value. For information
                         travel       about the string representation options for
                         mode is      DateTime values, see DateTime.Parse Method
                         Transit.     (String).
                         The          Examples:
                         timeType
                                         dateTime=03/01/2011 05:42:00
                         parameter
                                         dateTime=05:42:00 [assumes the current
                         identifies
                                           day]
                         the
                                         dateTime=03/01/2011 [assumes the current
                         desired
                                           time]
                         transit
                         time, such
                         as arrival
                         time or
                         departure
                         time. The
                         transit
                         time type
                         is
                         specified
                         by the
                         timeType
                         parameter
                         .

maxSolutions   maxSoln   Optional.    A string that contains an integer value. The
               s         Specifies    default value is 1.
                         the          Example: maxSolns=3
                         maximum
                         number of
                         transit           This parameter is only supported for the
                         routes to         Transit travel mode.
                         return.

optimize       optmz     Optional. One of the following values:
                         Specifies    distance: The route is calculated to minimize
                         what           the distance. Traffic information is not used.
                         parameter  time [default]: The route is calculated to
                         s to use to    minimize the time. Traffic information is not

                                                                                      75
Parameter    Alias   Descriptio    Values
                     n
                     optimize           used.
                     the route        timeWithTraffic: The route is calculated to
                     on the             minimize the time and uses current traffic
                     map.               information.
                                   Example: optimize=time

timeType     tt      Required      One of the following values:
                     when the         Arrival: The dateTime parameter contains
                     travel             the desired arrival time for a transit request.
                     mode is          Departure: The dateTime parameter
                     Transit.           contains the desired departure time for a
                     Specifies          transit request.
                     how to           LastAvailable: The dateTime parameter
                     interpret          contains the latest departure time available
                     the date           for a transit request.
                     and transit
                     time value
                     that is
                     specified
                     by the
                     dateTime
                     parameter
                     .

travelMode           Optional.     One of the following values:
                     The mode         Driving [default]
                     of travel        Walking
                     for the
                                      Transit
                     route.

waypoint.n   wp.n    Required.     A waypoint location can be specified as a Point,
                     Specifies     a landmark, or an address. For more information
                     two or        about Point values, see Location and Area
                     more          Types.
                     locations     The index (n value) for the set of waypoints in an
                     that define   integer starting with 0 or 1. The waypoint index
                     the route     values must be sequential and must always
                     and that      increment by 1.
                     are in
                                   You can have a maximum of 25 waypoints.
                     sequential
                                   Examples:
                     order.
                                   waypoint.1=47.610,-122.107 [Point]

                                                                                      76
Parameter                Alias      Descriptio   Values
                                    n
                                                 wp.1=Seattle,WA [landmark]
                                                 waypoint.1=1 Microsoft%20Way%20Redmond
                                                 WA [address]
                                                 Incorrect set of waypoints. The following set of
                                                 values is not valid because there is no
                                                 waypoint.2.
                                                 &waypoint.1=San%20Francisco&waypoint.3=Se
                                                 attle


Response
Static images are returned in one of the following formats. You can specify the image format by
setting the format parameter. Default image formats and the corresponding content-type values
returned in the response (such as image/png) are defined below.
   PNG (image/png): Default image format for Collins Bart and Ordnance Survey imagery.
   JPEG (image/jpeg): Default image format for road, aerial and aerial-with-labels imagery.
   GIF (image/gif)
These URLs support JSON (application/json) and XML (application/xml) response formats. A
JSON response is provided by default unless you request XML output by setting the output (o)
parameter. For more information, see Output Parameters.

Examples
Get a map with Road imagery and traffic flow based on a query.
This example gets a map with road imagery based on a query result for the Space Needle in
Seattle, Washington. Traffic flow is also included on the map.
http://dev.virtualearth.net/REST/V1/Imagery/Map/Road/space%20needle%20seattle?mapLayer=Tr
afficFlow&key=BingMapsKey




This example returns the following image.




                                                                                                  77
Get a map with Aerial imagery based on a query.
This example gets a map with aerial imagery and labels based on a query result for the Eiffel
Tower in Paris. The map has a width of 800 pixels and height of 600 pixels.
http://dev.virtualearth.net/REST/v1/Imagery/Map/AerialWithLabels/eiffel%20tower?mapSize=8
00,600&key=BingMapsKey




This example returns the following image.




                                                                                                78
Get a map with Road imagery and pushpins that is centered at a specified point.
This example creates a map with road imagery and places pushpins on the Space Needle, the
Pacific Science Center, and the Olympic Sculpture Park in Seattle. The centerPoint of the map is
set to 47.619048 degrees latitude and -122.35384 degrees longitude. The zoomLevel is set to 15.
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/47.619048,-
122.35384/15?mapSize=500,500&pp=47.620495,-122.34931;21;AA&pp=47.619385,-
122.351485;;AB&pp=47.616295,-122.3556;22&key=BingMapsKey




This example returns the following image.




                                                                                             79
Get the static map metadata for a map with Road imagery and pushpins that is centered at
a specified point.
This example specifies the same map parameters as the previous example and adds the
mapMetadata parameter to get the map metadata. Map metadata includes the map size, area
and center point and the position and size of the pushpins. To see the XML and JSON responses
for this request and for descriptions of the metadata information, see Static Map Data.
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/47.619048,-
122.35384/15?mapSize=500,500&pp=47.620495,-122.34931;21;AA&pp=47.619385,-
122.351485;;AB&pp=47.616295,-122.3556;22&mapMetadata=1&o=xml&key=BingMapsKey



                                                                                           80
Get a map with Road imagery and declutter overlapping pushpins.
This example creates a map with road imagery and specifies two pushpins that are located very
close together. The declutterPins (dcl) parameter is set so that the pushpins both appear
separately. If the declutterPins parameter were not set, the pushpins would overlap. Maps for
both cases are shown below.
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/47.6156352,-
122.2043549/12?pp=47.6156352,-122.2043549;;1&pp=47.612441,-
122.204533;;2&dcl=1&key=BingMapsKey




This example returns the following image.




If the declutter parameter was not set in this example, the pushpins would overlap as shown in
the following image.




                                                                                                 81
Get a map with Aerial imagery and pushpins without specifying a map area or center point.
The map is optimized to fit the pushpins.
This example creates a map with aerial imagery with labels and specifies 5 pushpins. Because a
map area or center point is not specified, a map area is chosen that best shows all of the
pushpins.
http://dev.virtualearth.net/REST/v1/Imagery/Map/AerialWithLabels?pp=40.804000,-
74.464460;;1&pp=40.815180,-74.219250;;2&pp=40.881210,-74.168020;;3&pp=40.810830,-
74.260250;;4&pp=40.851800,-74.299900;;5&key=BingMapsKey




This example returns the following image.




                                                                                             82
Get a map with Road imagery for a specified map area.
This example gets a map of the specified area that shows road imagery with traffic flow. The map
shows the San Francisco metropolitan area and pushpins identify the location of Stanford
University and the University of California at Berkeley.
http://dev.virtualearth.net/REST/V1/Imagery/Map/road?mapArea=37.317227,-
122.318439,37.939081,-122.194565&ms=500,600&pp=37.869505,-122.2705;35;BK&pp=37.428175,-
122.169680;;ST&ml=TrafficFlow&key=BingMapsKey




This example returns the following image.




                                                                                              83
Get a map with Road imagery that displays a route.
This example gets a map with road imagery that displays a driving route between the cities of
Seattle and Redmond in Washington State.



                                                                                                84
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?wp.0=Seattle,WA&wp.1=Redmond
WA&key=BingMapsKey




This example returns the following image.




Get a map with Road imagery centered at a point with a specified zoom level.
This example uses a center point and zoom level to get a map that shows the end of the route
between Seattle and Redmond from the previous example. The center point is the latitude and
longitude coordinates of Redmond. You can use the Find a Location by Address API to get the
latitude and longitude coordinates of a location.
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/47.678559869527817,-
122.13099449872971/14/Routes?wp.0=Seattle,WA&wp.1=Redmond,WA&key=BingMapsKey




This example returns the following image.



                                                                                               85
Get maps with Road imagery that displays a transit route and zoomed views of the start
and end points.
The following examples show how to get a map with road imagery that displays a transit route
from the Space Needle in Seattle, Washington to Bellevue Downtown Park in Bellevue,
Washington at 3 PM of the current day. The three URL examples display the entire route and
zoomed views of the start and end points of the route. Note that the walking segments of the
route are displayed as dotted lines.
View of the complete transit route.
http://dev.virtualearth.net/REST/V1/Imagery/Map/Road/Routes/Transit?wp.0=Space%20Needle&w
p.1= Bellevue%20Downtown%20Park&timeType=Departure&dateTime=3:00:00
PM&output=xml&key=BingMapsKey




                                                                                               86
View the start of the transit route by specifying a center point and zoom level. The center point for
this map is the coordinates for the Space Needle that are returned in the response when you
request a transit route by using the Calculate a Route API. This map includes a walking route that
is shown by a dotted line.
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/47.620495,-
122.34931/15/Routes/Transit?timeType=Departure&dateTime=3:00:00PM&wp.0=Space%20Needle&wp.
1= Bellevue%20Downtown%20Park &key=BingMapsKey




                                                                                                  87
View the end of the transit route by specifying a center point and zoom level. The center point for
this map is the coordinates of the Bellevue Downtown Park in that is returned in the response
when you request a transit route by using the Calculate a Route API. This map includes a walking
route that is shown by a dotted line.
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/47.615635,-
122.20435/15/Routes/Transit?timeType=Departure&dateTime=3:00:00PM&wp.0=Space%20Needle&wp.
1=Bellevue%20Downtown%20Park&key=BingMapsKey




                                                                                                88
Get a map that displays pushpins by using the HTTP POST Method
The following example shows how to request a static map by using the HTTP POST method.
When you use this method, you can specify up to 100 pushpins. All pushpins must be in the body
of the request. Because the request does not specify a map area or center point and zoom level,
the map area is optimized to show all of the pushpins.
HTTP POST URL
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/?key=BingMapsKey

HTTP POST Header
You must include the following settings in the HTTP POST Header.
Content-Length: insertLengthOfHTTPBody

Content-Type: text/plain; charset=utf-8

HTTP POST Body
When specifying pushpins in the request body, you can use a carriage return (\r\n) or an
ampersand (&) as a delimiter. The following two examples show these options.
Example 1
pp=38.889586530732335,-77.05010175704956;23;LM\r\n

                                                                                             89
pp=38.88772364638439,-77.0472639799118;7;KM\r\n

pp=38.890479451480054,-77.04744637012482;1;VM\r\n

pp=38.8896854931628,-77.03519403934479;45;WM



Example 2
pp=38.889586530732335,-77.05010175704956;23;LM&pp=38.88772364638439,-
77.0472639799118;7;KM\r\n

pp=38.890479451480054,-77.04744637012482;1;VM&pp=38.8896854931628,-
77.03519403934479;45;WM




This example returns the following image.




Get a map with Ordnance Survey imagery that is provided in JPEG format.



                                                                          90
This example shows a map of Trafalgar Square in Great Britain using Ordnance Survey imagery.
The static map is returned in JPEG format. If this image format were not specified in the URL, the
static map would be returned in the default PNG format.
http://dev.virtualearth.net/REST/v1/Imagery/Map/OrdnanceSurvey/51.506666,-
0.129436/15?format=jpeg&key=BingMapsKey




This example returns the following image.




Get a map that shows Collins Bart imagery.
This example shows a map of Trafalgar Square in Great Britain using Collins Bart imagery.
http://dev.virtualearth.net/REST/v1/Imagery/Map/CollinsBart/51.506666,-
0.129436/15?key=BingMapsKey

This example returns the following image.




                                                                                                91
HTTP Status Codes


     For more details about these HTTP status codes, see Status Codes and Errors.
When the request is successful, the following HTTP status code is returned.
   200
When the request is not successful, the response returns one of the following errors.
   400
   401
   404
   500
   503


Get Imagery Metadata
Use the following URL templates to get metadata for imagery that is hosted by Bing™ Maps. The
imagery metadata returned includes URLs and dimensions for imagery tiles, ranges of zoom
levels, and imagery vintage information.
Uses of this metadata include the following:
   Determine the vintage of the imagery at a location.
   Determine the availability of imagery at a location at a specified zoom level.
   Determine the availability of different types of imagery at a location.
   Build custom maps by stitching together imagery tiles.


                                                                                           92
     On July 6, 2011, the new enhanced road style that is already in use on
     http://www.bing.com/maps became the default and only road map style for Road,
     Birdseye with Labels and Aerial with Labels imagery sets.

URL Templates


     These templates support both HTTP and HTTPS protocols.
There are two types of imagery metadata URLs:
   Complete Metadata URLs: Get imagery information that includes a map tile.
   Basic Metadata URL: Get imagery information that does not include a map tile.
Complete Metadata URLs
Get the metadata for an imagery set.


     This template is not applicable for Birdseye imagery because Birdseye imagery requires
     a location.
http://dev.virtualearth.net/REST/v1/Imagery/Metadata/imagerySet?key=BingMapsKey

Get the metadata for an imagery set at a specific location.
http://dev.virtualearth.net/REST/v1/Imagery/Metadata/imagerySet/centerPoint?orientation=o
rientation&zoomLevel=zoomLevel&include=ImageryProviders&key=BingMapsKey

Basic Metadata URL


     This URL returns all imagery metadata except for the map tile URL.
Get only the basic metadata for an imagery set at a specific location. This URL does not
return a map tile URL.
http://dev.virtualearth.net/REST/v1/Imagery/BasicMetadata/imagerySet/centerPoint?orientat
ion=orientation&zoomLevel=zoomLevel&include=ImageryProviders&key=BingMapsKey

Template Parameters


     See the Common Parameters and Types section for additional common parameters to
     use with these URLs.
     Common parameters include:
   Output Parameters: Includes response output types and the JSON callback parameters.
   Culture Parameter: Includes a list of the supported cultures.
     When an alias is provided, you can use the alias to shorten the length of the query
     parameter. For example, zoomLevel=10 can be shortened to zl=10.


                                                                                              93
   Parameter values are not case-sensitive.


Parameters          Alias          Description                 Values

imagerySet                         Required. The type of       Aerial - Aerial imagery.
                                   imagery for which you are   AerialWithLabels - Aerial
                                   requesting metadata.        imagery with a road overlay.
                                                               Birdseye - Bird’s eye (oblique-
                                                               angle) imagery
                                                               BirdseyeWithLabels - Bird’s
                                                               eye imagery with a road
                                                               overlay.
                                                               Road - Roads without
                                                               additional imagery.
                                                               Example:
                                                               imagerySet=Birdseye

centerPoint                        Required when               A point on the earth specified
                                   imagerySet is Birdseye      by latitude and longitude
                                   or BirdseyeWithLabels.      coordinates. For more
                                   Optional for other          information about point
                                   imagery sets. The center    values, see Location and Area
                                   point to use for the        Types.
                                   imagery metadata.           Example: 47.610,-122.107

include             incl           Optional. Specifies to      The only option for this
                                   provide additional          parameter is
                                   information about the       ImageryProviders. When this
                                   imagery as part of the      parameter value is specified,
                                   response.                   information about the imagery
                                                               providers is returned in the
                                                               response.
                                                               Example:
                                                               include=ImageryProviders

mapVersion          mv
[deprecated]                           This parameter is           This parameter is
                                       deprecated. On              deprecated. The
                                       July 6, 2011, the           value "v1" previously
                                       new enhanced                was used to opt-in to
                                       road style became           road imagery that is
                                       the default and             now the default.
                                       only road map           One of the following values:

                                                                                              94
Parameters    Alias   Description                   Values
                          style for Road,              v0 [default]: The new
                          Birdseye with                  enhanced road map style
                          Labels and Aerial              used.
                          with Labels                  v1: The new enhanced
                          imagery sets.                  road map style is used.
                      Optional. Specifies
                      whether to use the new
                      “road” map style to create
                      the map. The new “road”
                      map style is designed for
                      improved readability and
                      improved interaction
                      between imagery with data
                      overlays.

orientation   dir     Optional. The orientation     A double value between 0 to
                      of the viewport to use for    360, where 0 = North
                      the imagery metadata.         [default], 90 = East, 180 =
                      This option only applies to   South, 270 = West.
                      Birdseye imagery.             Example: orientation=253.21

zoomLevel     zl      Required if a centerPoint An integer between 1 and 21.
                      is specified and
                      imagerySet is set to
                      Road, Aerial or               Some imagery may
                      AerialWithLabels The          not be available at all
                      level of zoom to use for the  zoom levels for all
                      imagery metadata.             locations. If imagery is
                                                    not available at a
                                                    location, a message is
                                                    returned in the
                                                         ErrorDetails
                                                         collection of the
                                                         response. For more
                                                         information about this
                                                         collection, see
                                                         Common Response
                                                         Description.
                                                    Example: zoomLevel=10




                                                                                   95
Response
When metadata for Birdseye or BirdseyeWithLabels imagery is requested, a BirdseyeMetadata
resource is returned in the response. For other imagery types, an ImageryMetadata resource is
returned. The ImageryMetadata resource may contain a map tile URL. For more information
about the map tile URL and other metadata returned, see Imagery Metadata Data. For more
information about the common response syntax for the Bing Maps REST Services, see Common
Response Description. JSON and XML responses are provided for the URL examples in the
following section.
These URLs support JSON (application/json) and XML (application/xml) response formats. A
JSON response is provided by default unless you request XML output by setting the output (o)
parameter. For more information, see Output Parameters.

Examples
Get Aerial imagery metadata at street level.
This example returns metadata for aerial imagery metadata at street level in New York City. Note
that a center point and a zoom level are both specified. If only one of these values were specified,
this URL would return an error. The response is requested in XML format.
http://dev.virtualearth.net/REST/V1/Imagery/Metadata/Aerial/40.714550167322159,-
74.007124900817871?zl=15&o=xml&key=BingMapsKey

 BasicMetadata option: If you requested basic metadata only instead of the complete metadata
by using the corresponding basic metadata URL template, the ImageUrl field would not be
included. The rest of the response is the same.
XML Response
This example returns the following XML response. For more information about the response fields
including the image URL (map tile URL), see Common Response Description and Imagery
Metadata Data.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

  <Copyright>Copyright © 2010 Microsoft and its suppliers. All rights reserved. This API
cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.</Copyright>

  <BrandLogoUri>http://dev.virtualearth.net/Branding/logo_powered_by.png</BrandLogoUri>

  <StatusCode>200</StatusCode>

  <StatusDescription>OK</StatusDescription>

  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

  <TraceId>1a0d6dd60ea94171b8444a9e6e4555ca</TraceId>

    <ResourceSets>


                                                                                                 96
       <ResourceSet>

       <EstimatedTotal>1</EstimatedTotal>

           <Resources>

            <ImageryMetadata>



<ImageUrl>http://ecn.t3.tiles.virtualearth.net/tiles/a032010110123333.jpeg?g=471&mkt={cul
ture}}</ImageUrl>

            <ImageWidth>256</ImageWidth>

            <ImageHeight>256</ImageHeight>

            <ZoomMin>15</ZoomMin>

            <ZoomMax>15</ZoomMax>

            <VintageStart>2006-09-01</VintageStart>

            <VintageEnd>2006-12-31</VintageEnd>

           </ImageryMetadata>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>

JSON Response
The following JSON response contains the same information as the XML response and is
provided when the output (o) parameter is not set.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2010 Microsoft and its suppliers. All rights reserved. This A
PI cannot be accessed and the content and any results may not be used, reproduced or tran
smitted in any manner without express written permission from Microsoft Corporation.",

    "resourceSets":[

       {

           "estimatedTotal":1,

           "resources":[

              {

                  "__type":"ImageryMetadata:http:\/\/schemas.microsoft.com\/search\/local\/w
s\/rest\/v1",

                  "imageHeight":256,


                                                                                          97
                     "imageUrl":"http:\/\/ecn.t3.tiles.virtualearth.net/tiles/a032010110123333.
jpeg?g=471&mkt={culture}}",

                     "imageUrlSubdomains":null,

                     "imageWidth":256,

                     "imageryProviders":null,

                     "vintageEnd":"31 Jan 2006 GMT",

                     "vintageStart":"01 Jan 2006 GMT",

                     "zoomMax":15,

                     "zoomMin":15

                 }

             ]

         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"dfd1a6a2c33f414abf9f41d84ed02404"

}

Get Road imagery metadata.
This example gets metadata for road imagery. The response is requested in XML format.
http://dev.virtualearth.net/REST/V1/Imagery/Metadata/Road?&output=xml&key=BingMapsKey

 BasicMetadata option: If you requested basic metadata only instead of the complete metadata
by using the corresponding basic metadata URL template, the ImageUrl field would not be
included. The rest of the response is the same.
XML Response
This example returns the following XML response. For more information about the response and
resource fields including the image URL (map tile URL), see Common Response Description and
Imagery Metadata Data.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

    <Copyright>Copyright © 2010 Microsoft and its suppliers. All rights reserved. This API
cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.</Copyright>

    <BrandLogoUri>http://dev.virtualearth.net/Branding/logo_powered_by.png</BrandLogoUri>

    <StatusCode>200</StatusCode>


                                                                                             98
    <StatusDescription>OK</StatusDescription>

    <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

    <TraceId>648b2fb028574e159a999015b3a83b87</TraceId>

    <ResourceSets>

     <ResourceSet>

       <EstimatedTotal>1</EstimatedTotal>

       <Resources>

         <ImageryMetadata>



<ImageUrl>http://ecn.{subdomain}.tiles.virtualearth.net/tiles/r{quadkey}.jpeg?g=129&mkt={
culture}&shading=hill&stl=H</ImageUrl>

           <ImageUrlSubdomains>

              <string>t0</string>

              <string>t1</string>

              <string>t2</string>

              <string>t3</string>

           </ImageUrlSubdomains>

           <ImageWidth>256</ImageWidth>

           <ImageHeight>256</ImageHeight>

           <ZoomMin>1</ZoomMin>

           <ZoomMax>21</ZoomMax>

         </ImageryMetadata>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>

JSON Response
The following JSON response contains the same information as the XML response and is
provided when the output (o) parameter is not set.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2010 Microsoft and its suppliers. All rights reserved. This A
PI cannot be accessed and the content and any results may not be used, reproduced or tran
smitted in any manner without express written permission from Microsoft Corporation.",

                                                                                         99
    "resourceSets":[

         {

             "estimatedTotal":1,

             "resources":[

                 {

                     "__type":"ImageryMetadata:http:\/\/schemas.microsoft.com\/search\/local\/w
s\/rest\/v1",

                     "imageHeight":256,



"imageUrl":"http:\/\/ecn.{subdomain}.tiles.virtualearth.net/tiles/r{quadkey}.jpeg?g=129&m
kt={culture}&shading=hill&stl=H"

                     "imageUrlSubdomains":[

                          "t0",

                          "t1",

                          "t2",

                          "t3"

                     ],

                     "imageWidth":256,

                     "imageryProviders":null,

                     "vintageEnd":null,

                     "vintageStart":null,

                     "zoomMax":19,

                     "zoomMin":1

                 }

             ]

         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"d709a168fde44fe496dcbfafd829185d"

}




                                                                                            100
Get Birdseye imagery metadata.
This example gets metadata for Birdseye imagery of San Francisco. The response is requested
in XML format.
http://dev.virtualearth.net/REST/V1/Imagery/Metadata/Birdseye/37.779160067439079,-
122.42004945874214?&o=xml&key=BingMapsKey

 BasicMetadata option: If you requested basic metadata only instead of the complete metadata
by using the corresponding basic metadata URL template, the ImageUrl field would not be
included. The rest of the response is the same.
XML Response
This example returns the following XML response. For more information about the response fields
including the image URL (map tile URL), see Common Response Description and Imagery
Metadata Data.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

  <Copyright>Copyright © 2010 Microsoft and its suppliers. All rights reserved. This API
cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.</Copyright>

  <BrandLogoUri>http://dev.virtualearth.net/Branding/logo_powered_by.png</BrandLogoUri>

  <StatusCode>200</StatusCode>

  <StatusDescription>OK</StatusDescription>

  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

  <TraceId>d565c0dda37d4b74b293f87bb07a843c</TraceId>

  <ResourceSets>

    <ResourceSet>

      <EstimatedTotal>1</EstimatedTotal>

      <Resources>

        <BirdseyeMetadata>

          <ImageUrl> http://ecn.{subdomain}.tiles.virtualearth.net/tiles/o02301020333-
10749-{zoom}-{tileId}.jpeg?g=129</ImageUrl>

          <ImageUrlSubdomains>

            <string>t0</string>

            <string>t1</string>

                                                                                           101
              <string>t2</string>

              <string>t3</string>

            </ImageUrlSubdomains>

            <ImageWidth>256</ImageWidth>

            <ImageHeight>256</ImageHeight>

            <ZoomMin>19</ZoomMin>

            <ZoomMax>20</ZoomMax>

            <Orientation>0</Orientation>

            <TilesX>16</TilesX>

            <TilesY>12</TilesY>

           </BirdseyeMetadata>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>



JSON Response
The following JSON response contains the same information as the XML response and is
provided when the output (o) parameter is not set.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2010 Microsoft and its suppliers. All rights reserved. This A
PI cannot be accessed and the content and any results may not be used, reproduced or tran
smitted in any manner without express written permission from Microsoft Corporation.",

    "resourceSets":[

       {

           "estimatedTotal":1,

           "resources":[

              {

                  "__type":"BirdseyeMetadata:http:\/\/schemas.microsoft.com\/search\/local\/
ws\/rest\/v1",

                  "imageHeight":256,

                  "imageUrl":"http:\/\/ecn.{subdomain}.tiles.virtualearth.net/tiles/o0230102
0333-10749-{zoom}-{tileId}.jpeg?g=129",

                                                                                         102
                     "imageUrlSubdomains":[

                          "t0",

                          "t1",

                          "t2",

                          "t3"

                     ],

                     "imageWidth":256,

                     "imageryProviders":null,

                     "vintageEnd":null,

                     "vintageStart":null,

                     "zoomMax":20,

                     "zoomMin":19,

                     "orientation":0,

                     "tilesX":16,

                     "tilesY":12

                 }

             ]

         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"79cdbd530cdc4bbfaee4c8f8d780d1e3"

}




Get Road imagery metadata and imagery provider information.
This example returns road imagery metadata and requests information about the imagery
providers. The response is returned in JSON format. You can specify to return the response in
XML format by setting the output parameter to xml.
http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Road?&incl=ImageryProviders&key=Bing
MapKey

Get Birdseye imagery metadata centered at a point.
This example returns Birdseye imagery metadata for imagery that is centered at the specified
point. The response is returned in JSON format. You can specify to return the response in XML
format by setting the output parameter to xml.
                                                                                                103
http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Birdseye/47.23,-
122.3?&key=BingMapsKey



Get BirdseyeWithLabels imagery metadata centered at a point and from a viewport angle
of 90 degrees.
The example gets Birdseye imagery metadata for imagery that includes labels and that has an
orientation angle of 90 degrees. The imagery is centered at the specified point. The response is
returned in JSON format. You can specify to return the response in XML format by setting the
output parameter to xml.
http://dev.virtualearth.net/REST/v1/Imagery/Metadata/BirdseyeWithLabels/47.23,-
122.3?&dir=90&key=BingMapsKey



Get Road imagery metadata centered at a point and for a specified zoom level.
This example returns road imagery metadata that is centered at the specified point with a zoom
level of 10. . The response is returned in JSON format. You can specify to return the response in
XML format by setting the output parameter to xml.
http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Road/47.23,-
122.3?zl=10?&key=BingMapsKey



Get Aerial imagery metadata centered at a point and for a specified zoom level.
This example returns metadata for aerial imagery that is centered at the specified point with a
zoom level of 10. The response is returned in JSON format. You can specify to return the
response in XML format by setting the output parameter to xml.
http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial/47.23,-
122.3?zl=10&&key=BingMapsKey

Get AerialWithLabels metadata centered at a point and for a specified zoom level.
This example returns metadata for aerial imagery with labels and that is centered at the specified
point with a zoom level of 10. The response is returned in JSON format. You can specify to return
the response in XML format by setting the output parameter to xml.
http://dev.virtualearth.net/REST/v1/Imagery/Metadata/AerialWithLabels/47.23,-
122.3?&zl=10&key=BingMapsKey




HTTP Status Codes


     For more details about these HTTP status codes, see Status Codes and Errors.
When the request is successful, the following HTTP status code is returned.
   200

                                                                                                  104
When the request is not successful, the response returns one of the following errors.
   400
   401
   500
   503

See Also
Bing Maps Tile System
Building Your Own Tile Server
Understanding Scale and Resolution


Imagery Metadata Data
The response returned by an Imagery Metadata URL request contains a resource that provides
imagery metadata information. If the metadata requested is for Birdseye imagery, a Birdseye
Metadata resource is returned. For other types of imagery, an Imagery Metadata resource is
returned. This topic contains descriptions of the information elements in these resources, followed
by JSON and XML examples.
For more information about the common response syntax for the Bing Maps REST Services, see
Common Response Description.

Common Imagery Resource Fields
The following fields are used in both the Imagery Metadata and the Birdseye Metadata resources.


JSON                       XML                        Type             Description

imageUrl                   ImageUrl                   URI              One of the following:
                                                                       A URL template for an
                                                                       image tile if a specific point
                                                                       is specified.
                                                                       A general URL template
                                                                       for the specified imagery
                                                                       set.


                                                                           For more
                                                                           information about
                                                                           the URI
                                                                           placeholder fields
                                                                           that may appear in
                                                                           the image tile, see
                                                                           Understanding
                                                                           the Image URL

                                                                                                 105
JSON                      XML                       Type             Description
                                                                         Placeholders
                                                                         section below.

imageUrlSubdomains        ImageUrlSubdomains        string           One or more URL
                                                                     subdomains that may be
                                                                     used when constructing an
                                                                     image tile URL.

imageWidth                ImageWidth                integer          The width of the image tile.

imageHeight               ImageHeight               integer          The height of the image
                                                                     tile.

vintageStart              VintageStart              DateTime         The earliest date found in
                                                                     an imagery set or for a
                                                                     specific imagery tile.

vintageEnd                VintageEnd                DateTime         The latest date found in an
                                                                     imagery set or for a
                                                                     specific imagery tile.

zoomMin                   ZoomMin                   integer          The minimum zoom level
                                                                     available for this imagery
                                                                     set.

zoomMax                   ZoomMax                   DateTime         The maximum zoom level
                                                                     available for this imagery
                                                                     set.


Birdseye Metadata Resource Fields
These fields are only used only by the Birdseye Metadata resource.


JSON                    XML                      Type                   Description

orientation             Orientation              double                 The orientation of the
                                                                        viewport for the
                                                                        imagery metadata in
                                                                        degrees where 0 =
                                                                        North [default], 90 =
                                                                        East, 180 = South, 270
                                                                        = West.

tilesX                  TilesX                   integer                The horizontal
                                                                        dimension of the
                                                                        imagery in number of

                                                                                             106
JSON                     XML                     Type                   Description
                                                                        tiles.

tilesY                   TilesY                  integer                The vertical dimension
                                                                        of the imagery in
                                                                        number of tiles.


Understanding the Image URL Placeholders
When you request imagery metadata, the image URL field returned in the response specifies a
map tile. This map tile can contain one or more of the following placeholders.


URI placeholder                                Description

{culture}                                      The culture of the map. The culture value
                                               determines the language that is used to display
                                               text. For a list of cultures that are supported by
                                               the Imagery API, see Culture Parameter.

{quadkey}                                      The quadkey of the tile. For information about
                                               quadkeys, see Bing Maps Tile System

{subdomain}                                    The sub-domain to use to retrieve tiles to allow
                                               maximum performance for network calls. The
                                               value values are t0, t1, t2, or t3.

{tileId}                                       The ID of the tile. For information about tile IDs,
                                               see, Understanding Tiles.

{zoom}                                         The zoom level of the map.


Examples
The following examples show the resources returned by the Imagery Metadata API.
Imagery Metadata Resource Example
JSON Example
{

    "imageHeight":256,



"imageUrl":"http:\/\/ecn.t2.tiles.virtualearth.net\/tiles\/a0212300322.jpeg?g=414&mkt={cu
lture}",

    "imageUrlSubdomains":null,

    "imageWidth":256,

    "vintageEnd":"01 Mar 2001 GMT",

                                                                                              107
    "vintageStart":"01 Mar 2001 GMT",

    "zoomMax":10,

    "zoomMin":10

}

XML Example
<ImageryMetadata>



<ImageUrl>http://ecn.t2.tiles.virtualearth.net/tiles/a0212300322.jpeg?g=414&mkt={culture}
</ImageUrl>

    <ImageWidth>256</ImageWidth>

    <ImageHeight>256</ImageHeight>

    <ZoomMin>10</ZoomMin>

    <ZoomMax>10</ZoomMax>

    <VintageStart>2001-03-01</VintageStart>

    <VintageEnd>2001-03-01</VintageEnd>

</ImageryMetadata>

Birdseye Imagery Resource Example
XML Example
<BirdseyeMetadata>

    <ImageUrl>http://ecn.{subdomain}.tiles.virtualearth.net/tiles/o02301020333-37448-
{zoom}-{tileId}.jpeg?g=461</ImageUrl>

    <ImageUrlSubdomains>

     <string>t0</string>

     <string>t1</string>

     <string>t2</string>

     <string>t3</string>

    </ImageUrlSubdomains>

    <ImageWidth>256</ImageWidth>

    <ImageHeight>256</ImageHeight>

    <ZoomMin>19</ZoomMin>

    <ZoomMax>20</ZoomMax>

    <Orientation>0</Orientation>

    <TilesX>16</TilesX>

    <TilesY>12</TilesY>



                                                                                        108
</BirdseyeMetadata>

JSON Example
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2010 Microsoft and its suppliers. All rights reserved. This A
PI cannot be accessed and the content and any results may not be used, reproduced or tran
smitted in any manner without express written permission from Microsoft Corporation.",

    "resourceSets":[

      {

          "estimatedTotal":1,

          "resources":[

            {

                 "__type":"BirdseyeMetadata:http:\/\/schemas.microsoft.com\/search\/local\/
ws\/rest\/v1",

                 "imageHeight":256,

                 "imageUrl":"http:\/\/ecn.{subdomain}.tiles.virtualearth.net\/tiles\/o02301
020333-37448-{zoom}-{tileId}.jpeg?g=461

                 "imageUrlSubdomains":[

                      "t0",

                      "t1",

                      "t2",

                      "t3"

                 ],

                 "imageWidth":256,

                 "imageryProviders":null,

                 "vintageEnd":null,

                 "vintageStart":null,

                 "zoomMax":20,

                 "zoomMin":19,

                 "orientation":0,

                 "tilesX":16,

                 "tilesY":12

            }



                                                                                         109
             ]

         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"79cdbd530cdc4bbfaee4c8f8d780d1e3"

}


Static Map Data
When you use the Get a Static Map API to request static map image metadata, the response
returns a Static Map Metadata resource that contains metadata about the static map including the
absolute (latitude and longitude) and relative (with respect to the map) coordinates and size of
pushpins, as well as the map area, size and center point. When you request static map metadata,
the response does not return the map image. This topic contains descriptions of the static map
metadata, followed by JSON and XML examples.
For more information about the common response syntax for the Bing Maps REST Services, see
Common Response Description.

Static Map Metadata
The following fields are returned when you request image metadata for a static map.


JSON                     XML                       Type                   Description

bbox                     BoundingBox               BoundingBox. For       A geographic area
                                                   more information       that contains the
                                                   about the              location. A bounding
                                                   BoundingBox type,      box contains
                                                   see Location and       SouthLatitude,
                                                   Area Types.            WestLongitude,
                                                                          NorthLatitude, and
                                                                          EastLongitude values
                                                                          in units of degrees.

imageWidth               ImageWidth                integer                The width of static
                                                                          map.

imageHeight              ImageHeight               integer                The height of the
                                                                          static map.

mapCenter                MapCenter                 Point. For more       The centerpoint of the
                                                   information about the static map.
                                                   Point type, see
                                                   Location and Area

                                                                                                110
JSON                      XML                       Type                     Description
                                                    Types.

zoom                      Zoom                      integer                  The zoom level of the
                                                                             static map.

pushpinMetadata           PushpinMetadata           collection               A collection of
                                                                             metadata for each
                                                                             pushpin on the static
                                                                             map. See the
                                                                             Pushpin Metadata
                                                                             section below for
                                                                             more information.


Pushpin Metadata
If a static map contains pushpins, a request for static map metadata returns following information
for each pushpin.


JSON                       XML                         Type                    Description

point                      Point                       Point. For more         The latitude and
                                                       information about       longitude
                                                       the Point type, see     coordinates of the
                                                       Location and Area       pushpin.
                                                       Types.

anchor                     Anchor                      An x (horizontal)       The placement of
                                                       and y (vertical)        the pushpin on the
                                                       offset in pixels.       static map that is
                                                                               defined by an offset
                                                                               in pixels from the
                                                                               upper left hand
                                                                               corner of the map.

topLeftOffset              TopLeftOffset               An x (horizontal)       The offset of the top
                                                       and y (vertical)        left corner of the
                                                       offset in pixels.       pushpin icon with
                                                                               respect to the
                                                                               anchor point.

bottomRightOffset          BottomRightOffset           An x (horizontal)       The offset of the
                                                       and y (vertical)        bottom right corner
                                                       offset in pixels.       of the pushpin icon
                                                                               with respect to the


                                                                                                111
JSON                       XML                        Type                  Description
                                                                            anchor point.


Examples
The following examples show the metadata that is returned for a static map. The static map is
also shown for reference. When you request metadata for a static map, the map image is not
returned.
Static Map Metadata Resource Example
The following URL gets static map metadata for the map image. The map image is not returned
with static map metadata. XML and JSON static metadata responses are shown below.
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/47.619048,-
122.35384/15?mapSize=500,500&pp=47.620495,-122.34931;21;AA&pp=47.619385,-
122.351485;;AB&pp=47.616295,-122.3556;22&mapMetadata=1&o=xml&key=BingMapsKey




                                                                                                112
This example returns the following response.
XML Response
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

  <Copyright>

    Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

  </Copyright>

  <BrandLogoUri>

    http://dev.virtualearth.net/Branding/logo_powered_by.png

  </BrandLogoUri>

  <StatusCode>200</StatusCode>

  <StatusDescription>OK</StatusDescription>

  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

  <TraceId>

    d7718f0fa2344b23ad73ac2dd8788eec

  </TraceId>

  <ResourceSets>

    <ResourceSet>

      <EstimatedTotal>1</EstimatedTotal>

      <Resources>

        <StaticMapMetadata>

          <BoundingBox>

              <SouthLatitude>47.611833900404896</SouthLatitude>

              <WestLongitude>-122.36456394195557</WestLongitude>

              <NorthLatitude>47.626268662877358</NorthLatitude>

              <EastLongitude>-122.34314918518068</EastLongitude>

          </BoundingBox>

          <MapCenter>

              <Latitude>47.619048</Latitude>


                                                                                         113
 <Longitude>-122.35384</Longitude>

</MapCenter>

<ImageWidth>500</ImageWidth>

<ImageHeight>500</ImageHeight>

<Zoom>15</Zoom>

<Pushpins>

 <PushpinMetadata>

   <Point>

     <Latitude>47.620495</Latitude>

     <Longitude>-122.34931</Longitude>

   </Point>

   <Anchor>

     <X>355</X>

     <Y>200</Y>

   </Anchor>

   <TopLeftOffset>

     <X>12</X>

     <Y>25</Y>

   </TopLeftOffset>

   <BottomRightOffset>

     <X>13</X>

     <Y>2</Y>

   </BottomRightOffset>

 </PushpinMetadata>

 <PushpinMetadata>

   <Point>

     <Latitude>47.619385</Latitude>

     <Longitude>-122.351485</Longitude>

   </Point>

   <Anchor>

     <X>305</X>

     <Y>238</Y>

   </Anchor>

   <TopLeftOffset>

                                          114
                 <X>12</X>

                 <Y>28</Y>

               </TopLeftOffset>

               <BottomRightOffset>

                 <X>13</X>

                 <Y>0</Y>

               </BottomRightOffset>

              </PushpinMetadata>

              <PushpinMetadata>

               <Point>

                 <Latitude>47.616295</Latitude>

                 <Longitude>-122.3556</Longitude>

               </Point>

               <Anchor>

                 <X>209</X>

                 <Y>345</Y>

               </Anchor>

               <TopLeftOffset>

                 <X>8</X>

                 <Y>8</Y>

               </TopLeftOffset>

               <BottomRightOffset>

                 <X>8</X>

                 <Y>8</Y>

               </BottomRightOffset>

              </PushpinMetadata>

         </Pushpins>

       </StaticMapMetadata>

     </Resources>

   </ResourceSet>

 </ResourceSets>

</Response>



JSON Response

                                                    115
The following response is returned if the output parameter (o=xml) is not specified in the URL or
is set to json (o=json).
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

      {

          "estimatedTotal":1,

          "resources":[

             {



"__type":"StaticMapMetadata:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                 "bbox":[

                      47.611833900404896,

                      -122.36456394195557,

                      47.626268662877358,

                      -122.34314918518068

                 ],

                 "imageHeight":"500",

                 "imageWidth":"500",

                 "mapCenter":{

                      "type":"Point",

                      "coordinates":[

                          "47.619048",

                          "-122.35384"

                      ]

                 },

                 "pushpins":[

                      {

                          "anchor":{

                             "x":"355",

                                                                                               116
          "y":"200"

     },

     "bottomRightOffset":{

          "x":"13",

          "y":"2"

     },

     "point":{

          "type":"Point",

          "coordinates":[

              "47.620495",

              "-122.34931"

          ]

     },

     "topLeftOffset":{

          "x":"12",

          "y":"25"

     }

},

{

     "anchor":{

          "x":"305",

          "y":"238"

     },

     "bottomRightOffset":{

          "x":"13",

          "y":"0"

     },

     "point":{

          "type":"Point",

          "coordinates":[

              "47.619385",

              "-122.351485"

          ]

     },

                              117
                           "topLeftOffset":{

                                "x":"12",

                                "y":"28"

                           }

                      },

                      {

                           "anchor":{

                                "x":"209",

                                "y":"345"

                           },

                           "bottomRightOffset":{

                                "x":"8",

                                "y":"8"

                           },

                           "point":{

                                "type":"Point",

                                "coordinates":[

                                    "47.616295",

                                    "-122.3556"

                                ]

                           },

                           "topLeftOffset":{

                                "x":"8",

                                "y":"8"

                           }

                      }

                 ],

                 "zoom":"15"

             }

         ]

     }

],

"statusCode":200,

"statusDescription":"OK",

                                                   118
    "traceId":"bfc64b786a054288a4b160743ddfec65"

}



Routes API
Use the Routes API to create a route that includes two or more locations and to create routes
from major roads. You can create driving or walking routes. Driving routes can include traffic
information. You can also overlay routes on map imagery.
For information about how to overlay routes on a static map using the Bing Maps REST Services
Imagery API, see Get a Static Map.


In this section

Calculate a Route                                 Use these URL templates to get a walking,
                                                  driving or transit route by specifying a series of
                                                  waypoints.

Calculate Routes from Major Roads                 Use this URL template to return a driving route
                                                  to a location from major roads in four directions
                                                  (West, North, East and South).

Route Data                                        Use this description to understand the results
                                                  returned in the response to a Routes API
                                                  request.

Maneuver Types                                    Use these maneuver descriptions to
                                                  understand the maneuver types returned in the
                                                  route response.

Warning Types                                     Use these warning descriptions to understand
                                                  the warnings returned in the route response.



See Also
Driving Route Example
Walking Route Example
Transit Route Example
Driving Route with Route Path Example
Driving Route using Tolerances Example
Bing Maps Transit Coverage




                                                                                                 119
Calculate a Route
Use the following URL templates to get a walking, driving or transit route by specifying a series of
waypoints. A waypoint is a specified geographical location defined by longitude and latitude that
is used for navigational purposes. The route includes information such as route instructions,
travel duration, travel distance or transit information. You can also request a set of route points.
To overlay a route on a static map by using the Imagery API, see Get a Static Map.

URL Templates


     These templates support both HTTP and HTTPS protocols.
You can specify up to 25 waypoints for a route. Each set of waypoints creates a separate route
leg. Between any two (2) waypoints, you can have up to 10 intermediate
viaWayPoints.ViaWaypoints define the route path and do not create route legs.
Find a driving route.
http://dev.virtualearth.net/REST/v1/Routes?
wayPoint.1=wayPoint1&viaWaypoint.2=viaWaypoint2&waypoint.3=wayPoint3&wayPoint.n=wayPointn
&heading=heading&optimize=optimize&avoid=avoidOptions&distanceBeforeFirstTurn=distanceBef
oreFirstTurn&maxSolutions=maxSolutions&routePathOutput=routePathOutput&tolerances=toleran
ce1,tolerance2,tolerancen&distanceUnit=distanceUnit&key=BingMapsKey

Find a walking, driving or transit route by specifying the mode of travel.
For a list of transit agencies, see Bing Maps Transit Coverage. You can request up to three (3)
driving or transit route options between two waypoints by using the maxSolutions parameter.
http://dev.virtualearth.net/REST/v1/Routes/travelMode?wayPoint.1=wayPoint1&viaWaypoint.2=
viaWaypoint2&waypoint.3=wayPoint3&wayPoint.n=wayPointn&heading=heading&optimize=optimize&
avoid=avoidOptions&distanceBeforeFirstTurn=distanceBeforeFirstTurn&timeType=timeType&date
Time=dateTime&maxSolutions=maxSolutions&routePathOutput=routePathOutput&tolerances=tolera
nce1,tolerance2,tolerancen&distanceUnit=distanceUnit&key=BingMapsKey



Template Parameters


     See the Common Parameters and Types section for additional common parameters to
     use with these URLs.
     Common parameters include:
   Output Parameters: Includes response output types and the JSON callback parameters.
   Culture Parameter: Includes a list of the supported cultures.
   User Context Parameters: Includes parameters that set user location and viewport values to
     help determine locations. For example, these values may help prioritize a set of possible
     locations when you specify a partial address for a waypoint.


                                                                                                 120
   When an alias is provided, you can use the alias to shorten the length of the query
   parameter. For example, waypoint.1=47.610,-122.107 can be shortened to
   wp.1=47.610,-122.107.
   Parameter values are not case-sensitive.


Parameter      Alias   Descriptio    Values
                       n

waypoint.n     wp.n    waypoint.     A route is defined by a set of waypoints and viaWaypoints
viaWaypoint.   vwp.    n:            (intermediate locations that the route must pass through).
n              n       Required.     The index (n value) for the set of waypoints and
                       Specifies     viaWaypoints is an integer starting with 0 or 1. The waypoint
                       two or        and viaWaypoint index values must be sequential and must
                       more          always increment by 1.
                       locations     Both waypoint and viaWaypoint locations can be specified as
                       that define   a Point, a landmark, or an address. For more information
                       the route     about Point values, see Location and Area Types.
                       and that
                                     You can have a maximum of 25 waypoints, and a maximum
                       are in
                                     of 10 viaWaypoints between each set of waypoints. The start
                       sequential
                                     and end points of the route cannot be viaWaypoints.
                       order.
                                   For transit routes and when more than one route is
                       viaWaypo
                                   requested (maxSolutions > 1), you must specify only two
                       int.n:
                                   waypoints, and viaWaypoints are not supported.
                       Optional
                       Specifies
                       one or          If you specify a waypoint or viaWaypoint as an
                       more            address or landmark, you can increase the accuracy
                       locations       of the corresponding geocoded location (latitude and
                       that define     longitude) by specifying an IP address, user location
                       intermedia      or map area in the URL request. For more
                       te points       information about these parameters, see User
                       of a route      Context Parameters.
                       between         In addition, if you are using the Routes API from
                       waypoints.
                                       server-side code, you can set the userIP parameter
                                       to 127.0.0.1 (localhost) to prevent the server’s
                                       location from affecting the geocoded location result.
                                     Examples:
                                     waypoint.1=47.610,-122.107 [Point]
                                     wp.1=Seattle,WA [landmark]
                                     waypoint.1=1%20Microsoft%20Way%20Redmond%20WA%
                                     20 [address]
                                     &waypoint.1=Seattle&viaWaypoint.2=Kirkland&waypoint.3=R

                                                                                               121
Parameter     Alias   Descriptio      Values
                      n
                                      edmond [viaWaypoint]
                                      Incorrect set of waypoints.
                                      The following set of values is not valid because there is no
                                      waypoint.2.
                                      &waypoint.1=San%20Francisco&waypoint.3=Seattle
                                      The following set of values is not valid because a
                                      viaWaypoint is specified as the starting waypoint.
                                      &viaWaypoint.1=1%20Microsoft%20Way%20Redmond%20
                                      WA&waypoint.2=Bellevue&waypoint.3=Seattle

avoid                 Optional.       A comma-separated list of values from the following list that
                      Specifies       limit the use of highways and toll roads in the route. In the
                      the road        definitions below, “highway” also refers to a “limited-access
                      types to        highway”.
                      minimize        If no values are specified, highways and tolls are allowed in
                      or avoid        the route.
                      when a
                                         highways: Avoids the use of highways in the route.
                      route is
                                         tolls: Avoids the use of toll roads in the route.
                      created for
                      the driving        minimizeHighways: Minimizes (tries to avoid) the use of
                                           highways in the route.
                      travel
                      mode.              minimizeTolls: Minimizes (tries to avoid) the use of toll
                                           roads in the route.


                                           If you specify more than one option for a road type,
                                           then the most restrictive option is used. For example,
                                           if you set the avoid parameter to both highways and
                                           minimizeHighways, the highways option is used and
                                           all highways are avoided.
                                      Examples:
                                      avoid=highways
                                      avoid=highways,tolls

distanceBefor dbft    Optional.       An integer distance specified in meters. Use this parameter
eFirstTurn            Specifies       to make sure that the moving vehicle has enough distance to
                      the             make the first turn.
                      distance        Examples:
                      before the
                                      distanceBeforeFirstTurn=500
                      first turn is
                                      dbft=500
                      allowed in
                                                                                                    122
Parameter      Alias   Descriptio    Values
                       n
                       the route.
                       This
                       option
                       only
                       applies to
                       the driving
                       travel
                       mode.

heading        hd      Optional.     An integer value between 0 and 359 that represents degrees
                       Specifies     from north where north is 0 degrees and the heading is
                       the initial   specified clockwise from north. For example, setting the
                       heading       heading of 270 degrees creates a route that initially heads
                       for the       west.
                       route.        Example:
                                     heading=90

optimize       optm    Optional.     One of the following values:
               z       Specifies        distance: The route is calculated to minimize the
                       what               distance. Traffic information is not used.
                       parameter        time [default]: The route is calculated to minimize the
                       s to use to        time. Traffic information is not used.
                       optimize         timeWithTraffic: The route is calculated to minimize the
                       the route.         time and uses current traffic information.
                                     Example: optimize=time

routePathOut   rpo     Optional.     One of the following values:
put                    Specifies        Points: A list of Point values for the route’s path is
                       whether            provided in the response.
                       the              None [default]: No information about the route’s path is
                       response           provided in the response.
                       should
                                     Example: routePathOutput=Points
                       include
                       informatio
                       n about
                       Point
                       (latitude
                       and
                       longitude)
                       values for
                       the route’s

                                                                                                    123
Parameter    Alias   Descriptio    Values
                     n
                     path.


tolerances   tl      Optional.     A set of comma-separated double values. Each value
                     Specifies     specifies a tolerance that is used to reduce the number of
                     a series of   points needed to display a route on a map and still maintain
                     tolerance     the route shape. If a point is removed and the new route still
                     values.       falls within the specified tolerance of the old route, then the
                     Each          point is not included in the subset of points returned for that
                     value         tolerance.
                     produces      You may find it useful to define tolerances for different zoom
                     a subset      levels, screen resolutions or other display parameters.
                     of points
                                   You can specify a maximum of seven (7) tolerance values.
                     that
                                The tolerance is specified in degrees. A degree of latitude is
                     approxima
                     tes the    approximately 60 nautical miles, 111 kilometers or 69 statute
                                miles. Therefore, a tolerance value of 0.00001 represents a
                     route that
                                distance of about one (1) meter in the north-south direction.
                     is
                     described  The distance represented by a degree of longitude varies
                                with latitude. For example at 45 degrees of longitude, a
                     by the full
                                degree of latitude is 111.132 km and a degree of longitude is
                     set of
                     points.    78.847 km. At the equator, these values are almost equal
                                with latitude at 100.754 km and longitude at 111.320 km. As
                     This
                                you approach the poles, the distance associated with a
                     parameter
                                degree of latitude decreases, and fewer points will be
                     is only
                                excluded for the same tolerance value. For more information
                     valid when
                                about how longitude distances change with latitude, see
                     the
                                Longitude (Wikipedia).
                     routePath
                                The following diagram illustrates how a tolerance value is
                     Output
                                used.
                     parameter
                     is set to
                     Points.




                                                                                               124
Parameter      Alias   Descriptio    Values
                       n




                                     Example: tl=0.00000344978

distanceUnit   du      Optional.     One of the following values:
                       The units        Mile or mi
                       to use for       Kilometer or km [default]
                       distance in
                                     Example: distanceUnit=mi
                       the
                       response.

dateTime       dt      Required      A string that contains the date and time formatted as a
                       when the      DateTime value. For information about the string
                       travel        representation options for DateTime values, see
                       mode is       DateTime.Parse Method (String).
                       Transit.      Examples:
                       The
                                        dateTime=03/01/2011 05:42:00
                       timeType
                                        dateTime=05:42:00 [assumes the current day]
                       parameter
                       identifies       dateTime=03/01/2011 [assumes the current time]
                       the
                       desired
                       transit
                       time, such
                       as arrival
                       time or
                       departure
                       time. The
                       transit

                                                                                               125
Parameter      Alias   Descriptio    Values
                       n
                       time type
                       is
                       specified
                       by the
                       timeType
                       parameter
                       .

timeType       tt      Required      One of the following values:
                       when the         Arrival: The dateTime parameter contains the desired
                       travel             arrival time for a transit request.
                       mode is          Departure: The dateTime parameter contains the desired
                       Transit            departure time for a transit request.
                       Specifies        LastAvailable: The dateTime parameter contains the
                       how to             latest departure time available for a transit request.
                       interpret
                       the date
                       and transit
                       time value
                       that is
                       specified
                       by the
                       dateTime
                       parameter
                       .

maxSolutions   max   Optional.       A string that contains an integer value between 1 and 3. The
               Solns Specifies       default value is 1.
                     the             Example: maxSolns=3
                     maximum
                     number of
                     transit or           This parameter is available for the Driving and
                     driving              Transit travel modes for routes between two
                     routes to            waypoints. This parameter does not support routes
                     return.              with more than two waypoints.
                                          For driving routes, you must not set the avoid and
                                          distanceBeforeFirstTurn parameters.

                                          The maxSolutions parameter is supported for routes
                                          in the United States, Canada, Mexico, United
                                          Kingdom, Australia, and India.

travelMode             Optional.     One of the following values:

                                                                                                   126
Parameter      Alias    Descriptio   Values
                        n
                        The mode        Driving [default]
                        of travel       Walking
                        for the         Transit
                        route.


Response
A Route resource is returned when you make a request with one of the following URLs. For more
information about the Route resource, see Route Data. For more information about the common
response syntax for the Bing Maps REST Services, see Common Response Description. JSON
and XML responses are provided for the URL examples in the following section.
These URLs support JSON (application/json) and XML (application/xml) response formats. A
JSON response is provided by default, unless you request XML output by setting the output (o)
parameter. For more information, see Output Parameters.

Examples
Find a driving route.
The following example shows how to request a driving route between two locations that
minimizes the use of toll roads. To view the complete XML and JSON responses, see Driving
Route Example.
http://dev.virtualearth.net/REST/V1/Routes/Driving?o=xml&wp.0=london&wp.1=leeds&avoid=min
imizeTolls&key=BingMapsKey

Find a driving route that includes an intermediate route point (viaWaypoint).
The following example shows how to request a driving route between two locations that includes
an intermediate viaWaypoint. ViaWaypoints are used to direct a route through specific locations
and do not create a new route leg like waypoints.
http://dev.virtualearth.net/REST/V1/Routes/Driving?o=xml&wp.0=Seattle,WA&vwp.1=Portland,O
R&wp.2=Bend,OR&avoid=minimizeTolls&key=BingMapsKey

Find a walking route that minimizes distance.
This example returns a walking route from the Eiffel Tower to the Louvre Museum in Paris,
France. The route is optimized for distance and returns the results in XML. To view the complete
XML and JSON responses, see Walking Route Example.
http://dev.virtualearth.net/REST/V1/Routes/Walking?wp.0=Eiffel%20Tower&wp.1=louvre%20muse
um&optmz=distance&output=xml&key=BingMapsKey

Find a transit route.
The following example shows how to request a transit route between the Golden Gate Bridge and
Fisherman’s Wharf in San Francisco for 3 PM on the current day. To view the complete XML and
JSON responses, see Transit Route Example.

                                                                                              127
%http://dev.virtualearth.net/REST/V1/Routes/Transit?wp.0=Golden%20Gate%20Bridge&wp.1=Fish
ermans%20Wharf&timeType=Departure&dateTime=3:00:00PM&output=xml&key=BingMapsKey

Find up to three driving route options between New York, NY and Philadelphia, PA.
The following example requests up to three (3) driving route options between New York, New
York and Philadelphia, Pennsylvania.
http://dev.virtualearth.net/REST/V1/Routes?wp.0=New%20York,NY&wp.1=Philadelphia,PA&maxSol
ns=3&key=BingMapsKey

Two ways to specify waypoints for a driving route: Point (latitude and longitude
coordinates) and location names.
The following two examples show how to request a route between San Francisco and San Diego
by using latitude and longitude coordinates and by using location names.
http://dev.virtualearth.net/REST/V1/Routes?wp.0=37.779160067439079,-
122.42004945874214&wp.1=32.715685218572617,-117.16172486543655&key=BingMapsKey

http://dev.virtualearth.net/REST/V1/Routes?wp.0=San%20Francisco&wp.1=San%20Diego&key=Bing
MapsKey

Find a driving route between Redmond, Washington and Seattle, Washington that
specifies an initial heading of 90 degrees (east) and that requests the results uses miles as
the distance unit.
http://dev.virtualearth.net/REST/v1/Routes/Driving?waypoint.0=redmond&heading=90&waypoint
.1=seattle&du=mi&key=BingMapsKey



Find a walking route between two addresses.
This example shows how to request a walking route between two addresses.
http://dev.virtualearth.net/REST/V1/Routes/Walking?wp.0=11025%20NE%208th%20St%20Bellevue%
20WA&wp.1=700%20Bellevue%20Way%20NE%20Bellevue WA&key=BingMapsKey

Find a driving route that minimizes the distance and specifies that the first turn must be at
least 500 meters from the starting point.
The following example optimizes a route between two locations for distance. The first turn on the
route must be 500 meters or more from the starting point.
http://dev.virtualearth.net/REST/V1/Routes?wp.0=11025%20NE%208th%20St%20Bellevue&wp.1=1%2
0Microsoft%20Way%20Redmond%20WA&optmz=distance&dblt=500&key=BingMapsKey

Find a driving route that minimizes travel time based on current traffic conditions.
The following example optimizes a route between two locations and takes the current traffic
conditions into account.
http://dev.virtualearth.net/REST/V1/Routes?wp.0=Bellevue,WA&wp.1=Bothell,WA&optmz=timeWit
hTraffic&key=BingMapsKey

Find a driving route that does not use highways or toll roads.


                                                                                              128
The following example returns a driving route between the cities of Buffalo and Syracuse in New
York State. The avoid parameter specifies to not use toll roads or highways. Therefore, the
returned route does not use the interstate highway I-90 which would otherwise be part of the
route.
http://dev.virtualearth.net/REST/V1/Routes/Driving?wp.0=Buffalo&wp.1=Syracuse&avoid=tolls
,highways&key=BingMapsKey



Find a driving route and request a route path.
This example returns a driving route from the Minneapolis, Minnesota to St. Paul, Minnesota. The
route is optimized for distance and requests point values for the route’s path. The results are
returned in JSON. To view the complete XML and JSON responses, see Driving Route with
Route Path Example.
http://dev.virtualearth.net/REST/V1/Routes/Driving?wp.0=Minneapolis,MN&wp.1=St%20Paul,MN&
optmz=distance&rpo=Points&key=BingMapsKey

Find a driving route and request a route path and alternative sets of points based on
tolerance values.
This example returns a driving route from the Minneapolis, Minnesota to St. Paul, Minnesota. The
route is optimized for distance and requests point values for the route’s path. In addition to the full
set of route points, a list of tolerances is specified. For each tolerance value, a subset of points is
returned in the response. The route defined by each subset of points approximates the route
defined by all the points. The difference allowed between the two routes is defined by the
tolerance value. To view examples of these subsets of points in the response, see Driving Route
using Tolerances Example.
http://dev.virtualearth.net/REST/V1/Routes/Driving?o=xml&wp.0=44.979035,-
93.26493&wp.1=44.943828508257866,-
93.09332862496376&optmz=distance&rpo=Points&tl=0.00000344978,0.0000218840,0.000220577,0.0
0188803,0.0169860,0.0950130,0.846703&key=BingMapsKey


HTTP Status Codes


     For more details about these HTTP status codes, see Status Codes and Errors.
When the request is successful, the following HTTP status code is returned.
   200
When the request is not successful, the response returns one of the following errors.
   400
   401
   404
   500
   503

                                                                                                   129
See Also
Driving Route Example
Walking Route Example
Transit Route Example
Driving Route with Route Path Example
Driving Route using Tolerances Example

Driving Route Example
The following example shows how to request a driving route between two locations that
minimizes the use of toll roads. Responses are shown for both XML and JSON formats.
http://dev.virtualearth.net/REST/V1/Routes/Driving?o=xml&wp.0=lynnwood&wp.1=seattle&avoid
=minimizeTolls&key=BingMapsKey

XML Response
The response for this example contains a Route resource that provides driving instructions for the
route.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

  <Copyright>

    Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

  </Copyright>

  <BrandLogoUri>

    http://dev.virtualearth.net/Branding/logo_powered_by.png

  </BrandLogoUri>

  <StatusCode>200</StatusCode>

  <StatusDescription>OK</StatusDescription>

  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

  <TraceId>

    3caba2105a574ef49cc2053bd8e2ee41

  </TraceId>

  <ResourceSets>

    <ResourceSet>

      <EstimatedTotal>1</EstimatedTotal>

      <Resources>



                                                                                              130
       <Route>

         <Id>

           v62,i0,a2,cen-
US,dAAAAAAAAAAA=,y0,s1,m1,o1,t4,wsEpABBErIfU=~XpeTlJE5rgAAAOABcNkAPwA=~THlubndvb2QsIFdB~~
~,w2D47BGFTIPU=~XpeTlGF+5wAAAOABhqIAPwA=~U2VhdHRsZSwgV0E=~~~,k1,u

         </Id>

         <BoundingBox>

           <SouthLatitude>47.603559</SouthLatitude>

           <WestLongitude>-122.331578</WestLongitude>

           <NorthLatitude>47.825321</NorthLatitude>

           <EastLongitude>-122.292332</EastLongitude>

         </BoundingBox>

         <DistanceUnit>Kilometer</DistanceUnit>

         <DurationUnit>Second</DurationUnit>

         <TravelDistance>26.273</TravelDistance>

         <TravelDuration>1094</TravelDuration>

         <RouteLeg>

           <TravelDistance>26.273</TravelDistance>

           <TravelDuration>1094</TravelDuration>

           <ActualStart>

             <Latitude>47.825321</Latitude>

             <Longitude>-122.292407</Longitude>

           </ActualStart>

           <ActualEnd>

             <Latitude>47.603559</Latitude>

             <Longitude>-122.329436</Longitude>

           </ActualEnd>

           <StartLocation>

             <Name>Lynnwood, WA</Name>

             <Point>

                 <Latitude>47.825321</Latitude>

                 <Longitude>-122.292412</Longitude>

             </Point>

             <BoundingBox>


                                                                                      131
   <SouthLatitude>47.801086</SouthLatitude>

   <WestLongitude>-122.3414</WestLongitude>

   <NorthLatitude>47.841423</NorthLatitude>

   <EastLongitude>-122.286293</EastLongitude>

 </BoundingBox>

 <EntityType>PopulatedPlace</EntityType>

 <Address>

   <AdminDistrict>WA</AdminDistrict>

   <AdminDistrict2>Snohomish Co.</AdminDistrict2>

   <CountryRegion>United States</CountryRegion>

   <FormattedAddress>Lynnwood, WA</FormattedAddress>

   <Locality>Lynnwood</Locality>

 </Address>

 <Confidence>High</Confidence>

 <MatchCode>Good</MatchCode>

 <GeocodePoint>

   <Latitude>47.825321</Latitude>

   <Longitude>-122.292412</Longitude>

   <CalculationMethod>Rooftop</CalculationMethod>

   <UsageType>Display</UsageType>

 </GeocodePoint>

</StartLocation>

<EndLocation>

 <Name>Seattle, WA</Name>

 <Point>

   <Latitude>47.603561</Latitude>

   <Longitude>-122.329437</Longitude>

 </Point>

 <BoundingBox>

   <SouthLatitude>47.253399</SouthLatitude>

   <WestLongitude>-123.165718</WestLongitude>

   <NorthLatitude>47.946136</NorthLatitude>

   <EastLongitude>-121.503441</EastLongitude>

 </BoundingBox>

                                                       132
             <EntityType>PopulatedPlace</EntityType>

             <Address>

               <AdminDistrict>WA</AdminDistrict>

               <AdminDistrict2>King Co.</AdminDistrict2>

               <CountryRegion>United States</CountryRegion>

               <FormattedAddress>Seattle, WA</FormattedAddress>

               <Locality>Seattle</Locality>

             </Address>

             <Confidence>High</Confidence>

             <MatchCode>Good</MatchCode>

             <GeocodePoint>

               <Latitude>47.603561</Latitude>

               <Longitude>-122.329437</Longitude>

               <CalculationMethod>Rooftop</CalculationMethod>

               <UsageType>Display</UsageType>

             </GeocodePoint>

           </EndLocation>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>1.029</TravelDistance>

             <TravelDuration>97</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.825321</Latitude>

               <Longitude>-122.292407</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="DepartStart">Depart 44TH Ave W toward 192ND St
SW</Instruction>

             <CompassDirection>south</CompassDirection>

             <Detail>

               <ManeuverType>DepartStart</ManeuverType>

               <StartPathIndex>0</StartPathIndex>

               <EndPathIndex>1</EndPathIndex>

               <Name>44TH Ave W</Name>

               <CompassDegrees>180</CompassDegrees>


                                                                                     133
               <Mode>Driving</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Arterial</RoadType>

               <LocationCode>114-08912</LocationCode>

               <LocationCode>114-08911</LocationCode>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Auto</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <TowardsRoadName>192ND St SW</TowardsRoadName>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>24.323</TravelDistance>

             <TravelDuration>908</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.816019</Latitude>

               <Longitude>-122.292332</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="RampThenHighwayRight">Take ramp right for I-5
South</Instruction>

             <CompassDirection>southwest</CompassDirection>

             <Detail>

               <ManeuverType>TakeRampRight</ManeuverType>

               <StartPathIndex>1</StartPathIndex>

               <EndPathIndex>6</EndPathIndex>

               <CompassDegrees>217</CompassDegrees>

               <Mode>Driving</Mode>

               <PreviousEntityId>0</PreviousEntityId>


                                                                                        134
 <NextEntityId>0</NextEntityId>

 <RoadType>Ramp</RoadType>

</Detail>

<Detail>

 <ManeuverType>Merge</ManeuverType>

 <StartPathIndex>6</StartPathIndex>

 <EndPathIndex>91</EndPathIndex>

 <Name>I-5 South</Name>

 <CompassDegrees>241</CompassDegrees>

 <Mode>Driving</Mode>

 <PreviousEntityId>0</PreviousEntityId>

 <NextEntityId>0</NextEntityId>

 <RoadType>LimitedAccessHighway</RoadType>

 <RoadShieldRequestParameters>

   <Bucket>50402</Bucket>

   <Shield>

     <RoadShieldType>1</RoadShieldType>

     <Label>5</Label>

   </Shield>

 </RoadShieldRequestParameters>

 <LocationCode>114-04212</LocationCode>

 <LocationCode>114N04212</LocationCode>

 <LocationCode>114-04211</LocationCode>

 <LocationCode>114N04211</LocationCode>

 <LocationCode>114-04210</LocationCode>

 <LocationCode>114N04210</LocationCode>

 <LocationCode>114-04209</LocationCode>

 <LocationCode>114N04209</LocationCode>

 <LocationCode>114-04208</LocationCode>

 <LocationCode>114N04208</LocationCode>

 <LocationCode>114-04207</LocationCode>

 <LocationCode>114N04207</LocationCode>

 <LocationCode>114-04206</LocationCode>

 <LocationCode>114N04206</LocationCode>

                                             135
   <LocationCode>114-04205</LocationCode>

   <LocationCode>114N04205</LocationCode>

   <LocationCode>114-04204</LocationCode>

   <LocationCode>114N04204</LocationCode>

   <LocationCode>114-04203</LocationCode>

   <LocationCode>114N04203</LocationCode>

   <LocationCode>114-04202</LocationCode>

   <LocationCode>114N04202</LocationCode>

   <LocationCode>114-04201</LocationCode>

   <LocationCode>114N04201</LocationCode>

   <LocationCode>114-04200</LocationCode>

   <LocationCode>114N04200</LocationCode>

   <LocationCode>114-04199</LocationCode>

   <LocationCode>114N04199</LocationCode>

   <LocationCode>114-04198</LocationCode>

   <LocationCode>114N04198</LocationCode>

   <LocationCode>114-04197</LocationCode>

   <LocationCode>114N04197</LocationCode>

   <LocationCode>114-04196</LocationCode>

   <LocationCode>114N04196</LocationCode>

   <LocationCode>114-04195</LocationCode>

 </Detail>

 <Exit/>

 <TollZone/>

 <TransitTerminus/>

 <IconType>Auto</IconType>

 <Time>0001-01-01T00:00:00</Time>

 <TransitStopId>0</TransitStopId>

 <SideOfStreet>Unknown</SideOfStreet>

</ItineraryItem>

<ItineraryItem>

 <TravelMode>Driving</TravelMode>

 <TravelDistance>0.799</TravelDistance>

 <TravelDuration>63</TravelDuration>

                                            136
<ManeuverPoint>

 <Latitude>47.610658</Latitude>

 <Longitude>-122.33139</Longitude>

</ManeuverPoint>

<Instruction maneuverType="RampThenHighwayRight">

 At exit 165A, take ramp right for 6TH Ave toward James St.

</Instruction>

<CompassDirection>southeast</CompassDirection>

<Detail>

 <ManeuverType>TakeRampRight</ManeuverType>

 <StartPathIndex>91</StartPathIndex>

 <EndPathIndex>96</EndPathIndex>

 <CompassDegrees>198</CompassDegrees>

 <Mode>Driving</Mode>

 <PreviousEntityId>0</PreviousEntityId>

 <NextEntityId>0</NextEntityId>

 <RoadType>Ramp</RoadType>

</Detail>

<Detail>

 <ManeuverType>Merge</ManeuverType>

 <StartPathIndex>96</StartPathIndex>

 <EndPathIndex>98</EndPathIndex>

 <Name>6TH Ave</Name>

 <CompassDegrees>140</CompassDegrees>

 <Mode>Driving</Mode>

 <PreviousEntityId>0</PreviousEntityId>

 <NextEntityId>0</NextEntityId>

 <RoadType>Arterial</RoadType>

 <LocationCode>114-08569</LocationCode>

</Detail>

<Sign>James St.</Sign>

<Exit>165A</Exit>

<TollZone/>

<TransitTerminus/>

                                                              137
             <IconType>Auto</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.122</TravelDistance>

             <TravelDuration>23</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.604141</Latitude>

               <Longitude>-122.328081</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TurnRight">Turn right onto James
St</Instruction>

             <CompassDirection>southwest</CompassDirection>

             <Detail>

               <ManeuverType>TurnRight</ManeuverType>

               <StartPathIndex>98</StartPathIndex>

               <EndPathIndex>101</EndPathIndex>

               <Name>James St</Name>

               <CompassDegrees>246</CompassDegrees>

               <Mode>Driving</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Arterial</RoadType>

               <LocationCode>114-10561</LocationCode>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Auto</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>


                                                                           138
             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0</TravelDistance>

             <TravelDuration>0</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.603559</Latitude>

               <Longitude>-122.329436</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="ArriveFinish">Arrive at Seattle,
WA</Instruction>

             <CompassDirection>west</CompassDirection>

             <Hint>The last intersection is 5TH Ave</Hint>

             <Hint>If you reach 4TH Ave, you've gone too far</Hint>

             <Detail>

               <ManeuverType>ArriveFinish</ManeuverType>

               <StartPathIndex>101</StartPathIndex>

               <EndPathIndex>101</EndPathIndex>

               <Name>James St</Name>

               <CompassDegrees>249</CompassDegrees>

               <Mode>Driving</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Arterial</RoadType>

               <LocationCode>114-10561</LocationCode>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Auto</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>


                                                                           139
              </ItineraryItem>

              <StartTime>0001-01-01T00:00:00</StartTime>

              <EndTime>0001-01-01T00:00:00</EndTime>

            </RouteLeg>

           </Route>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>



JSON Response
You would receive the following JSON response if the output=xml parameter was not set in this
example.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

       {

           "estimatedTotal":1,

           "resources":[

              {



"__type":"Route:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                  "bbox":[

                       47.603559,

                       -122.331578,

                       47.825321,

                       -122.292332

                  ],




                                                                                            140
              "id":"v62,i0,a2,cen-
US,dAAAAAAAAAAA=,y0,s1,m1,o1,t4,wsEpABBErIfU=~XpeTlJE5rgAAAOABcNkAPwA=~THlubndvb2QsIFdB~~
~,w2D47BGFTIPU=~XpeTlGF+5wAAAOABhqIAPwA=~U2VhdHRsZSwgV0E=~~~,k1,u",

              "distanceUnit":"Kilometer",

              "durationUnit":"Second",

              "routeLegs":[

                 {

                     "actualEnd":{

                          "type":"Point",

                          "coordinates":[

                               47.603559,

                               -122.329436

                          ]

                     },

                     "actualStart":{

                          "type":"Point",

                          "coordinates":[

                               47.825321,

                               -122.292407

                          ]

                     },

                     "endLocation":{

                          "bbox":[

                               47.253399,

                               -123.165718,

                               47.946136,

                               -121.503441

                          ],

                          "name":"Seattle, WA",

                          "point":{

                               "type":"Point",

                               "coordinates":[

                                 47.603561,

                                 -122.329437


                                                                                      141
          ]

     },

     "address":{

          "adminDistrict":"WA",

          "adminDistrict2":"King Co.",

          "countryRegion":"United States",

          "formattedAddress":"Seattle, WA",

          "locality":"Seattle"

     },

     "confidence":"High",

     "entityType":"PopulatedPlace",

     "geocodePoints":[

          {

              "type":"Point",

              "coordinates":[

                   47.603561,

                   -122.329437

              ],

              "calculationMethod":"Rooftop",

              "usageTypes":[

                   "Display"

              ]

          }

     ],

     "matchCodes":[

          "Good"

     ]

},

"itineraryItems":[

     {

          "compassDirection":"south",

          "details":[

              {

                   "compassDegrees":180,

                                               142
         "endPathIndices":[

              1

         ],

         "locationCodes":[

              "114-08912",

              "114-08911"

         ],

         "maneuverType":"DepartStart",

         "mode":"Driving",

         "names":[

              "44TH Ave W"

         ],

         "roadType":"Arterial",

         "startPathIndices":[

              0

         ]

     }

],

"exit":"",

"iconType":"Auto",

"instruction":{

     "maneuverType":"DepartStart",

     "text":"Depart 44TH Ave W toward 192ND St SW"

},

"maneuverPoint":{

     "type":"Point",

     "coordinates":[

         47.825321,

         -122.292407

     ]

},

"sideOfStreet":"Unknown",

"tollZone":"",

"towardsRoadName":"192ND St SW",

                                                     143
     "transitTerminus":"",

     "travelDistance":1.029,

     "travelDuration":97,

     "travelMode":"Driving"

},

{

     "compassDirection":"southwest",

     "details":[

       {

            "compassDegrees":217,

            "endPathIndices":[

                 6

            ],

            "maneuverType":"TakeRampRight",

            "mode":"Driving",

            "roadType":"Ramp",

            "startPathIndices":[

                 1

            ]

       },

       {

            "compassDegrees":241,

            "endPathIndices":[

                 91

            ],

            "locationCodes":[

                 "114-04212",

                 "114N04212",

                 "114-04211",

                 "114N04211",

                 "114-04210",

                 "114N04210",

                 "114-04209",

                 "114N04209",

                                              144
     "114-04208",

     "114N04208",

     "114-04207",

     "114N04207",

     "114-04206",

     "114N04206",

     "114-04205",

     "114N04205",

     "114-04204",

     "114N04204",

     "114-04203",

     "114N04203",

     "114-04202",

     "114N04202",

     "114-04201",

     "114N04201",

     "114-04200",

     "114N04200",

     "114-04199",

     "114N04199",

     "114-04198",

     "114N04198",

     "114-04197",

     "114N04197",

     "114-04196",

     "114N04196",

     "114-04195"

],

"maneuverType":"Merge",

"mode":"Driving",

"names":[

     "I-5 South"

],

"roadShieldRequestParameters":{

                                  145
              "bucket":50402,

              "shields":[

                  {

                      "labels":[

                           "5"

                      ],

                      "roadShieldType":1

                  }

              ]

         },

         "roadType":"LimitedAccessHighway",

         "startPathIndices":[

              6

         ]

     }

],

"exit":"",

"iconType":"Auto",

"instruction":{

     "maneuverType":"RampThenHighwayRight",

     "text":"Take ramp right for I-5 South"

},

"maneuverPoint":{

     "type":"Point",

     "coordinates":[

         47.816019,

         -122.292332

     ]

},

"sideOfStreet":"Unknown",

"tollZone":"",

"transitTerminus":"",

"travelDistance":24.323,

"travelDuration":908,

                                              146
     "travelMode":"Driving"

},

{

     "compassDirection":"southeast",

     "details":[

       {

            "compassDegrees":198,

            "endPathIndices":[

                 96

            ],

            "maneuverType":"TakeRampRight",

            "mode":"Driving",

            "roadType":"Ramp",

            "startPathIndices":[

                 91

            ]

       },

       {

            "compassDegrees":140,

            "endPathIndices":[

                 98

            ],

            "locationCodes":[

                 "114-08569"

            ],

            "maneuverType":"Merge",

            "mode":"Driving",

            "names":[

                 "6TH Ave"

            ],

            "roadType":"Arterial",

            "startPathIndices":[

                 96

            ]

                                              147
                       }

                  ],

                  "exit":"165A",

                  "iconType":"Auto",

                  "instruction":{

                       "maneuverType":"RampThenHighwayRight",

                       "text":"At exit 165A, take ramp right for 6TH Ave toward
James St."

                  },

                  "maneuverPoint":{

                       "type":"Point",

                       "coordinates":[

                           47.610658,

                           -122.33139

                       ]

                  },

                  "sideOfStreet":"Unknown",

                  "signs":[

                       "James St."

                  ],

                  "tollZone":"",

                  "transitTerminus":"",

                  "travelDistance":0.799,

                  "travelDuration":63,

                  "travelMode":"Driving"

             },

             {

                  "compassDirection":"southwest",

                  "details":[

                       {

                           "compassDegrees":246,

                           "endPathIndices":[

                                101

                           ],


                                                                                  148
              "locationCodes":[

                   "114-10561"

              ],

              "maneuverType":"TurnRight",

              "mode":"Driving",

              "names":[

                   "James St"

              ],

              "roadType":"Arterial",

              "startPathIndices":[

                   98

              ]

          }

     ],

     "exit":"",

     "iconType":"Auto",

     "instruction":{

          "maneuverType":"TurnRight",

          "text":"Turn right onto James St"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              47.604141,

              -122.328081

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":0.122,

     "travelDuration":23,

     "travelMode":"Driving"

},

                                              149
{

    "compassDirection":"west",

    "details":[

         {

              "compassDegrees":249,

              "endPathIndices":[

                   101

              ],

              "locationCodes":[

                   "114-10561"

              ],

              "maneuverType":"ArriveFinish",

              "mode":"Driving",

              "names":[

                   "James St"

              ],

              "roadType":"Arterial",

              "startPathIndices":[

                   101

              ]

         }

    ],

    "exit":"",

    "hints":[

         {

              "hintType":null,

              "text":"The last intersection is 5TH Ave"

         },

         {

              "hintType":null,

              "text":"If you reach 4TH Ave, you've gone too far"

         }

    ],

    "iconType":"Auto",

                                                                   150
          "instruction":{

               "maneuverType":"ArriveFinish",

               "text":"Arrive at Seattle, WA"

          },

          "maneuverPoint":{

               "type":"Point",

               "coordinates":[

                   47.603559,

                   -122.329436

               ]

          },

          "sideOfStreet":"Unknown",

          "tollZone":"",

          "transitTerminus":"",

          "travelDistance":0,

          "travelDuration":0,

          "travelMode":"Driving"

     }

],

"startLocation":{

     "bbox":[

          47.801086,

          -122.3414,

          47.841423,

          -122.286293

     ],

     "name":"Lynnwood, WA",

     "point":{

          "type":"Point",

          "coordinates":[

               47.825321,

               -122.292412

          ]

     },

                                                151
                      "address":{

                           "adminDistrict":"WA",

                           "adminDistrict2":"Snohomish Co.",

                           "countryRegion":"United States",

                           "formattedAddress":"Lynnwood, WA",

                           "locality":"Lynnwood"

                      },

                      "confidence":"High",

                      "entityType":"PopulatedPlace",

                      "geocodePoints":[

                           {

                               "type":"Point",

                               "coordinates":[

                                    47.825321,

                                    -122.292412

                               ],

                               "calculationMethod":"Rooftop",

                               "usageTypes":[

                                    "Display"

                               ]

                           }

                      ],

                      "matchCodes":[

                           "Good"

                      ]

                 },

                 "travelDistance":26.273,

                 "travelDuration":1094

             }

        ],

        "travelDistance":26.273,

        "travelDuration":1094

    }

]

                                                                152
         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"6dd02c45856d4c34bad86becee21d2c9"

}


Walking Route Example
This example returns a walking route from the Eiffel Tower to the Louvre Museum in Paris,
France. The route is optimized for distance. Responses are shown for both XML and JSON
formats.
http://dev.virtualearth.net/REST/V1/Routes/Walking?wp.0=Eiffel%20Tower&wp.1=louvre%20muse
um&optmz=distance&output=xml&key=BingMapsKey

XML Response
The response for this example contains a Route resource that includes a set of route steps for a
route leg. The steps are defined as a collection of ItineraryItem values.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

    <Copyright>

     Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

    </Copyright>

    <BrandLogoUri>

     http://dev.virtualearth.net/Branding/logo_powered_by.png

    </BrandLogoUri>

    <StatusCode>200</StatusCode>

    <StatusDescription>OK</StatusDescription>

    <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

    <TraceId>

     e23356991f5e43e68900cc6147778d9a

    </TraceId>

    <ResourceSets>

     <ResourceSet>

         <EstimatedTotal>1</EstimatedTotal>


                                                                                              153
     <Resources>

       <Route>

           <Id>

            v62,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m2,o2,t0,wEcpXBNw6NAA=~oHj1SFPg4RQAAOABsjz3PgA=~RWlmZmVsIFRvd2VyLC
BQYXJpcywgRnJhbmNl~~~,w49ZXBP5BNQA=~oHj1SDG/4RQAAOAB0m39PgA=~TG91dnJlLCBQYXJpcywgRnJhbmNl
~~~,k1,u

           </Id>

           <BoundingBox>

            <SouthLatitude>48.857371</SouthLatitude>

            <WestLongitude>2.295273</WestLongitude>

            <NorthLatitude>48.860788</NorthLatitude>

            <EastLongitude>2.340455</EastLongitude>

           </BoundingBox>

           <DistanceUnit>Kilometer</DistanceUnit>

           <DurationUnit>Second</DurationUnit>

           <TravelDistance>3.854</TravelDistance>

           <TravelDuration>2775</TravelDuration>

           <RouteLeg>

            <TravelDistance>3.854</TravelDistance>

            <TravelDuration>2775</TravelDuration>

            <ActualStart>

              <Latitude>48.85791</Latitude>

              <Longitude>2.295273</Longitude>

            </ActualStart>

            <ActualEnd>

              <Latitude>48.860118</Latitude>

              <Longitude>2.340455</Longitude>

            </ActualEnd>

            <StartLocation>

              <Name>Eiffel Tower, Paris, France</Name>

              <Point>

                   <Latitude>48.857929</Latitude>

                   <Longitude>2.29526</Longitude>


                                                                                      154
 </Point>

 <BoundingBox>

   <SouthLatitude>48.85746</SouthLatitude>

   <WestLongitude>2.2933</WestLongitude>

   <NorthLatitude>48.859039</NorthLatitude>

   <EastLongitude>2.29569</EastLongitude>

 </BoundingBox>

 <EntityType>Monument</EntityType>

 <Address>

   <AdminDistrict>IdF</AdminDistrict>

   <AdminDistrict2>Paris</AdminDistrict2>

   <CountryRegion>France</CountryRegion>

   <FormattedAddress>Eiffel Tower, Paris, France</FormattedAddress>

   <Locality>Paris</Locality>

   <Landmark>Eiffel Tower</Landmark>

 </Address>

 <Confidence>High</Confidence>

 <MatchCode>Good</MatchCode>

 <GeocodePoint>

   <Latitude>48.857929</Latitude>

   <Longitude>2.29526</Longitude>

   <CalculationMethod>Rooftop</CalculationMethod>

   <UsageType>Display</UsageType>

 </GeocodePoint>

</StartLocation>

<EndLocation>

 <Name>Louvre, Paris, France</Name>

 <Point>

   <Latitude>48.86013</Latitude>

   <Longitude>2.34043</Longitude>

 </Point>

 <BoundingBox>

   <SouthLatitude>48.859371</SouthLatitude>

   <WestLongitude>2.33046</WestLongitude>

                                                                      155
   <NorthLatitude>48.863522</NorthLatitude>

   <EastLongitude>2.33995</EastLongitude>

 </BoundingBox>

 <EntityType>Museum</EntityType>

 <Address>

   <AdminDistrict>IdF</AdminDistrict>

   <AdminDistrict2>Paris</AdminDistrict2>

   <CountryRegion>France</CountryRegion>

   <FormattedAddress>Louvre, Paris, France</FormattedAddress>

   <Locality>Paris</Locality>

   <Landmark>Louvre</Landmark>

 </Address>

 <Confidence>High</Confidence>

 <MatchCode>Good</MatchCode>

 <GeocodePoint>

   <Latitude>48.86013</Latitude>

   <Longitude>2.34043</Longitude>

   <CalculationMethod>Rooftop</CalculationMethod>

   <UsageType>Display</UsageType>

 </GeocodePoint>

</EndLocation>

<ItineraryItem>

 <TravelMode>Walking</TravelMode>

 <TravelDistance>0.01</TravelDistance>

 <TravelDuration>7</TravelDuration>

 <ManeuverPoint>

   <Latitude>48.85791</Latitude>

   <Longitude>2.295273</Longitude>

 </ManeuverPoint>

 <Instruction maneuverType="DepartStart">

   Depart Avenue Gustave Eiffel toward Avenue Anatole France

 </Instruction>

 <CompassDirection>northeast</CompassDirection>

 <Detail>

                                                                156
               <ManeuverType>DepartStart</ManeuverType>

               <StartPathIndex>0</StartPathIndex>

               <EndPathIndex>1</EndPathIndex>

               <Name>Avenue Gustave Eiffel</Name>

               <CompassDegrees>56</CompassDegrees>

               <Mode>Walking</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Street</RoadType>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Walk</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <TowardsRoadName>Avenue Anatole France</TowardsRoadName>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Walking</TravelMode>

             <TravelDistance>0.134</TravelDistance>

             <TravelDuration>96</TravelDuration>

             <ManeuverPoint>

               <Latitude>48.857982</Latitude>

               <Longitude>2.295381</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="KeepStraight">Keep straight onto
path</Instruction>

             <CompassDirection>east</CompassDirection>

             <Detail>

               <ManeuverType>KeepStraight</ManeuverType>

               <StartPathIndex>1</StartPathIndex>

               <EndPathIndex>4</EndPathIndex>


                                                                           157
   <CompassDegrees>79</CompassDegrees>

   <Mode>Walking</Mode>

   <PreviousEntityId>0</PreviousEntityId>

   <NextEntityId>0</NextEntityId>

   <RoadType>Street</RoadType>

 </Detail>

 <Exit/>

 <TollZone/>

 <TransitTerminus/>

 <IconType>Walk</IconType>

 <Time>0001-01-01T00:00:00</Time>

 <TransitStopId>0</TransitStopId>

 <SideOfStreet>Unknown</SideOfStreet>

</ItineraryItem>

<ItineraryItem>

 <TravelMode>Walking</TravelMode>

 <TravelDistance>0.112</TravelDistance>

 <TravelDuration>80</TravelDuration>

 <ManeuverPoint>

   <Latitude>48.857773</Latitude>

   <Longitude>2.297081</Longitude>

 </ManeuverPoint>

 <Instruction maneuverType="TurnLeftThenBearRight">

   Turn left and then bear right onto Allée Adrienne Lecouvreur

 </Instruction>

 <CompassDirection>southeast</CompassDirection>

 <Detail>

   <ManeuverType>TurnLeft</ManeuverType>

   <StartPathIndex>4</StartPathIndex>

   <EndPathIndex>7</EndPathIndex>

   <CompassDegrees>80</CompassDegrees>

   <Mode>Walking</Mode>

   <PreviousEntityId>0</PreviousEntityId>

   <NextEntityId>0</NextEntityId>

                                                                  158
               <RoadType>Street</RoadType>

             </Detail>

             <Detail>

               <ManeuverType>BearRight</ManeuverType>

               <StartPathIndex>7</StartPathIndex>

               <EndPathIndex>9</EndPathIndex>

               <Name>Allée Adrienne Lecouvreur</Name>

               <CompassDegrees>123</CompassDegrees>

               <Mode>Walking</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Street</RoadType>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Walk</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Walking</TravelMode>

             <TravelDistance>0.15</TravelDistance>

             <TravelDuration>108</TravelDuration>

             <ManeuverPoint>

               <Latitude>48.857371</Latitude>

               <Longitude>2.298181</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="BearLeft">Bear left onto Avenue Émile
Pouvillon</Instruction>

             <CompassDirection>east</CompassDirection>

             <Detail>

               <ManeuverType>BearLeft</ManeuverType>


                                                                                159
               <StartPathIndex>9</StartPathIndex>

               <EndPathIndex>12</EndPathIndex>

               <Name>Avenue Émile Pouvillon</Name>

               <CompassDegrees>79</CompassDegrees>

               <Mode>Walking</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Street</RoadType>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Walk</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Walking</TravelMode>

             <TravelDistance>1.77</TravelDistance>

             <TravelDuration>1274</TravelDuration>

             <ManeuverPoint>

               <Latitude>48.85765</Latitude>

               <Longitude>2.300139</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="RoadNameChange">Road name changes to Rue Saint-
Dominique</Instruction>

             <CompassDirection>east</CompassDirection>

             <Detail>

               <ManeuverType>RoadNameChange</ManeuverType>

               <StartPathIndex>12</StartPathIndex>

               <EndPathIndex>21</EndPathIndex>

               <Name>Rue Saint-Dominique</Name>

               <CompassDegrees>69</CompassDegrees>


                                                                                     160
               <Mode>Walking</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Street</RoadType>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Walk</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Walking</TravelMode>

             <TravelDistance>0.703</TravelDistance>

             <TravelDuration>506</TravelDuration>

             <ManeuverPoint>

               <Latitude>48.858159</Latitude>

               <Longitude>2.322793</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TurnLeft">Turn left onto Rue de
Bellechasse</Instruction>

             <CompassDirection>northeast</CompassDirection>

             <Detail>

               <ManeuverType>TurnLeft</ManeuverType>

               <StartPathIndex>21</StartPathIndex>

               <EndPathIndex>25</EndPathIndex>

               <Name>Rue de Bellechasse</Name>

               <CompassDegrees>45</CompassDegrees>

               <Mode>Walking</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Street</RoadType>


                                                                          161
             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Walk</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Walking</TravelMode>

             <TravelDistance>0.102</TravelDistance>

             <TravelDuration>73</TravelDuration>

             <ManeuverPoint>

               <Latitude>48.859752</Latitude>

               <Longitude>2.329633</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TurnLeft">Turn left onto Pont
Royal</Instruction>

             <CompassDirection>northeast</CompassDirection>

             <Detail>

               <ManeuverType>TurnLeft</ManeuverType>

               <StartPathIndex>25</StartPathIndex>

               <EndPathIndex>27</EndPathIndex>

               <Name>Pont Royal</Name>

               <CompassDegrees>36</CompassDegrees>

               <Mode>Walking</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>MajorRoad</RoadType>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>


                                                                        162
             <IconType>Walk</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Walking</TravelMode>

             <TravelDistance>0.038</TravelDistance>

             <TravelDuration>27</TravelDuration>

             <ManeuverPoint>

               <Latitude>48.860562</Latitude>

               <Longitude>2.330228</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="KeepToStayRight">Keep right to stay on Pont
Royal</Instruction>

             <CompassDirection>east</CompassDirection>

             <Detail>

               <ManeuverType>KeepToStayRight</ManeuverType>

               <StartPathIndex>27</StartPathIndex>

               <EndPathIndex>30</EndPathIndex>

               <Name>Pont Royal</Name>

               <CompassDegrees>73</CompassDegrees>

               <Mode>Walking</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>MajorRoad</RoadType>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Walk</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>


                                                                                      163
           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Walking</TravelMode>

             <TravelDistance>0.703</TravelDistance>

             <TravelDuration>506</TravelDuration>

             <ManeuverPoint>

               <Latitude>48.860691</Latitude>

               <Longitude>2.3307</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="BearRight">Bear right onto Quai François
Mitterrand</Instruction>

             <CompassDirection>east</CompassDirection>

             <Detail>

               <ManeuverType>BearRight</ManeuverType>

               <StartPathIndex>30</StartPathIndex>

               <EndPathIndex>33</EndPathIndex>

               <Name>Quai François Mitterrand</Name>

               <CompassDegrees>103</CompassDegrees>

               <Mode>Walking</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>MajorRoad</RoadType>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Walk</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Walking</TravelMode>

             <TravelDistance>0.132</TravelDistance>


                                                                                   164
             <TravelDuration>95</TravelDuration>

             <ManeuverPoint>

               <Latitude>48.859012</Latitude>

               <Longitude>2.339852</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TurnLeft">Turn left onto Rue de l'Amiral de
Coligny</Instruction>

             <CompassDirection>northeast</CompassDirection>

             <Detail>

               <ManeuverType>TurnLeft</ManeuverType>

               <StartPathIndex>33</StartPathIndex>

               <EndPathIndex>36</EndPathIndex>

               <Name>Rue de l'Amiral de Coligny</Name>

               <CompassDegrees>29</CompassDegrees>

               <Mode>Walking</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Arterial</RoadType>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Walk</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Walking</TravelMode>

             <TravelDistance>0</TravelDistance>

             <TravelDuration>0</TravelDuration>

             <ManeuverPoint>

               <Latitude>48.860118</Latitude>

               <Longitude>2.340455</Longitude>


                                                                                      165
               </ManeuverPoint>

               <Instruction maneuverType="ArriveFinish">Arrive at Louvre, Paris,
France</Instruction>

               <CompassDirection>northeast</CompassDirection>

               <Hint>

                 The last intersection is Place du Louvre / Rue des Prêtres Saint-Germain-
l'Auxerrois

               </Hint>

               <Hint>If you reach Place du Louvre, you've gone too far</Hint>

               <Detail>

                 <ManeuverType>ArriveFinish</ManeuverType>

                 <StartPathIndex>36</StartPathIndex>

                 <EndPathIndex>36</EndPathIndex>

                 <Name>Rue de l'Amiral de Coligny</Name>

                 <CompassDegrees>26</CompassDegrees>

                 <Mode>Walking</Mode>

                 <PreviousEntityId>0</PreviousEntityId>

                 <NextEntityId>0</NextEntityId>

                 <RoadType>Arterial</RoadType>

               </Detail>

               <Exit/>

               <TollZone/>

               <TransitTerminus/>

               <IconType>Walk</IconType>

               <Time>0001-01-01T00:00:00</Time>

               <TransitStopId>0</TransitStopId>

               <SideOfStreet>Unknown</SideOfStreet>

              </ItineraryItem>

              <StartTime>0001-01-01T00:00:00</StartTime>

              <EndTime>0001-01-01T00:00:00</EndTime>

         </RouteLeg>

       </Route>

     </Resources>

   </ResourceSet>


                                                                                       166
    </ResourceSets>

</Response>



JSON Response
You would receive the following JSON response if the output=xml parameter was not set in this
example.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

       {

           "estimatedTotal":1,

           "resources":[

              {



"__type":"Route:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                  "bbox":[

                       48.857371,

                       2.295273,

                       48.860788,

                       2.340455

                  ],

                  "id":"v62,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m2,o2,t0,wEcpXBNw6NAA=~oHj1SFPg4RQAAOABsjz3PgA=~RWlmZmVsIFRvd2VyLC
BQYXJpcywgRnJhbmNl~~~,w49ZXBP5BNQA=~oHj1SDG\/4RQAAOAB0m39PgA=~TG91dnJlLCBQYXJpcywgRnJhbmN
l~~~,k1,u",

                  "distanceUnit":"Kilometer",

                  "durationUnit":"Second",

                  "routeLegs":[

                       {

                           "actualEnd":{


                                                                                            167
     "type":"Point",

     "coordinates":[

          48.860118,

          2.340455

     ]

},

"actualStart":{

     "type":"Point",

     "coordinates":[

          48.85791,

          2.295273

     ]

},

"endLocation":{

     "bbox":[

          48.859371,

          2.33046,

          48.863522,

          2.33995

     ],

     "name":"Louvre, Paris, France",

     "point":{

          "type":"Point",

          "coordinates":[

              48.86013,

              2.34043

          ]

     },

     "address":{

          "adminDistrict":"IdF",

          "adminDistrict2":"Paris",

          "countryRegion":"France",

          "formattedAddress":"Louvre, Paris, France",

          "locality":"Paris",

                                                        168
          "landmark":"Louvre"

     },

     "confidence":"High",

     "entityType":"Museum",

     "geocodePoints":[

          {

              "type":"Point",

              "coordinates":[

                   48.86013,

                   2.34043

              ],

              "calculationMethod":"Rooftop",

              "usageTypes":[

                   "Display"

              ]

          }

     ],

     "matchCodes":[

          "Good"

     ]

},

"itineraryItems":[

     {

          "compassDirection":"northeast",

          "details":[

              {

                   "compassDegrees":56,

                   "endPathIndices":[

                        1

                   ],

                   "maneuverType":"DepartStart",

                   "mode":"Walking",

                   "names":[

                        "Avenue Gustave Eiffel"

                                                   169
                        ],

                        "roadType":"Street",

                        "startPathIndices":[

                             0

                        ]

                    }

               ],

               "exit":"",

               "iconType":"Walk",

               "instruction":{

                    "maneuverType":"DepartStart",

                    "text":"Depart Avenue Gustave Eiffel toward Avenue Anatole
France"

               },

               "maneuverPoint":{

                    "type":"Point",

                    "coordinates":[

                        48.85791,

                        2.295273

                    ]

               },

               "sideOfStreet":"Unknown",

               "tollZone":"",

               "towardsRoadName":"Avenue Anatole France",

               "transitTerminus":"",

               "travelDistance":0.01,

               "travelDuration":7,

               "travelMode":"Walking"

          },

          {

               "compassDirection":"east",

               "details":[

                    {

                        "compassDegrees":79,


                                                                            170
              "endPathIndices":[

                   4

              ],

              "maneuverType":"KeepStraight",

              "mode":"Walking",

              "roadType":"Street",

              "startPathIndices":[

                   1

              ]

          }

     ],

     "exit":"",

     "iconType":"Walk",

     "instruction":{

          "maneuverType":"KeepStraight",

          "text":"Keep straight onto path"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              48.857982,

              2.295381

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":0.134,

     "travelDuration":96,

     "travelMode":"Walking"

},

{

     "compassDirection":"southeast",

     "details":[

                                               171
                   {

                        "compassDegrees":80,

                        "endPathIndices":[

                             7

                        ],

                        "maneuverType":"TurnLeft",

                        "mode":"Walking",

                        "roadType":"Street",

                        "startPathIndices":[

                             4

                        ]

                   },

                   {

                        "compassDegrees":123,

                        "endPathIndices":[

                             9

                        ],

                        "maneuverType":"BearRight",

                        "mode":"Walking",

                        "names":[

                             "Allée Adrienne Lecouvreur"

                        ],

                        "roadType":"Street",

                        "startPathIndices":[

                             7

                        ]

                   }

              ],

              "exit":"",

              "iconType":"Walk",

              "instruction":{

                   "maneuverType":"TurnLeftThenBearRight",

                   "text":"Turn left and then bear right onto Allée Adrienne
Lecouvreur"


                                                                           172
     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              48.857773,

              2.297081

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":0.112,

     "travelDuration":80,

     "travelMode":"Walking"

},

{

     "compassDirection":"east",

     "details":[

          {

              "compassDegrees":79,

              "endPathIndices":[

                   12

              ],

              "maneuverType":"BearLeft",

              "mode":"Walking",

              "names":[

                   "Avenue Émile Pouvillon"

              ],

              "roadType":"Street",

              "startPathIndices":[

                   9

              ]

          }

     ],

                                               173
     "exit":"",

     "iconType":"Walk",

     "instruction":{

          "maneuverType":"BearLeft",

          "text":"Bear left onto Avenue Émile Pouvillon"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              48.857371,

              2.298181

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":0.15,

     "travelDuration":108,

     "travelMode":"Walking"

},

{

     "compassDirection":"east",

     "details":[

          {

              "compassDegrees":69,

              "endPathIndices":[

                   21

              ],

              "maneuverType":"RoadNameChange",

              "mode":"Walking",

              "names":[

                   "Rue Saint-Dominique"

              ],

              "roadType":"Street",

                                                            174
              "startPathIndices":[

                   12

              ]

          }

     ],

     "exit":"",

     "iconType":"Walk",

     "instruction":{

          "maneuverType":"RoadNameChange",

          "text":"Road name changes to Rue Saint-Dominique"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              48.85765,

              2.300139

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":1.77,

     "travelDuration":1274,

     "travelMode":"Walking"

},

{

     "compassDirection":"northeast",

     "details":[

          {

              "compassDegrees":45,

              "endPathIndices":[

                   25

              ],

              "maneuverType":"TurnLeft",

                                                              175
              "mode":"Walking",

              "names":[

                   "Rue de Bellechasse"

              ],

              "roadType":"Street",

              "startPathIndices":[

                   21

              ]

          }

     ],

     "exit":"",

     "iconType":"Walk",

     "instruction":{

          "maneuverType":"TurnLeft",

          "text":"Turn left onto Rue de Bellechasse"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              48.858159,

              2.322793

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":0.703,

     "travelDuration":506,

     "travelMode":"Walking"

},

{

     "compassDirection":"northeast",

     "details":[

          {

                                                       176
         "compassDegrees":36,

         "endPathIndices":[

              27

         ],

         "maneuverType":"TurnLeft",

         "mode":"Walking",

         "names":[

              "Pont Royal"

         ],

         "roadType":"MajorRoad",

         "startPathIndices":[

              25

         ]

     }

],

"exit":"",

"iconType":"Walk",

"instruction":{

     "maneuverType":"TurnLeft",

     "text":"Turn left onto Pont Royal"

},

"maneuverPoint":{

     "type":"Point",

     "coordinates":[

         48.859752,

         2.329633

     ]

},

"sideOfStreet":"Unknown",

"tollZone":"",

"transitTerminus":"",

"travelDistance":0.102,

"travelDuration":73,

"travelMode":"Walking"

                                          177
},

{

     "compassDirection":"east",

     "details":[

          {

              "compassDegrees":73,

              "endPathIndices":[

                   30

              ],

              "maneuverType":"KeepToStayRight",

              "mode":"Walking",

              "names":[

                   "Pont Royal"

              ],

              "roadType":"MajorRoad",

              "startPathIndices":[

                   27

              ]

          }

     ],

     "exit":"",

     "iconType":"Walk",

     "instruction":{

          "maneuverType":"KeepToStayRight",

          "text":"Keep right to stay on Pont Royal"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              48.860562,

              2.330228

          ]

     },

     "sideOfStreet":"Unknown",

                                                      178
     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":0.038,

     "travelDuration":27,

     "travelMode":"Walking"

},

{

     "compassDirection":"east",

     "details":[

          {

              "compassDegrees":103,

              "endPathIndices":[

                   33

              ],

              "maneuverType":"BearRight",

              "mode":"Walking",

              "names":[

                   "Quai François Mitterrand"

              ],

              "roadType":"MajorRoad",

              "startPathIndices":[

                   30

              ]

          }

     ],

     "exit":"",

     "iconType":"Walk",

     "instruction":{

          "maneuverType":"BearRight",

          "text":"Bear right onto Quai François Mitterrand"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

                                                               179
              48.860691,

              2.3307

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":0.703,

     "travelDuration":506,

     "travelMode":"Walking"

},

{

     "compassDirection":"northeast",

     "details":[

          {

              "compassDegrees":29,

              "endPathIndices":[

                   36

              ],

              "maneuverType":"TurnLeft",

              "mode":"Walking",

              "names":[

                   "Rue de l'Amiral de Coligny"

              ],

              "roadType":"Arterial",

              "startPathIndices":[

                   33

              ]

          }

     ],

     "exit":"",

     "iconType":"Walk",

     "instruction":{

          "maneuverType":"TurnLeft",

                                                  180
          "text":"Turn left onto Rue de l'Amiral de Coligny"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              48.859012,

              2.339852

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":0.132,

     "travelDuration":95,

     "travelMode":"Walking"

},

{

     "compassDirection":"northeast",

     "details":[

          {

              "compassDegrees":26,

              "endPathIndices":[

                   36

              ],

              "maneuverType":"ArriveFinish",

              "mode":"Walking",

              "names":[

                   "Rue de l'Amiral de Coligny"

              ],

              "roadType":"Arterial",

              "startPathIndices":[

                   36

              ]

          }

                                                               181
                             ],

                             "exit":"",

                             "hints":[

                                  {

                                       "hintType":null,

                                       "text":"The last intersection is Place du Louvre \/ Rue
des Prêtres Saint-Germain-l'Auxerrois"

                                  },

                                  {

                                       "hintType":null,

                                       "text":"If you reach Place du Louvre, you've gone too
far"

                                  }

                             ],

                             "iconType":"Walk",

                             "instruction":{

                                  "maneuverType":"ArriveFinish",

                                  "text":"Arrive at Louvre, Paris, France"

                             },

                             "maneuverPoint":{

                                  "type":"Point",

                                  "coordinates":[

                                       48.860118,

                                       2.340455

                                  ]

                             },

                             "sideOfStreet":"Unknown",

                             "tollZone":"",

                             "transitTerminus":"",

                             "travelDistance":0,

                             "travelDuration":0,

                             "travelMode":"Walking"

                         }

                    ],


                                                                                               182
"startLocation":{

   "bbox":[

        48.85746,

        2.2933,

        48.859039,

        2.29569

   ],

   "name":"Eiffel Tower, Paris, France",

   "point":{

        "type":"Point",

        "coordinates":[

            48.857929,

            2.29526

        ]

   },

   "address":{

        "adminDistrict":"IdF",

        "adminDistrict2":"Paris",

        "countryRegion":"France",

        "formattedAddress":"Eiffel Tower, Paris, France",

        "locality":"Paris",

        "landmark":"Eiffel Tower"

   },

   "confidence":"High",

   "entityType":"Monument",

   "geocodePoints":[

        {

            "type":"Point",

            "coordinates":[

                 48.857929,

                 2.29526

            ],

            "calculationMethod":"Rooftop",

            "usageTypes":[

                                                            183
                                                "Display"

                                            ]

                                        }

                                   ],

                                   "matchCodes":[

                                        "Good"

                                   ]

                              },

                              "travelDistance":3.854,

                              "travelDuration":2775

                          }

                     ],

                     "travelDistance":3.854,

                     "travelDuration":2775

                 }

             ]

         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"10fc9a17384d4d1096be9e428af7d32a"

}


Transit Route Example
The following example shows how to request a transit route between the Golden Gate Bridge and
Fisherman’s Wharf in San Francisco for 3 PM on the current day. Responses are shown for both
XML and JSON formats.
http://dev.virtualearth.net/REST/V1/Routes/Transit?wp.0=Golden%20Gate%20Bridge&wp.1=Fishe
rmans%20Wharf&timeType=Departure&dateTime=3:00:00PM&output=xml&key=BingMapsKey

XML Response
The response for this example contains a Route resource that provides walking instructions and
transit information for the route.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

    <Copyright>

                                                                                            184
   Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

 </Copyright>

 <BrandLogoUri>

   http://dev.virtualearth.net/Branding/logo_powered_by.png

 </BrandLogoUri>

 <StatusCode>200</StatusCode>

 <StatusDescription>OK</StatusDescription>

 <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

 <TraceId>

   5449c40063b0462596698e263e235aa7

 </TraceId>

 <ResourceSets>

   <ResourceSet>

       <EstimatedTotal>1</EstimatedTotal>

       <Resources>

        <Route>

          <Id>

             v62,i0,a0,cen-
US,dANjBD75mzgg=,y1,s1,m4,o1,t0,wjpNcA4TvHPU=~rrD3jQAAAAAAAAAAAAAAAAA=~R29sZGVuIEdhdGUgQn
JpZGdlLCBDQQ==~~~,wHE9cA+mTHvU=~rrD3jQAAAAAAAAAAAAAAAAA=~RmlzaGVybWFuJ3MgV2hhcmYsIENB~~~,
k1,u

          </Id>

          <BoundingBox>

             <SouthLatitude>37.798793</SouthLatitude>

             <WestLongitude>-122.478416</WestLongitude>

             <NorthLatitude>37.818312</NorthLatitude>

             <EastLongitude>-122.40625</EastLongitude>

          </BoundingBox>

          <DistanceUnit>Kilometer</DistanceUnit>

          <DurationUnit>Second</DurationUnit>

          <TravelDistance>2.363</TravelDistance>

          <TravelDuration>3416</TravelDuration>

          <RouteLeg>

                                                                                         185
<TravelDistance>2.363</TravelDistance>

<TravelDuration>3416</TravelDuration>

<ActualStart>

 <Latitude>37.807561</Latitude>

 <Longitude>-122.475024</Longitude>

</ActualStart>

<ActualEnd>

 <Latitude>37.80551</Latitude>

 <Longitude>-122.41784</Longitude>

</ActualEnd>

<StartLocation>

 <Name>Golden Gate Bridge, CA</Name>

 <Point>

   <Latitude>37.818298</Latitude>

   <Longitude>-122.478416</Longitude>

 </Point>

 <BoundingBox>

   <SouthLatitude>37.789328</SouthLatitude>

   <WestLongitude>-122.527295</WestLongitude>

   <NorthLatitude>37.847269</NorthLatitude>

   <EastLongitude>-122.429538</EastLongitude>

 </BoundingBox>

 <EntityType>Bridge</EntityType>

 <Address>

   <AdminDistrict>CA</AdminDistrict>

   <CountryRegion>United States</CountryRegion>

   <FormattedAddress>Golden Gate Bridge, CA</FormattedAddress>

   <Landmark>Golden Gate Bridge</Landmark>

 </Address>

 <Confidence>High</Confidence>

 <MatchCode>Good</MatchCode>

 <GeocodePoint>

   <Latitude>37.818298</Latitude>

   <Longitude>-122.478416</Longitude>

                                                                 186
   <CalculationMethod>Rooftop</CalculationMethod>

   <UsageType>Display</UsageType>

 </GeocodePoint>

</StartLocation>

<EndLocation>

 <Name>Fisherman's Wharf, CA</Name>

 <Point>

   <Latitude>37.806549</Latitude>

   <Longitude>-122.40625</Longitude>

 </Point>

 <BoundingBox>

   <SouthLatitude>37.777579</SouthLatitude>

   <WestLongitude>-122.455121</WestLongitude>

   <NorthLatitude>37.835519</NorthLatitude>

   <EastLongitude>-122.357379</EastLongitude>

 </BoundingBox>

 <EntityType>PopulatedPlace</EntityType>

 <Address>

   <AdminDistrict>CA</AdminDistrict>

   <AdminDistrict2>San Francisco Co.</AdminDistrict2>

   <CountryRegion>United States</CountryRegion>

   <FormattedAddress>Fisherman's Wharf, CA</FormattedAddress>

   <Locality>Fisherman's Wharf</Locality>

 </Address>

 <Confidence>High</Confidence>

 <MatchCode>Good</MatchCode>

 <GeocodePoint>

   <Latitude>37.806549</Latitude>

   <Longitude>-122.40625</Longitude>

   <CalculationMethod>Rooftop</CalculationMethod>

   <UsageType>Display</UsageType>

 </GeocodePoint>

</EndLocation>

<ItineraryItem>

                                                                187
 <TravelMode>Transit</TravelMode>

 <TravelDistance>1.307</TravelDistance>

 <TravelDuration>941</TravelDuration>

 <ManeuverPoint>

   <Latitude>37.818298</Latitude>

   <Longitude>-122.478416</Longitude>

 </ManeuverPoint>

 <Instruction maneuverType="DepartStart">

   Walk: From Golden Gate Bridge, CA to Golden Gate Bridge/Parking Lot

 </Instruction>

 <CompassDirection/>

 <Detail>

   <ManeuverType>Walk</ManeuverType>

   <StartPathIndex>0</StartPathIndex>

   <EndPathIndex>8</EndPathIndex>

   <CompassDegrees>0</CompassDegrees>

   <Mode>Transit</Mode>

   <PreviousEntityId>0</PreviousEntityId>

   <NextEntityId>0</NextEntityId>

   <RoadType>NotApplicable</RoadType>

 </Detail>

 <Exit/>

 <TollZone/>

 <TransitTerminus/>

 <IconType>Walk</IconType>

 <Time>0001-01-01T00:00:00</Time>

 <TransitStopId>0</TransitStopId>

 <SideOfStreet>Unknown</SideOfStreet>

</ItineraryItem>

<ItineraryItem>

 <TravelMode>Transit</TravelMode>

 <TravelDistance>0</TravelDistance>

 <TravelDuration>711</TravelDuration>

 <ManeuverPoint>

                                                                         188
               <Latitude>37.807561</Latitude>

               <Longitude>-122.475024</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TakeTransit">Bus: Take 28 - Fort
Mason</Instruction>

             <CompassDirection/>

             <Hint>Previous stop is Lombard St & Fillmore St</Hint>

             <Hint>

               If you reach Buchanan St & Bay St, you've gone too far

             </Hint>

             <Detail>

               <ManeuverType>TakeTransit</ManeuverType>

               <StartPathIndex>8</StartPathIndex>

               <EndPathIndex>35</EndPathIndex>

               <CompassDegrees>0</CompassDegrees>

               <Mode>Transit</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>NotApplicable</RoadType>

             </Detail>

             <ChildItineraryItems>

               <ItineraryItem>

                 <TravelMode>Driving</TravelMode>

                 <TravelDistance>0</TravelDistance>

                 <TravelDuration>0</TravelDuration>

                 <ManeuverPoint>

                      <Latitude>0</Latitude>

                      <Longitude>0</Longitude>

                 </ManeuverPoint>

                 <Instruction maneuverType="TransitDepart">Depart: Golden Gate
Bridge/Parking Lot</Instruction>

                 <CompassDirection/>

                 <Detail>

                      <ManeuverType>TransitDepart</ManeuverType>


                                                                                 189
                    <Name>Golden Gate Bridge/Parking Lot</Name>

                    <CompassDegrees>0</CompassDegrees>

                    <Mode>Driving</Mode>

                    <PreviousEntityId>0</PreviousEntityId>

                    <NextEntityId>0</NextEntityId>

                    <RoadType>None</RoadType>

                   </Detail>

                   <Exit/>

                   <TollZone/>

                   <TransitTerminus/>

                   <IconType>None</IconType>

                   <Time>2011-11-01T15:17:43</Time>

                   <TransitStopId>100966</TransitStopId>

                   <SideOfStreet>Unknown</SideOfStreet>

               </ItineraryItem>

               <ItineraryItem>

                   <TravelMode>Driving</TravelMode>

                   <TravelDistance>0</TravelDistance>

                   <TravelDuration>0</TravelDuration>

                   <ManeuverPoint>

                    <Latitude>0</Latitude>

                    <Longitude>0</Longitude>

                   </ManeuverPoint>

                   <Instruction maneuverType="TransitArrive">Arrive: Laguna St & Chestnut
St</Instruction>

                   <CompassDirection/>

                   <Detail>

                    <ManeuverType>TransitArrive</ManeuverType>

                    <Name>Laguna St & Chestnut St</Name>

                    <CompassDegrees>0</CompassDegrees>

                    <Mode>Driving</Mode>

                    <PreviousEntityId>0</PreviousEntityId>

                    <NextEntityId>0</NextEntityId>

                    <RoadType>None</RoadType>


                                                                                       190
     </Detail>

     <Exit/>

     <TollZone/>

     <TransitTerminus/>

     <IconType>None</IconType>

     <Time>2011-11-01T15:29:34</Time>

     <TransitStopId>101446</TransitStopId>

     <SideOfStreet>Unknown</SideOfStreet>

   </ItineraryItem>

 </ChildItineraryItems>

 <Exit/>

 <TollZone/>

 <TransitTerminus>Fort Mason</TransitTerminus>

 <IconType>Bus</IconType>

 <Time>0001-01-01T00:00:00</Time>

 <TransitStopId>0</TransitStopId>

 <TransitLine>

   <VerboseName>19TH AVENUE</VerboseName>

   <AbbreviatedName>28</AbbreviatedName>

   <AgencyId>30</AgencyId>

   <AgencyName>San Francisco Municipal Transportation Agency</AgencyName>

   <LineColor>16777215</LineColor>

   <LineTextColor>16777215</LineTextColor>

   <Uri>http://www.sfmta.com</Uri>

   <PhoneNumber/>

   <ProviderInfo>

     Service Provider: San Francisco Municipal Transportation Agency

   </ProviderInfo>

 </TransitLine>

 <SideOfStreet>Unknown</SideOfStreet>

</ItineraryItem>

<ItineraryItem>

 <TravelMode>Transit</TravelMode>

 <TravelDistance>0.011</TravelDistance>

                                                                            191
 <TravelDuration>60</TravelDuration>

 <ManeuverPoint>

   <Latitude>37.80135</Latitude>

   <Longitude>-122.43123</Longitude>

 </ManeuverPoint>

 <Instruction maneuverType="Walk">

   Walk: From Laguna St & Chestnut St to Chestnut St & Laguna St

 </Instruction>

 <CompassDirection/>

 <Hint>8 minutes to make the connection</Hint>

 <Detail>

   <ManeuverType>Walk</ManeuverType>

   <StartPathIndex>35</StartPathIndex>

   <EndPathIndex>38</EndPathIndex>

   <CompassDegrees>0</CompassDegrees>

   <Mode>Transit</Mode>

   <PreviousEntityId>0</PreviousEntityId>

   <NextEntityId>0</NextEntityId>

   <RoadType>NotApplicable</RoadType>

 </Detail>

 <Exit/>

 <TollZone/>

 <TransitTerminus/>

 <IconType>Walk</IconType>

 <Time>0001-01-01T00:00:00</Time>

 <TransitStopId>0</TransitStopId>

 <SideOfStreet>Unknown</SideOfStreet>

</ItineraryItem>

<ItineraryItem>

 <TravelMode>Transit</TravelMode>

 <TravelDistance>0</TravelDistance>

 <TravelDuration>532</TravelDuration>

 <ManeuverPoint>

   <Latitude>37.80137</Latitude>

                                                                   192
               <Longitude>-122.431406</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TakeTransit">Bus: Take 30 - Townsend & 4 th
St.</Instruction>

             <CompassDirection/>

             <Hint>Previous stop is North Point St & Hyde St</Hint>

             <Hint>

               If you reach Columbus Ave & Francisco St, you've gone too far

             </Hint>

             <Detail>

               <ManeuverType>TakeTransit</ManeuverType>

               <StartPathIndex>38</StartPathIndex>

               <EndPathIndex>46</EndPathIndex>

               <CompassDegrees>0</CompassDegrees>

               <Mode>Transit</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>NotApplicable</RoadType>

             </Detail>

             <ChildItineraryItems>

               <ItineraryItem>

                    <TravelMode>Driving</TravelMode>

                    <TravelDistance>0</TravelDistance>

                    <TravelDuration>0</TravelDuration>

                    <ManeuverPoint>

                     <Latitude>0</Latitude>

                     <Longitude>0</Longitude>

                    </ManeuverPoint>

                    <Instruction maneuverType="TransitDepart">Depart: Chestnut St & Laguna
St</Instruction>

                    <CompassDirection/>

                    <Detail>

                     <ManeuverType>TransitDepart</ManeuverType>

                     <Name>Chestnut St & Laguna St</Name>


                                                                                        193
                    <CompassDegrees>0</CompassDegrees>

                    <Mode>Driving</Mode>

                    <PreviousEntityId>0</PreviousEntityId>

                    <NextEntityId>0</NextEntityId>

                    <RoadType>None</RoadType>

                   </Detail>

                   <Exit/>

                   <TollZone/>

                   <TransitTerminus/>

                   <IconType>None</IconType>

                   <Time>2011-11-01T15:37:34</Time>

                   <TransitStopId>100197</TransitStopId>

                   <SideOfStreet>Unknown</SideOfStreet>

               </ItineraryItem>

               <ItineraryItem>

                   <TravelMode>Driving</TravelMode>

                   <TravelDistance>0</TravelDistance>

                   <TravelDuration>0</TravelDuration>

                   <ManeuverPoint>

                    <Latitude>0</Latitude>

                    <Longitude>0</Longitude>

                   </ManeuverPoint>

                   <Instruction maneuverType="TransitArrive">Arrive: Columbus Ave & Bay
St</Instruction>

                   <CompassDirection/>

                   <Detail>

                    <ManeuverType>TransitArrive</ManeuverType>

                    <Name>Columbus Ave & Bay St</Name>

                    <CompassDegrees>0</CompassDegrees>

                    <Mode>Driving</Mode>

                    <PreviousEntityId>0</PreviousEntityId>

                    <NextEntityId>0</NextEntityId>

                    <RoadType>None</RoadType>

                   </Detail>


                                                                                          194
     <Exit/>

     <TollZone/>

     <TransitTerminus/>

     <IconType>None</IconType>

     <Time>2011-11-01T15:46:26</Time>

     <TransitStopId>100337</TransitStopId>

     <SideOfStreet>Unknown</SideOfStreet>

   </ItineraryItem>

 </ChildItineraryItems>

 <Exit/>

 <TollZone/>

 <TransitTerminus>Townsend & 4 th St.</TransitTerminus>

 <IconType>Bus</IconType>

 <Time>0001-01-01T00:00:00</Time>

 <TransitStopId>0</TransitStopId>

 <TransitLine>

   <VerboseName>STOCKTON</VerboseName>

   <AbbreviatedName>30</AbbreviatedName>

   <AgencyId>30</AgencyId>

   <AgencyName>San Francisco Municipal Transportation Agency</AgencyName>

   <LineColor>16777215</LineColor>

   <LineTextColor>16777215</LineTextColor>

   <Uri>http://www.sfmta.com</Uri>

   <PhoneNumber/>

   <ProviderInfo>

     Service Provider: San Francisco Municipal Transportation Agency

   </ProviderInfo>

 </TransitLine>

 <SideOfStreet>Unknown</SideOfStreet>

</ItineraryItem>

<ItineraryItem>

 <TravelMode>Transit</TravelMode>

 <TravelDistance>1.045</TravelDistance>

 <TravelDuration>752</TravelDuration>

                                                                            195
               <ManeuverPoint>

                 <Latitude>37.80551</Latitude>

                 <Longitude>-122.41784</Longitude>

               </ManeuverPoint>

               <Instruction maneuverType="ArriveFinish">

                 Walk: From Columbus Ave & Bay St to Fisherman's Wharf, CA

               </Instruction>

               <CompassDirection/>

               <Detail>

                 <ManeuverType>Walk</ManeuverType>

                 <StartPathIndex>46</StartPathIndex>

                 <EndPathIndex>50</EndPathIndex>

                 <CompassDegrees>0</CompassDegrees>

                 <Mode>Transit</Mode>

                 <PreviousEntityId>0</PreviousEntityId>

                 <NextEntityId>0</NextEntityId>

                 <RoadType>NotApplicable</RoadType>

               </Detail>

               <Exit/>

               <TollZone/>

               <TransitTerminus/>

               <IconType>Walk</IconType>

               <Time>0001-01-01T00:00:00</Time>

               <TransitStopId>0</TransitStopId>

               <SideOfStreet>Unknown</SideOfStreet>

              </ItineraryItem>

              <StartTime>2011-11-01T15:02:02</StartTime>

              <EndTime>2011-11-01T15:58:58</EndTime>

         </RouteLeg>

       </Route>

     </Resources>

   </ResourceSet>

 </ResourceSets>

</Response>

                                                                             196
JSON Response
You would receive the following JSON response if the output=xml parameter was not set in this
example.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

      {

          "estimatedTotal":1,

          "resources":[

            {



"__type":"Route:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                 "bbox":[

                      37.798793,

                      -122.478416,

                      37.818312,

                      -122.40625

                 ],

                 "id":"v62,i0,a0,cen-
US,dANjBD75mzgg=,y1,s1,m4,o1,t0,wjpNcA4TvHPU=~rrD3jQAAAAAAAAAAAAAAAAA=~R29sZGVuIEdhdGUgQn
JpZGdlLCBDQQ==~~~,wHE9cA+mTHvU=~rrD3jQAAAAAAAAAAAAAAAAA=~RmlzaGVybWFuJ3MgV2hhcmYsIENB~~~,
k1,u",

                 "distanceUnit":"Kilometer",

                 "durationUnit":"Second",

                 "routeLegs":[

                      {

                          "actualEnd":{

                             "type":"Point",

                             "coordinates":[


                                                                                            197
          37.80551,

          -122.41784

     ]

},

"actualStart":{

     "type":"Point",

     "coordinates":[

          37.807561,

          -122.475024

     ]

},

"endLocation":{

     "bbox":[

          37.777579,

          -122.455121,

          37.835519,

          -122.357379

     ],

     "name":"Fisherman's Wharf, CA",

     "point":{

          "type":"Point",

          "coordinates":[

              37.806549,

              -122.40625

          ]

     },

     "address":{

          "adminDistrict":"CA",

          "adminDistrict2":"San Francisco Co.",

          "countryRegion":"United States",

          "formattedAddress":"Fisherman's Wharf, CA",

          "locality":"Fisherman's Wharf"

     },

     "confidence":"High",

                                                        198
     "entityType":"PopulatedPlace",

     "geocodePoints":[

          {

              "type":"Point",

              "coordinates":[

                   37.806549,

                   -122.40625

              ],

              "calculationMethod":"Rooftop",

              "usageTypes":[

                   "Display"

              ]

          }

     ],

     "matchCodes":[

          "Good"

     ]

},

"endTime":"\/Date(1320188338000-0700)\/",

"itineraryItems":[

     {

          "compassDirection":"",

          "details":[

              {

                   "endPathIndices":[

                        8

                   ],

                   "maneuverType":"Walk",

                   "mode":"Transit",

                   "roadType":"NotApplicable",

                   "startPathIndices":[

                        0

                   ]

              }

                                                 199
                            ],

                            "exit":"",

                            "iconType":"Walk",

                            "instruction":{

                                 "maneuverType":"DepartStart",

                                 "text":"Walk: From Golden Gate Bridge, CA to Golden Gate
Bridge\/Parking Lot"

                            },

                            "maneuverPoint":{

                                 "type":"Point",

                                 "coordinates":[

                                     37.818298,

                                     -122.478416

                                 ]

                            },

                            "sideOfStreet":"Unknown",

                            "tollZone":"",

                            "transitTerminus":"",

                            "travelDistance":1.307,

                            "travelDuration":941,

                            "travelMode":"Transit"

                       },

                       {

                            "childItineraryItems":[

                                 {

                                     "compassDirection":"",

                                     "details":[

                                       {

                                           "maneuverType":"TransitDepart",

                                           "mode":"Driving",

                                           "names":[

                                                "Golden Gate Bridge\/Parking Lot"

                                           ],

                                           "roadType":"None"


                                                                                            200
          }

     ],

     "exit":"",

     "iconType":"None",

     "instruction":{

          "maneuverType":"TransitDepart",

          "text":"Depart: Golden Gate Bridge\/Parking Lot"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              0,

              0

          ]

     },

     "sideOfStreet":"Unknown",

     "time":"\/Date(1320185863000-0700)\/",

     "tollZone":"",

     "transitStopId":100966,

     "transitTerminus":"",

     "travelDistance":0,

     "travelDuration":0,

     "travelMode":"Driving"

},

{

     "compassDirection":"",

     "details":[

          {

              "maneuverType":"TransitArrive",

              "mode":"Driving",

              "names":[

                   "Laguna St & Chestnut St"

              ],

              "roadType":"None"

                                                             201
              }

         ],

         "exit":"",

         "iconType":"None",

         "instruction":{

              "maneuverType":"TransitArrive",

              "text":"Arrive: Laguna St & Chestnut St"

         },

         "maneuverPoint":{

              "type":"Point",

              "coordinates":[

                   0,

                   0

              ]

         },

         "sideOfStreet":"Unknown",

         "time":"\/Date(1320186574000-0700)\/",

         "tollZone":"",

         "transitStopId":101446,

         "transitTerminus":"",

         "travelDistance":0,

         "travelDuration":0,

         "travelMode":"Driving"

     }

],

"compassDirection":"",

"details":[

     {

         "endPathIndices":[

              35

         ],

         "maneuverType":"TakeTransit",

         "mode":"Transit",

         "roadType":"NotApplicable",

                                                         202
                     "startPathIndices":[

                         8

                     ]

                }

           ],

           "exit":"",

           "hints":[

                {

                     "hintType":null,

                     "text":"Previous stop is Lombard St & Fillmore St"

                },

                {

                     "hintType":null,

                     "text":"If you reach Buchanan St & Bay St, you've gone
too far"

                }

           ],

           "iconType":"Bus",

           "instruction":{

                "maneuverType":"TakeTransit",

                "text":"Bus: Take 28 - Fort Mason"

           },

           "maneuverPoint":{

                "type":"Point",

                "coordinates":[

                     37.807561,

                     -122.475024

                ]

           },

           "sideOfStreet":"Unknown",

           "tollZone":"",

           "transitLine":{

                "abbreviatedName":"28",

                "agencyId":30,


                                                                          203
                                     "agencyName":"San Francisco Municipal Transportation
Agency",

                                     "lineColor":16777215,

                                     "lineTextColor":16777215,

                                     "phoneNumber":"",

                                     "providerInfo":"Service Provider: San Francisco Municipal
Transportation Agency ",

                                     "uri":"http:\/\/www.sfmta.com",

                                     "verboseName":"19TH AVENUE"

                                },

                                "transitTerminus":"Fort Mason",

                                "travelDistance":0,

                                "travelDuration":711,

                                "travelMode":"Transit"

                           },

                           {

                                "compassDirection":"",

                                "details":[

                                     {

                                         "endPathIndices":[

                                              38

                                         ],

                                         "maneuverType":"Walk",

                                         "mode":"Transit",

                                         "roadType":"NotApplicable",

                                         "startPathIndices":[

                                              35

                                         ]

                                     }

                                ],

                                "exit":"",

                                "hints":[

                                     {

                                         "hintType":null,


                                                                                             204
                           "text":"8 minutes to make the connection"

                       }

                  ],

                  "iconType":"Walk",

                  "instruction":{

                       "maneuverType":"Walk",

                       "text":"Walk: From Laguna St & Chestnut St to Chestnut St &
Laguna St"

                  },

                  "maneuverPoint":{

                       "type":"Point",

                       "coordinates":[

                           37.80135,

                           -122.43123

                       ]

                  },

                  "sideOfStreet":"Unknown",

                  "tollZone":"",

                  "transitTerminus":"",

                  "travelDistance":0.011,

                  "travelDuration":60,

                  "travelMode":"Transit"

             },

             {

                  "childItineraryItems":[

                       {

                           "compassDirection":"",

                           "details":[

                             {

                                 "maneuverType":"TransitDepart",

                                 "mode":"Driving",

                                 "names":[

                                      "Chestnut St & Laguna St"

                                 ],


                                                                               205
              "roadType":"None"

          }

     ],

     "exit":"",

     "iconType":"None",

     "instruction":{

          "maneuverType":"TransitDepart",

          "text":"Depart: Chestnut St & Laguna St"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              0,

              0

          ]

     },

     "sideOfStreet":"Unknown",

     "time":"\/Date(1320187054000-0700)\/",

     "tollZone":"",

     "transitStopId":100197,

     "transitTerminus":"",

     "travelDistance":0,

     "travelDuration":0,

     "travelMode":"Driving"

},

{

     "compassDirection":"",

     "details":[

          {

              "maneuverType":"TransitArrive",

              "mode":"Driving",

              "names":[

                   "Columbus Ave & Bay St"

              ],

                                                     206
                   "roadType":"None"

              }

         ],

         "exit":"",

         "iconType":"None",

         "instruction":{

              "maneuverType":"TransitArrive",

              "text":"Arrive: Columbus Ave & Bay St"

         },

         "maneuverPoint":{

              "type":"Point",

              "coordinates":[

                   0,

                   0

              ]

         },

         "sideOfStreet":"Unknown",

         "time":"\/Date(1320187586000-0700)\/",

         "tollZone":"",

         "transitStopId":100337,

         "transitTerminus":"",

         "travelDistance":0,

         "travelDuration":0,

         "travelMode":"Driving"

     }

],

"compassDirection":"",

"details":[

     {

         "endPathIndices":[

              46

         ],

         "maneuverType":"TakeTransit",

         "mode":"Transit",

                                                       207
                          "roadType":"NotApplicable",

                          "startPathIndices":[

                              38

                          ]

                     }

                ],

                "exit":"",

                "hints":[

                     {

                          "hintType":null,

                          "text":"Previous stop is North Point St & Hyde St"

                     },

                     {

                          "hintType":null,

                          "text":"If you reach Columbus Ave & Francisco St, you've
gone too far"

                     }

                ],

                "iconType":"Bus",

                "instruction":{

                     "maneuverType":"TakeTransit",

                     "text":"Bus: Take 30 - Townsend & 4 th St."

                },

                "maneuverPoint":{

                     "type":"Point",

                     "coordinates":[

                          37.80137,

                          -122.431406

                     ]

                },

                "sideOfStreet":"Unknown",

                "tollZone":"",

                "transitLine":{

                     "abbreviatedName":"30",


                                                                               208
                                     "agencyId":30,

                                     "agencyName":"San Francisco Municipal Transportation
Agency",

                                     "lineColor":16777215,

                                     "lineTextColor":16777215,

                                     "phoneNumber":"",

                                     "providerInfo":"Service Provider: San Francisco Municipal
Transportation Agency ",

                                     "uri":"http:\/\/www.sfmta.com",

                                     "verboseName":"STOCKTON"

                                },

                                "transitTerminus":"Townsend & 4 th St.",

                                "travelDistance":0,

                                "travelDuration":532,

                                "travelMode":"Transit"

                           },

                           {

                                "compassDirection":"",

                                "details":[

                                     {

                                         "endPathIndices":[

                                              50

                                         ],

                                         "maneuverType":"Walk",

                                         "mode":"Transit",

                                         "roadType":"NotApplicable",

                                         "startPathIndices":[

                                              46

                                         ]

                                     }

                                ],

                                "exit":"",

                                "iconType":"Walk",

                                "instruction":{


                                                                                             209
                            "maneuverType":"ArriveFinish",

                            "text":"Walk: From Columbus Ave & Bay St to Fisherman's
Wharf, CA"

                       },

                       "maneuverPoint":{

                            "type":"Point",

                            "coordinates":[

                                37.80551,

                                -122.41784

                            ]

                       },

                       "sideOfStreet":"Unknown",

                       "tollZone":"",

                       "transitTerminus":"",

                       "travelDistance":1.045,

                       "travelDuration":752,

                       "travelMode":"Transit"

                  }

             ],

             "startLocation":{

                  "bbox":[

                       37.789328,

                       -122.527295,

                       37.847269,

                       -122.429538

                  ],

                  "name":"Golden Gate Bridge, CA",

                  "point":{

                       "type":"Point",

                       "coordinates":[

                            37.818298,

                            -122.478416

                       ]

                  },


                                                                                      210
                      "address":{

                           "adminDistrict":"CA",

                           "countryRegion":"United States",

                           "formattedAddress":"Golden Gate Bridge, CA",

                           "landmark":"Golden Gate Bridge"

                      },

                      "confidence":"High",

                      "entityType":"Bridge",

                      "geocodePoints":[

                           {

                               "type":"Point",

                               "coordinates":[

                                    37.818298,

                                    -122.478416

                               ],

                               "calculationMethod":"Rooftop",

                               "usageTypes":[

                                    "Display"

                               ]

                           }

                      ],

                      "matchCodes":[

                           "Good"

                      ]

                 },

                 "startTime":"\/Date(1320184922000-0700)\/",

                 "travelDistance":2.363,

                 "travelDuration":3416

             }

        ],

        "travelDistance":2.363,

        "travelDuration":3416

    }

]

                                                                          211
         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"ce523ad2a0b84f23b27176d428e29298|BR1M007702|02.00.70.2800|BR1MSNVM007519,
BR1MSNVM007509, BR1MSNVM007522, BR1MSNVM007520"

}

See Also
Bing Maps Transit Coverage

Driving Route with Route Path Example
This example returns a driving route from the Minneapolis, Minnesota to St. Paul, Minnesota. The
route is optimized for distance and requests point values for the route’s path. Results are shown
for both JSON and XML response formats..
http://dev.virtualearth.net/REST/V1/Routes/Driving?wp.0=Minneapolis,MN&wp.1=St%20Paul,MN&
optmz=distance&rpo=Points&key=BingMapsKey

JSON Response
The response for this example contains a Route resource with a set of ItineraryItem values that
provide route steps. It also provides a set of points (latitude and longitude) that define the route’s
path.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

         {

             "estimatedTotal":1,

             "resources":[

               {



"__type":"Route:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                   "bbox":[

                     44.943738,

                     -93.264908,

                                                                                                   212
                   44.979942,

                   -93.093325

              ],

              "id":"v62,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m1,o2,t4,w2YX\/A2a0tfc=~XpeTlHEqBQgAAOABAAAAAAA=~TWlubmVhcG9saXMsI
E1O~~~,wvLj+Axacufc=~XpeTlAElEggAAOAB1BkBPwA=~U3QgUGF1bCwgTU4=~~~,k1,u",

              "distanceUnit":"Kilometer",

              "durationUnit":"Second",

              "routeLegs":[

                   {

                       "actualEnd":{

                            "type":"Point",

                            "coordinates":[

                                 44.943829,

                                 -93.093325

                            ]

                       },

                       "actualStart":{

                            "type":"Point",

                            "coordinates":[

                                 44.979063,

                                 -93.264908

                            ]

                       },

                       "endLocation":{

                            "bbox":[

                                 44.607239,

                                 -93.884979,

                                 45.300064,

                                 -92.301086

                            ],

                            "name":"St Paul, MN",

                            "point":{

                                 "type":"Point",


                                                                                      213
          "coordinates":[

              44.943821,

              -93.093323

          ]

     },

     "address":{

          "adminDistrict":"MN",

          "adminDistrict2":"Ramsey Co.",

          "countryRegion":"United States",

          "formattedAddress":"St Paul, MN",

          "locality":"St Paul"

     },

     "confidence":"High",

     "entityType":"PopulatedPlace",

     "geocodePoints":[

          {

              "type":"Point",

              "coordinates":[

                   44.943821,

                   -93.093323

              ],

              "calculationMethod":"Rooftop",

              "usageTypes":[

                   "Display"

              ]

          }

     ],

     "matchCodes":[

          "Good"

     ]

},

"itineraryItems":[

     {

          "compassDirection":"northeast",

                                               214
         "details":[

              {

                  "compassDegrees":41,

                  "endPathIndices":[

                       2

                  ],

                  "locationCodes":[

                       "118+05098",

                       "118P05098"

                  ],

                  "maneuverType":"DepartStart",

                  "mode":"Driving",

                  "names":[

                       "S 3RD Ave"

                  ],

                  "roadType":"MajorRoad",

                  "startPathIndices":[

                       0

                  ]

              }

         ],

         "exit":"",

         "iconType":"Auto",

         "instruction":{

              "maneuverType":"DepartStart",

              "text":"Depart S 3RD Ave toward S Washington Ave \/ CR-152
South"

         },

         "maneuverPoint":{

              "type":"Point",

              "coordinates":[

                  44.979063,

                  -93.264908

              ]


                                                                      215
     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "towardsRoadName":"S Washington Ave \/ CR-152 South",

     "transitTerminus":"",

     "travelDistance":0.118,

     "travelDuration":30,

     "travelMode":"Driving"

},

{

     "compassDirection":"southeast",

     "details":[

          {

              "compassDegrees":113,

              "endPathIndices":[

                   11

              ],

              "locationCodes":[

                   "118-06272",

                   "118N06272",

                   "118-05155",

                   "118-05154",

                   "118N05154",

                   "118-05153"

              ],

              "maneuverType":"TurnRight",

              "mode":"Driving",

              "names":[

                   "S Washington Ave"

              ],

              "roadShieldRequestParameters":{

                   "bucket":50428,

                   "shields":[

                        {

                                                             216
                           "labels":[

                                "65"

                           ],

                           "roadShieldType":3

                       }

                   ]

              },

              "roadType":"Arterial",

              "startPathIndices":[

                   2

              ]

          }

     ],

     "exit":"",

     "iconType":"Auto",

     "instruction":{

          "maneuverType":"TurnRight",

          "text":"Turn right onto MN-65 South \/ S Washington Ave"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              44.979942,

              -93.264141

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":1.843,

     "travelDuration":251,

     "travelMode":"Driving"

},

{

                                                                     217
"compassDirection":"east",

"details":[

     {

         "compassDegrees":112,

         "endPathIndices":[

              13

         ],

         "locationCodes":[

              "118N15600",

              "118-15599"

         ],

         "maneuverType":"TurnLeft",

         "mode":"Driving",

         "names":[

              "Riverside Ave"

         ],

         "roadType":"Arterial",

         "startPathIndices":[

              11

         ]

     }

],

"exit":"",

"iconType":"Auto",

"instruction":{

     "maneuverType":"TurnLeft",

     "text":"Turn left onto Riverside Ave \/ CR-48"

},

"maneuverPoint":{

     "type":"Point",

     "coordinates":[

         44.970222,

         -93.24727

     ]

                                                      218
     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":1.027,

     "travelDuration":169,

     "travelMode":"Driving"

},

{

     "compassDirection":"southeast",

     "details":[

          {

              "compassDegrees":114,

              "endPathIndices":[

                   15

              ],

              "maneuverType":"KeepStraight",

              "mode":"Driving",

              "names":[

                   "Riverside Ave"

              ],

              "roadType":"Arterial",

              "startPathIndices":[

                   13

              ]

          }

     ],

     "exit":"",

     "iconType":"Auto",

     "instruction":{

          "maneuverType":"KeepStraight",

          "text":"Keep straight onto Riverside Ave"

     },

     "maneuverPoint":{

                                                      219
          "type":"Point",

          "coordinates":[

               44.965491,

               -93.23616

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":0.325,

     "travelDuration":43,

     "travelMode":"Driving"

},

{

     "compassDirection":"east",

     "details":[

          {

               "compassDegrees":86,

               "endPathIndices":[

                    19

               ],

               "maneuverType":"TakeRampLeft",

               "mode":"Driving",

               "roadType":"Ramp",

               "startPathIndices":[

                    15

               ]

          },

          {

               "compassDegrees":68,

               "endPathIndices":[

                    48

               ],

               "locationCodes":[

                                                220
     "118-04195",

     "118N04195",

     "118-04194",

     "118N04194",

     "118-04193",

     "118N04193",

     "118-04192",

     "118N04192",

     "118-04191",

     "118N04191",

     "118-04190",

     "118N04190",

     "118-04189",

     "118N04189",

     "118-04188",

     "118N04188"

],

"maneuverType":"Merge",

"mode":"Driving",

"names":[

     "Cappelen Memorial Bridge"

],

"roadShieldRequestParameters":{

     "bucket":50402,

     "shields":[

         {

             "labels":[

                  "94"

             ],

             "roadShieldType":1

         }

     ]

},

"roadType":"LimitedAccessHighway",

                                     221
              "startPathIndices":[

                  19

              ]

          }

     ],

     "exit":"",

     "iconType":"Auto",

     "instruction":{

          "maneuverType":"RampThenHighwayLeft",

          "text":"Take ramp left and follow signs for I-94 East"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              44.964021,

              -93.232668

          ]

     },

     "sideOfStreet":"Unknown",

     "signs":[

          "I-94 East"

     ],

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":9.94,

     "travelDuration":373,

     "travelMode":"Driving"

},

{

     "compassDirection":"southeast",

     "details":[

          {

              "compassDegrees":105,

              "endPathIndices":[

                                                                   222
               55

          ],

          "locationCodes":[

               "118P15998",

               "118+15999"

          ],

          "maneuverType":"TakeRampRight",

          "mode":"Driving",

          "roadType":"Ramp",

          "startPathIndices":[

               48

          ]

     },

     {

          "compassDegrees":125,

          "endPathIndices":[

               60

          ],

          "locationCodes":[

               "118+15999",

               "118P15999",

               "118+16000"

          ],

          "maneuverType":"Merge",

          "mode":"Driving",

          "names":[

               "5TH St W"

          ],

          "roadType":"Arterial",

          "startPathIndices":[

               55

          ]

     }

],

                                            223
               "exit":"241B",

               "iconType":"Auto",

               "instruction":{

                    "maneuverType":"RampThenHighwayRight",

                    "text":"At exit 241B, take ramp right and follow signs for
5th St"

               },

               "maneuverPoint":{

                    "type":"Point",

                    "coordinates":[

                        44.950942,

                        -93.11435

                    ]

               },

               "sideOfStreet":"Unknown",

               "signs":[

                    "5th St"

               ],

               "tollZone":"",

               "transitTerminus":"",

               "travelDistance":1.692,

               "travelDuration":169,

               "travelMode":"Driving"

          },

          {

               "compassDirection":"southeast",

               "details":[

                    {

                        "compassDegrees":135,

                        "endPathIndices":[

                             63

                        ],

                        "locationCodes":[

                             "118-16685",


                                                                            224
                   "118N16685"

              ],

              "maneuverType":"BearRight",

              "mode":"Driving",

              "names":[

                   "St Peter St"

              ],

              "roadType":"Arterial",

              "startPathIndices":[

                   60

              ]

          }

     ],

     "exit":"",

     "iconType":"Auto",

     "instruction":{

          "maneuverType":"BearRight",

          "text":"Bear right onto St Peter St"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              44.945138,

              -93.095602

          ]

     },

     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":0.191,

     "travelDuration":18,

     "travelMode":"Driving"

},

{

                                                 225
"compassDirection":"east",

"details":[

     {

         "compassDegrees":87,

         "endPathIndices":[

              66

         ],

         "locationCodes":[

              "118+16420"

         ],

         "maneuverType":"BearLeft",

         "mode":"Driving",

         "names":[

              "Kellogg Blvd W"

         ],

         "roadType":"Arterial",

         "startPathIndices":[

              63

         ]

     }

],

"exit":"",

"iconType":"Auto",

"instruction":{

     "maneuverType":"BearLeft",

     "text":"Bear left onto Kellogg Blvd W"

},

"maneuverPoint":{

     "type":"Point",

     "coordinates":[

         44.943738,

         -93.09425

     ]

},

                                              226
     "sideOfStreet":"Unknown",

     "tollZone":"",

     "transitTerminus":"",

     "travelDistance":0.075,

     "travelDuration":27,

     "travelMode":"Driving"

},

{

     "compassDirection":"east",

     "details":[

          {

              "compassDegrees":80,

              "endPathIndices":[

                   66

              ],

              "locationCodes":[

                   "118+16420"

              ],

              "maneuverType":"ArriveFinish",

              "mode":"Driving",

              "names":[

                   "Kellogg Blvd W"

              ],

              "roadType":"Arterial",

              "startPathIndices":[

                   66

              ]

          }

     ],

     "exit":"",

     "hints":[

          {

              "hintType":null,

              "text":"The last intersection is St Peter St"

                                                              227
                      },

                      {

                           "hintType":null,

                           "text":"If you reach Kellogg Blvd E, you've gone too
far"

                      }

                 ],

                 "iconType":"Auto",

                 "instruction":{

                      "maneuverType":"ArriveFinish",

                      "text":"Arrive at St Paul, MN"

                 },

                 "maneuverPoint":{

                      "type":"Point",

                      "coordinates":[

                           44.943829,

                           -93.093325

                      ]

                 },

                 "sideOfStreet":"Unknown",

                 "tollZone":"",

                 "transitTerminus":"",

                 "travelDistance":0,

                 "travelDuration":0,

                 "travelMode":"Driving"

            }

       ],

       "startLocation":{

            "bbox":[

                 44.629471,

                 -94.065819,

                 45.322296,

                 -92.481316

            ],


                                                                                  228
     "name":"Minneapolis, MN",

     "point":{

          "type":"Point",

          "coordinates":[

              44.979031,

              -93.264931

          ]

     },

     "address":{

          "adminDistrict":"MN",

          "adminDistrict2":"Hennepin Co.",

          "countryRegion":"United States",

          "formattedAddress":"Minneapolis, MN",

          "locality":"Minneapolis"

     },

     "confidence":"High",

     "entityType":"PopulatedPlace",

     "geocodePoints":[

          {

              "type":"Point",

              "coordinates":[

                   44.979031,

                   -93.264931

              ],

              "calculationMethod":"Rooftop",

              "usageTypes":[

                   "Display"

              ]

          }

     ],

     "matchCodes":[

          "Good"

     ]

},

                                                  229
          "travelDistance":15.211,

          "travelDuration":1084

     }

],

"routePath":{

     "generalizations":[



     ],

     "line":{

          "type":"LineString",

          "coordinates":[

             [

                  44.979062,

                  -93.264908

             ],

             [

                  44.979668,

                  -93.264377

             ],

             [

                  44.979942,

                  -93.264141

             ],

             [

                  44.97969,

                  -93.26355

             ],

             [

                  44.977678,

                  -93.258621

             ],

             [

                  44.975329,

                  -93.253208

                                     230
],

[

     44.974341,

     -93.250869

],

[

     44.97424,

     -93.25044

],

[

     44.97292,

     -93.247398

],

[

     44.972807,

     -93.24728

],

[

     44.972512,

     -93.24721

],

[

     44.970222,

     -93.247269

],

[

     44.970012,

     -93.246787

],

[

     44.96549,

     -93.23616

],

[

                  231
     44.965281,

     -93.235698

],

[

     44.96402,

     -93.232668

],

[

     44.964069,

     -93.231868

],

[

     44.964138,

     -93.230688

],

[

     44.964321,

     -93.229728

],

[

     44.964841,

     -93.228521

],

[

     44.964938,

     -93.228279

],

[

     44.966611,

     -93.22468

],

[

     44.966912,

     -93.22372

                  232
],

[

     44.967067,

     -93.22277

],

[

     44.9671,

     -93.221687

],

[

     44.966788,

     -93.219729

],

[

     44.966091,

     -93.218007

],

[

     44.965378,

     -93.216971

],

[

     44.962041,

     -93.21268

],

[

     44.960651,

     -93.210518

],

[

     44.960002,

     -93.209289

],

[

                  233
     44.959707,

     -93.208227

],

[

     44.959589,

     -93.207149

],

[

     44.959718,

     -93.202407

],

[

     44.959638,

     -93.20157

],

[

     44.95945,

     -93.20076

],

[

     44.959198,

     -93.200111

],

[

     44.958087,

     -93.198169

],

[

     44.957379,

     -93.196361

],

[

     44.954289,

     -93.187381

                  234
],

[

     44.95327,

     -93.1842

],

[

     44.95217,

     -93.180638

],

[

     44.951881,

     -93.178997

],

[

     44.951591,

     -93.167238

],

[

     44.951682,

     -93.154079

],

[

     44.951612,

     -93.148178

],

[

     44.951661,

     -93.121747

],

[

     44.951521,

     -93.119371

],

[

                  235
     44.950942,

     -93.11435

],

[

     44.950781,

     -93.11376

],

[

     44.950631,

     -93.112451

],

[

     44.950529,

     -93.109887

],

[

     44.95032,

     -93.108782

],

[

     44.949799,

     -93.10772

],

[

     44.948979,

     -93.106437

],

[

     44.94782,

     -93.104361

],

[

     44.94738,

     -93.10375

                  236
],

[

     44.945889,

     -93.101647

],

[

     44.945508,

     -93.100708

],

[

     44.945138,

     -93.097549

],

[

     44.945138,

     -93.095601

],

[

     44.944311,

     -93.094781

],

[

     44.944081,

     -93.094561

],

[

     44.943737,

     -93.094249

],

[

     44.943759,

     -93.093842

],

[

                  237
                                       44.943791,

                                       -93.093541

                                  ],

                                  [

                                       44.943828,

                                       -93.093324

                                  ]

                              ]

                          }

                     },

                     "travelDistance":15.211,

                     "travelDuration":1084

                 }

             ]

         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"d26976daf98947baa178bd6eebc499df"

}

XML Response
You would receive the following XML response if the output (o) parameter was set to XML in the
request.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

    <Copyright>

     Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be
accessed and the content and any results may not be used, reproduced or transmitted in
any manner without express written permission from Microsoft Corporation.

    </Copyright>

    <BrandLogoUri>

     http://dev.virtualearth.net/Branding/logo_powered_by.png

    </BrandLogoUri>

    <StatusCode>200</StatusCode>

                                                                                            238
 <StatusDescription>OK</StatusDescription>

 <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

 <TraceId>

   6528dc5e7ea3411783efeff83222c606

 </TraceId>

 <ResourceSets>

   <ResourceSet>

     <EstimatedTotal>1</EstimatedTotal>

     <Resources>

       <Route>

         <Id>

             v62,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m1,o2,t4,w2YX/A2a0tfc=~XpeTlHEqBQgAAOABAAAAAAA=~TWlubmVhcG9saXMsIE
1O~~~,wvLj+Axacufc=~XpeTlAElEggAAOAB1BkBPwA=~U3QgUGF1bCwgTU4=~~~,k1,u

         </Id>

         <BoundingBox>

             <SouthLatitude>44.943738</SouthLatitude>

             <WestLongitude>-93.264908</WestLongitude>

             <NorthLatitude>44.979942</NorthLatitude>

             <EastLongitude>-93.093325</EastLongitude>

         </BoundingBox>

         <DistanceUnit>Kilometer</DistanceUnit>

         <DurationUnit>Second</DurationUnit>

         <TravelDistance>15.211</TravelDistance>

         <TravelDuration>1084</TravelDuration>

         <RouteLeg>

             <TravelDistance>15.211</TravelDistance>

             <TravelDuration>1084</TravelDuration>

             <ActualStart>

              <Latitude>44.979063</Latitude>

              <Longitude>-93.264908</Longitude>

             </ActualStart>

             <ActualEnd>

              <Latitude>44.943829</Latitude>


                                                                                      239
 <Longitude>-93.093325</Longitude>

</ActualEnd>

<StartLocation>

 <Name>Minneapolis, MN</Name>

 <Point>

   <Latitude>44.979031</Latitude>

   <Longitude>-93.264931</Longitude>

 </Point>

 <BoundingBox>

   <SouthLatitude>44.629471</SouthLatitude>

   <WestLongitude>-94.065819</WestLongitude>

   <NorthLatitude>45.322296</NorthLatitude>

   <EastLongitude>-92.481316</EastLongitude>

 </BoundingBox>

 <EntityType>PopulatedPlace</EntityType>

 <Address>

   <AdminDistrict>MN</AdminDistrict>

   <AdminDistrict2>Hennepin Co.</AdminDistrict2>

   <CountryRegion>United States</CountryRegion>

   <FormattedAddress>Minneapolis, MN</FormattedAddress>

   <Locality>Minneapolis</Locality>

 </Address>

 <Confidence>High</Confidence>

 <MatchCode>Good</MatchCode>

 <GeocodePoint>

   <Latitude>44.979031</Latitude>

   <Longitude>-93.264931</Longitude>

   <CalculationMethod>Rooftop</CalculationMethod>

   <UsageType>Display</UsageType>

 </GeocodePoint>

</StartLocation>

<EndLocation>

 <Name>St Paul, MN</Name>

 <Point>

                                                          240
   <Latitude>44.943821</Latitude>

   <Longitude>-93.093323</Longitude>

 </Point>

 <BoundingBox>

   <SouthLatitude>44.607239</SouthLatitude>

   <WestLongitude>-93.884979</WestLongitude>

   <NorthLatitude>45.300064</NorthLatitude>

   <EastLongitude>-92.301086</EastLongitude>

 </BoundingBox>

 <EntityType>PopulatedPlace</EntityType>

 <Address>

   <AdminDistrict>MN</AdminDistrict>

   <AdminDistrict2>Ramsey Co.</AdminDistrict2>

   <CountryRegion>United States</CountryRegion>

   <FormattedAddress>St Paul, MN</FormattedAddress>

   <Locality>St Paul</Locality>

 </Address>

 <Confidence>High</Confidence>

 <MatchCode>Good</MatchCode>

 <GeocodePoint>

   <Latitude>44.943821</Latitude>

   <Longitude>-93.093323</Longitude>

   <CalculationMethod>Rooftop</CalculationMethod>

   <UsageType>Display</UsageType>

 </GeocodePoint>

</EndLocation>

<ItineraryItem>

 <TravelMode>Driving</TravelMode>

 <TravelDistance>0.118</TravelDistance>

 <TravelDuration>30</TravelDuration>

 <ManeuverPoint>

   <Latitude>44.979063</Latitude>

   <Longitude>-93.264908</Longitude>

 </ManeuverPoint>

                                                      241
 <Instruction maneuverType="DepartStart">

   Depart S 3RD Ave toward S Washington Ave / CR-152 South

 </Instruction>

 <CompassDirection>northeast</CompassDirection>

 <Detail>

   <ManeuverType>DepartStart</ManeuverType>

   <StartPathIndex>0</StartPathIndex>

   <EndPathIndex>2</EndPathIndex>

   <Name>S 3RD Ave</Name>

   <CompassDegrees>41</CompassDegrees>

   <Mode>Driving</Mode>

   <PreviousEntityId>0</PreviousEntityId>

   <NextEntityId>0</NextEntityId>

   <RoadType>MajorRoad</RoadType>

   <LocationCode>118+05098</LocationCode>

   <LocationCode>118P05098</LocationCode>

 </Detail>

 <Exit/>

 <TollZone/>

 <TransitTerminus/>

 <IconType>Auto</IconType>

 <Time>0001-01-01T00:00:00</Time>

 <TransitStopId>0</TransitStopId>

 <TowardsRoadName>S Washington Ave / CR-152 South</TowardsRoadName>

 <SideOfStreet>Unknown</SideOfStreet>

</ItineraryItem>

<ItineraryItem>

 <TravelMode>Driving</TravelMode>

 <TravelDistance>1.843</TravelDistance>

 <TravelDuration>251</TravelDuration>

 <ManeuverPoint>

   <Latitude>44.979942</Latitude>

   <Longitude>-93.264141</Longitude>

 </ManeuverPoint>

                                                                      242
             <Instruction maneuverType="TurnRight">Turn right onto MN-65 South / S
Washington Ave</Instruction>

             <CompassDirection>southeast</CompassDirection>

             <Detail>

               <ManeuverType>TurnRight</ManeuverType>

               <StartPathIndex>2</StartPathIndex>

               <EndPathIndex>11</EndPathIndex>

               <Name>S Washington Ave</Name>

               <CompassDegrees>113</CompassDegrees>

               <Mode>Driving</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Arterial</RoadType>

               <RoadShieldRequestParameters>

                 <Bucket>50428</Bucket>

                 <Shield>

                   <RoadShieldType>3</RoadShieldType>

                   <Label>65</Label>

                 </Shield>

               </RoadShieldRequestParameters>

               <LocationCode>118-06272</LocationCode>

               <LocationCode>118N06272</LocationCode>

               <LocationCode>118-05155</LocationCode>

               <LocationCode>118-05154</LocationCode>

               <LocationCode>118N05154</LocationCode>

               <LocationCode>118-05153</LocationCode>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Auto</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>


                                                                                     243
           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>1.027</TravelDistance>

             <TravelDuration>169</TravelDuration>

             <ManeuverPoint>

               <Latitude>44.970222</Latitude>

               <Longitude>-93.24727</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TurnLeft">Turn left onto Riverside Ave / CR-
48</Instruction>

             <CompassDirection>east</CompassDirection>

             <Detail>

               <ManeuverType>TurnLeft</ManeuverType>

               <StartPathIndex>11</StartPathIndex>

               <EndPathIndex>13</EndPathIndex>

               <Name>Riverside Ave</Name>

               <CompassDegrees>112</CompassDegrees>

               <Mode>Driving</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Arterial</RoadType>

               <LocationCode>118N15600</LocationCode>

               <LocationCode>118-15599</LocationCode>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Auto</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>


                                                                                       244
             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.325</TravelDistance>

             <TravelDuration>43</TravelDuration>

             <ManeuverPoint>

               <Latitude>44.965491</Latitude>

               <Longitude>-93.23616</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="KeepStraight">Keep straight onto Riverside
Ave</Instruction>

             <CompassDirection>southeast</CompassDirection>

             <Detail>

               <ManeuverType>KeepStraight</ManeuverType>

               <StartPathIndex>13</StartPathIndex>

               <EndPathIndex>15</EndPathIndex>

               <Name>Riverside Ave</Name>

               <CompassDegrees>114</CompassDegrees>

               <Mode>Driving</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Arterial</RoadType>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Auto</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>9.94</TravelDistance>

             <TravelDuration>373</TravelDuration>

             <ManeuverPoint>


                                                                                     245
               <Latitude>44.964021</Latitude>

               <Longitude>-93.232668</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="RampThenHighwayLeft">Take ramp left and follow
signs for I-94 East</Instruction>

             <CompassDirection>east</CompassDirection>

             <Detail>

               <ManeuverType>TakeRampLeft</ManeuverType>

               <StartPathIndex>15</StartPathIndex>

               <EndPathIndex>19</EndPathIndex>

               <CompassDegrees>86</CompassDegrees>

               <Mode>Driving</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Ramp</RoadType>

             </Detail>

             <Detail>

               <ManeuverType>Merge</ManeuverType>

               <StartPathIndex>19</StartPathIndex>

               <EndPathIndex>48</EndPathIndex>

               <Name>Cappelen Memorial Bridge</Name>

               <CompassDegrees>68</CompassDegrees>

               <Mode>Driving</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>LimitedAccessHighway</RoadType>

               <RoadShieldRequestParameters>

                 <Bucket>50402</Bucket>

                 <Shield>

                   <RoadShieldType>1</RoadShieldType>

                   <Label>94</Label>

                 </Shield>

               </RoadShieldRequestParameters>

               <LocationCode>118-04195</LocationCode>


                                                                                     246
   <LocationCode>118N04195</LocationCode>

   <LocationCode>118-04194</LocationCode>

   <LocationCode>118N04194</LocationCode>

   <LocationCode>118-04193</LocationCode>

   <LocationCode>118N04193</LocationCode>

   <LocationCode>118-04192</LocationCode>

   <LocationCode>118N04192</LocationCode>

   <LocationCode>118-04191</LocationCode>

   <LocationCode>118N04191</LocationCode>

   <LocationCode>118-04190</LocationCode>

   <LocationCode>118N04190</LocationCode>

   <LocationCode>118-04189</LocationCode>

   <LocationCode>118N04189</LocationCode>

   <LocationCode>118-04188</LocationCode>

   <LocationCode>118N04188</LocationCode>

 </Detail>

 <Sign>I-94 East</Sign>

 <Exit/>

 <TollZone/>

 <TransitTerminus/>

 <IconType>Auto</IconType>

 <Time>0001-01-01T00:00:00</Time>

 <TransitStopId>0</TransitStopId>

 <SideOfStreet>Unknown</SideOfStreet>

</ItineraryItem>

<ItineraryItem>

 <TravelMode>Driving</TravelMode>

 <TravelDistance>1.692</TravelDistance>

 <TravelDuration>169</TravelDuration>

 <ManeuverPoint>

   <Latitude>44.950942</Latitude>

   <Longitude>-93.11435</Longitude>

 </ManeuverPoint>

 <Instruction maneuverType="RampThenHighwayRight">

                                                     247
 At exit 241B, take ramp right and follow signs for 5th St

</Instruction>

<CompassDirection>southeast</CompassDirection>

<Detail>

 <ManeuverType>TakeRampRight</ManeuverType>

 <StartPathIndex>48</StartPathIndex>

 <EndPathIndex>55</EndPathIndex>

 <CompassDegrees>105</CompassDegrees>

 <Mode>Driving</Mode>

 <PreviousEntityId>0</PreviousEntityId>

 <NextEntityId>0</NextEntityId>

 <RoadType>Ramp</RoadType>

 <LocationCode>118P15998</LocationCode>

 <LocationCode>118+15999</LocationCode>

</Detail>

<Detail>

 <ManeuverType>Merge</ManeuverType>

 <StartPathIndex>55</StartPathIndex>

 <EndPathIndex>60</EndPathIndex>

 <Name>5TH St W</Name>

 <CompassDegrees>125</CompassDegrees>

 <Mode>Driving</Mode>

 <PreviousEntityId>0</PreviousEntityId>

 <NextEntityId>0</NextEntityId>

 <RoadType>Arterial</RoadType>

 <LocationCode>118+15999</LocationCode>

 <LocationCode>118P15999</LocationCode>

 <LocationCode>118+16000</LocationCode>

</Detail>

<Sign>5th St</Sign>

<Exit>241B</Exit>

<TollZone/>

<TransitTerminus/>

<IconType>Auto</IconType>

                                                             248
             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.191</TravelDistance>

             <TravelDuration>18</TravelDuration>

             <ManeuverPoint>

               <Latitude>44.945138</Latitude>

               <Longitude>-93.095602</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="BearRight">Bear right onto St Peter
St</Instruction>

             <CompassDirection>southeast</CompassDirection>

             <Detail>

               <ManeuverType>BearRight</ManeuverType>

               <StartPathIndex>60</StartPathIndex>

               <EndPathIndex>63</EndPathIndex>

               <Name>St Peter St</Name>

               <CompassDegrees>135</CompassDegrees>

               <Mode>Driving</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Arterial</RoadType>

               <LocationCode>118-16685</LocationCode>

               <LocationCode>118N16685</LocationCode>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Auto</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>


                                                                              249
             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.075</TravelDistance>

             <TravelDuration>27</TravelDuration>

             <ManeuverPoint>

                  <Latitude>44.943738</Latitude>

                  <Longitude>-93.09425</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="BearLeft">Bear left onto Kellogg Blvd
W</Instruction>

             <CompassDirection>east</CompassDirection>

             <Detail>

                  <ManeuverType>BearLeft</ManeuverType>

                  <StartPathIndex>63</StartPathIndex>

                  <EndPathIndex>66</EndPathIndex>

                  <Name>Kellogg Blvd W</Name>

                  <CompassDegrees>87</CompassDegrees>

                  <Mode>Driving</Mode>

                  <PreviousEntityId>0</PreviousEntityId>

                  <NextEntityId>0</NextEntityId>

                  <RoadType>Arterial</RoadType>

                  <LocationCode>118+16420</LocationCode>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Auto</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <ItineraryItem>


                                                                                250
             <TravelMode>Driving</TravelMode>

             <TravelDistance>0</TravelDistance>

             <TravelDuration>0</TravelDuration>

             <ManeuverPoint>

               <Latitude>44.943829</Latitude>

               <Longitude>-93.093325</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="ArriveFinish">Arrive at St Paul,
MN</Instruction>

             <CompassDirection>east</CompassDirection>

             <Hint>The last intersection is St Peter St</Hint>

             <Hint>If you reach Kellogg Blvd E, you've gone too far</Hint>

             <Detail>

               <ManeuverType>ArriveFinish</ManeuverType>

               <StartPathIndex>66</StartPathIndex>

               <EndPathIndex>66</EndPathIndex>

               <Name>Kellogg Blvd W</Name>

               <CompassDegrees>80</CompassDegrees>

               <Mode>Driving</Mode>

               <PreviousEntityId>0</PreviousEntityId>

               <NextEntityId>0</NextEntityId>

               <RoadType>Arterial</RoadType>

               <LocationCode>118+16420</LocationCode>

             </Detail>

             <Exit/>

             <TollZone/>

             <TransitTerminus/>

             <IconType>Auto</IconType>

             <Time>0001-01-01T00:00:00</Time>

             <TransitStopId>0</TransitStopId>

             <SideOfStreet>Unknown</SideOfStreet>

           </ItineraryItem>

           <StartTime>0001-01-01T00:00:00</StartTime>

           <EndTime>0001-01-01T00:00:00</EndTime>


                                                                             251
</RouteLeg>

<RoutePath>

 <Line>

   <Point>

     <Latitude>44.979062</Latitude>

     <Longitude>-93.264908</Longitude>

   </Point>

   <Point>

     <Latitude>44.979668</Latitude>

     <Longitude>-93.264377</Longitude>

   </Point>

   <Point>

     <Latitude>44.979942</Latitude>

     <Longitude>-93.264141</Longitude>

   </Point>

   <Point>

     <Latitude>44.97969</Latitude>

     <Longitude>-93.26355</Longitude>

   </Point>

   <Point>

     <Latitude>44.977678</Latitude>

     <Longitude>-93.258621</Longitude>

   </Point>

   <Point>

     <Latitude>44.975329</Latitude>

     <Longitude>-93.253208</Longitude>

   </Point>

   <Point>

     <Latitude>44.974341</Latitude>

     <Longitude>-93.250869</Longitude>

   </Point>

   <Point>

     <Latitude>44.97424</Latitude>

     <Longitude>-93.25044</Longitude>

                                         252
</Point>

<Point>

 <Latitude>44.97292</Latitude>

 <Longitude>-93.247398</Longitude>

</Point>

<Point>

 <Latitude>44.972807</Latitude>

 <Longitude>-93.24728</Longitude>

</Point>

<Point>

 <Latitude>44.972512</Latitude>

 <Longitude>-93.24721</Longitude>

</Point>

<Point>

 <Latitude>44.970222</Latitude>

 <Longitude>-93.247269</Longitude>

</Point>

<Point>

 <Latitude>44.970012</Latitude>

 <Longitude>-93.246787</Longitude>

</Point>

<Point>

 <Latitude>44.96549</Latitude>

 <Longitude>-93.23616</Longitude>

</Point>

<Point>

 <Latitude>44.965281</Latitude>

 <Longitude>-93.235698</Longitude>

</Point>

<Point>

 <Latitude>44.96402</Latitude>

 <Longitude>-93.232668</Longitude>

</Point>

<Point>

                                     253
 <Latitude>44.964069</Latitude>

 <Longitude>-93.231868</Longitude>

</Point>

<Point>

 <Latitude>44.964138</Latitude>

 <Longitude>-93.230688</Longitude>

</Point>

<Point>

 <Latitude>44.964321</Latitude>

 <Longitude>-93.229728</Longitude>

</Point>

<Point>

 <Latitude>44.964841</Latitude>

 <Longitude>-93.228521</Longitude>

</Point>

<Point>

 <Latitude>44.964938</Latitude>

 <Longitude>-93.228279</Longitude>

</Point>

<Point>

 <Latitude>44.966611</Latitude>

 <Longitude>-93.22468</Longitude>

</Point>

<Point>

 <Latitude>44.966912</Latitude>

 <Longitude>-93.22372</Longitude>

</Point>

<Point>

 <Latitude>44.967067</Latitude>

 <Longitude>-93.22277</Longitude>

</Point>

<Point>

 <Latitude>44.9671</Latitude>

 <Longitude>-93.221687</Longitude>

                                     254
</Point>

<Point>

 <Latitude>44.966788</Latitude>

 <Longitude>-93.219729</Longitude>

</Point>

<Point>

 <Latitude>44.966091</Latitude>

 <Longitude>-93.218007</Longitude>

</Point>

<Point>

 <Latitude>44.965378</Latitude>

 <Longitude>-93.216971</Longitude>

</Point>

<Point>

 <Latitude>44.962041</Latitude>

 <Longitude>-93.21268</Longitude>

</Point>

<Point>

 <Latitude>44.960651</Latitude>

 <Longitude>-93.210518</Longitude>

</Point>

<Point>

 <Latitude>44.960002</Latitude>

 <Longitude>-93.209289</Longitude>

</Point>

<Point>

 <Latitude>44.959707</Latitude>

 <Longitude>-93.208227</Longitude>

</Point>

<Point>

 <Latitude>44.959589</Latitude>

 <Longitude>-93.207149</Longitude>

</Point>

<Point>

                                     255
 <Latitude>44.959718</Latitude>

 <Longitude>-93.202407</Longitude>

</Point>

<Point>

 <Latitude>44.959638</Latitude>

 <Longitude>-93.20157</Longitude>

</Point>

<Point>

 <Latitude>44.95945</Latitude>

 <Longitude>-93.20076</Longitude>

</Point>

<Point>

 <Latitude>44.959198</Latitude>

 <Longitude>-93.200111</Longitude>

</Point>

<Point>

 <Latitude>44.958087</Latitude>

 <Longitude>-93.198169</Longitude>

</Point>

<Point>

 <Latitude>44.957379</Latitude>

 <Longitude>-93.196361</Longitude>

</Point>

<Point>

 <Latitude>44.954289</Latitude>

 <Longitude>-93.187381</Longitude>

</Point>

<Point>

 <Latitude>44.95327</Latitude>

 <Longitude>-93.1842</Longitude>

</Point>

<Point>

 <Latitude>44.95217</Latitude>

 <Longitude>-93.180638</Longitude>

                                     256
</Point>

<Point>

 <Latitude>44.951881</Latitude>

 <Longitude>-93.178997</Longitude>

</Point>

<Point>

 <Latitude>44.951591</Latitude>

 <Longitude>-93.167238</Longitude>

</Point>

<Point>

 <Latitude>44.951682</Latitude>

 <Longitude>-93.154079</Longitude>

</Point>

<Point>

 <Latitude>44.951612</Latitude>

 <Longitude>-93.148178</Longitude>

</Point>

<Point>

 <Latitude>44.951661</Latitude>

 <Longitude>-93.121747</Longitude>

</Point>

<Point>

 <Latitude>44.951521</Latitude>

 <Longitude>-93.119371</Longitude>

</Point>

<Point>

 <Latitude>44.950942</Latitude>

 <Longitude>-93.11435</Longitude>

</Point>

<Point>

 <Latitude>44.950781</Latitude>

 <Longitude>-93.11376</Longitude>

</Point>

<Point>

                                     257
 <Latitude>44.950631</Latitude>

 <Longitude>-93.112451</Longitude>

</Point>

<Point>

 <Latitude>44.950529</Latitude>

 <Longitude>-93.109887</Longitude>

</Point>

<Point>

 <Latitude>44.95032</Latitude>

 <Longitude>-93.108782</Longitude>

</Point>

<Point>

 <Latitude>44.949799</Latitude>

 <Longitude>-93.10772</Longitude>

</Point>

<Point>

 <Latitude>44.948979</Latitude>

 <Longitude>-93.106437</Longitude>

</Point>

<Point>

 <Latitude>44.94782</Latitude>

 <Longitude>-93.104361</Longitude>

</Point>

<Point>

 <Latitude>44.94738</Latitude>

 <Longitude>-93.10375</Longitude>

</Point>

<Point>

 <Latitude>44.945889</Latitude>

 <Longitude>-93.101647</Longitude>

</Point>

<Point>

 <Latitude>44.945508</Latitude>

 <Longitude>-93.100708</Longitude>

                                     258
 </Point>

 <Point>

   <Latitude>44.945138</Latitude>

   <Longitude>-93.097549</Longitude>

 </Point>

 <Point>

   <Latitude>44.945138</Latitude>

   <Longitude>-93.095601</Longitude>

 </Point>

 <Point>

   <Latitude>44.944311</Latitude>

   <Longitude>-93.094781</Longitude>

 </Point>

 <Point>

   <Latitude>44.944081</Latitude>

   <Longitude>-93.094561</Longitude>

 </Point>

 <Point>

   <Latitude>44.943737</Latitude>

   <Longitude>-93.094249</Longitude>

 </Point>

 <Point>

   <Latitude>44.943759</Latitude>

   <Longitude>-93.093842</Longitude>

 </Point>

 <Point>

   <Latitude>44.943791</Latitude>

   <Longitude>-93.093541</Longitude>

 </Point>

 <Point>

   <Latitude>44.943828</Latitude>

   <Longitude>-93.093324</Longitude>

 </Point>

</Line>

                                       259
           </RoutePath>

         </Route>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>




Driving Route using Tolerances Example
The following example shows how to request a driving route between two locations and specifies
tolerances so that subsets of route points that meet those tolerances are returned. Each
tolerance returns a subset of route points in the response. The route path defined by the subset
of route path points approximates the route path defined by the full set of route points within the
tolerance provided. The response to this request is the same as are shown for both XML and
JSON formats.
This example is the same as the request that is described in the Driving Route with Route Path
Example with the addition of tolerances. Examples of the additional content that is returned when
tolerances are specified are shown below in JSON and XML formats.
http://dev.virtualearth.net/REST/V1/Routes/Driving?wp.0=44.979035,-
93.26493&wp.1=44.943828508257866,-
93.09332862496376&optmz=distance&rpo=Points&tl=0.00000344978,0.0000218840,0.000220577,0.0
0188803,0.0169860,0.0950130,0.846703&key=BingMapsKey

JSON Response
The following route path generalization collections are returned with the route path points in
Route resource in the response. Each route path generalization specifies a subset of route path
points and the associated tolerance (latLongTolerance). The route path points are specified by an
index value. Route path points are assigned integer index values that start with 0.
These generalizations would be added to the complete response shown in Driving Route with
Route Path Example.
{

    "routePath":{

         -- route path points --

       "generalizations":[

          {

              "latLongTolerance":3.44978E-06,

              "pathIndices":[



0,2,3,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,

                                                                                                260
33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,

             60,61,62,63,64,65,66]

        },

        {

             "latLongTolerance":2.1884E-05,

             "pathIndices":[

              0,2,4,5,6,7,8,9,10,11,14,15,17,18,20,21,22,23,24,25,26,27,28,29,30,31,

              32,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,57,

              58,59,60,63,66

             ]

         },

        {

             "latLongTolerance":0.000220577,

             "pathIndices":[

              0,2,8,11,15,18,22,24,25,26,28,30,32,33,35,38,41,43,47,52,57,58,60,63,66

             ]

        },

        {

             "latLongTolerance":0.00188803,

             "pathIndices":[

                 0,15,25,30,41,47,66

             ]

        },

        {

             "latLongTolerance":0.016986,

             "pathIndices":[

                 0,66

             ]

        },

        {

             "latLongTolerance":0.095013,

             "pathIndices":[

                 0,66


                                                                                         261
                 ]

            },

            {

                 "latLongTolerance":0.846703,

                 "pathIndices":[

                     0,66

                 ]

            }

        ]

    }

}

XML Response
You receive the following XML version of the route path generalizations when the output=xml
parameter is set in the request.
<RoutePath>

    – route path points --

    <RoutePathGeneralization>

     <Index>0</Index>

     <Index>2</Index>

     <Index>3</Index>

     <Index>4</Index>

     <Index>5</Index>

     <Index>6</Index>

     <Index>7</Index>

     <Index>8</Index>

     <Index>9</Index>

     <Index>10</Index>

     <Index>11</Index>

     <Index>13</Index>

     <Index>14</Index>

     <Index>15</Index>

     <Index>17</Index>

     <Index>18</Index>

     <Index>19</Index>


                                                                                              262
<Index>20</Index>

<Index>21</Index>

<Index>22</Index>

<Index>23</Index>

<Index>24</Index>

<Index>25</Index>

<Index>26</Index>

<Index>27</Index>

<Index>28</Index>

<Index>29</Index>

<Index>30</Index>

<Index>31</Index>

<Index>32</Index>

<Index>33</Index>

<Index>34</Index>

<Index>35</Index>

<Index>36</Index>

<Index>37</Index>

<Index>38</Index>

<Index>39</Index>

<Index>40</Index>

<Index>41</Index>

<Index>42</Index>

<Index>43</Index>

<Index>44</Index>

<Index>45</Index>

<Index>46</Index>

<Index>47</Index>

<Index>48</Index>

<Index>49</Index>

<Index>50</Index>

<Index>51</Index>

<Index>52</Index>

<Index>53</Index>

                    263
 <Index>54</Index>

 <Index>55</Index>

 <Index>56</Index>

 <Index>57</Index>

 <Index>58</Index>

 <Index>59</Index>

 <Index>60</Index>

 <Index>61</Index>

 <Index>62</Index>

 <Index>63</Index>

 <Index>64</Index>

 <Index>65</Index>

 <Index>66</Index>

 <LatLongTolerance>3.44978E-06</LatLongTolerance>

</RoutePathGeneralization>-<RoutePathGeneralization>

 <Index>0</Index>

 <Index>2</Index>

 <Index>4</Index>

 <Index>5</Index>

 <Index>6</Index>

 <Index>7</Index>

 <Index>8</Index>

 <Index>9</Index>

 <Index>10</Index>

 <Index>11</Index>

 <Index>14</Index>

 <Index>15</Index>

 <Index>17</Index>

 <Index>18</Index>

 <Index>20</Index>

 <Index>21</Index>

 <Index>22</Index>

 <Index>23</Index>

 <Index>24</Index>

                                                       264
<Index>25</Index>

<Index>26</Index>

<Index>27</Index>

<Index>28</Index>

<Index>29</Index>

<Index>30</Index>

<Index>31</Index>

<Index>32</Index>

<Index>33</Index>

<Index>34</Index>

<Index>35</Index>

<Index>36</Index>

<Index>37</Index>

<Index>38</Index>

<Index>39</Index>

<Index>41</Index>

<Index>42</Index>

<Index>43</Index>

<Index>44</Index>

<Index>45</Index>

<Index>46</Index>

<Index>47</Index>

<Index>48</Index>

<Index>49</Index>

<Index>50</Index>

<Index>51</Index>

<Index>52</Index>

<Index>53</Index>

<Index>54</Index>

<Index>55</Index>

<Index>57</Index>

<Index>58</Index>

<Index>59</Index>

<Index>60</Index>

                    265
 <Index>63</Index>

 <Index>66</Index>

 <LatLongTolerance>2.1884E-05</LatLongTolerance>

</RoutePathGeneralization>-<RoutePathGeneralization>

 <Index>0</Index>

 <Index>2</Index>

 <Index>8</Index>

 <Index>11</Index>

 <Index>15</Index>

 <Index>18</Index>

 <Index>22</Index>

 <Index>24</Index>

 <Index>25</Index>

 <Index>26</Index>

 <Index>28</Index>

 <Index>30</Index>

 <Index>32</Index>

 <Index>33</Index>

 <Index>35</Index>

 <Index>38</Index>

 <Index>41</Index>

 <Index>43</Index>

 <Index>47</Index>

 <Index>52</Index>

 <Index>57</Index>

 <Index>58</Index>

 <Index>60</Index>

 <Index>63</Index>

 <Index>66</Index>

 <LatLongTolerance>0.000220577</LatLongTolerance>

</RoutePathGeneralization>-<RoutePathGeneralization>

 <Index>0</Index>

 <Index>15</Index>

 <Index>25</Index>

                                                       266
    <Index>30</Index>

    <Index>41</Index>

    <Index>47</Index>

    <Index>66</Index>

    <LatLongTolerance>0.00188803</LatLongTolerance>

  </RoutePathGeneralization>-<RoutePathGeneralization>

    <Index>0</Index>

    <Index>66</Index>

    <LatLongTolerance>0.016986</LatLongTolerance>

  </RoutePathGeneralization>-<RoutePathGeneralization>

    <Index>0</Index>

    <Index>66</Index>

    <LatLongTolerance>0.095013</LatLongTolerance>

  </RoutePathGeneralization>-<RoutePathGeneralization>

    <Index>0</Index>

    <Index>66</Index>

    <LatLongTolerance>0.846703</LatLongTolerance>

  </RoutePathGeneralization>

</RoutePath>




Calculate Routes from Major Roads
Use the following URL template to return a driving route to a location from major roads in four
directions (West, North, East and South). You can use this URL for routes in the United States,
Canada and Mexico.
When you make a request using the following URL template, the response can return either only
the starting points for the routes from major roads or detailed information for each route. Starting
points are latitude and longitude pairs while detailed route information includes detailed directions
and waypoints, travel time and duration and other information specific to the route. Specify the
exclude parameter when you do not want to return detailed route information.

Starting points are specified in the response by using the Location Resource. Detailed route
information is provided by using the Route Resource. You can also request a route path that
additionally returns a series of latitude and longitude points that define the route. For information
about the Location Resource, see Location Data. For information about the Route Resource, see
Route Data. Examples are also provided below.
When you use this URL, an attempt is made to create four driving routes to the specified location.
Ideally these routes are from the west, north, east and south directions. However, major routes
                                                                                                  267
may not exist in each direction. If routes from all four directions cannot be found, the response
may contain more than one route from the same direction or fewer than four routes may be
returned.
For more information about the Route resource, see Route Data. You can also view the example
URL and response values in the Examples section.

URL Templates


     These templates support both HTTP and HTTPS protocols.
Find routes from major roads in four directions (West, North, East, South).
http://dev.virtualearth.net/REST/v1/Routes/FromMajorRoads?destination=destination&exclude
=routes&rpo=routePathOutput&du=distanceUnit&key=BingMapsKey



Template Parameters


     See the Common Parameters and Types section for additional common parameters to
     use with these URLs.
     Common parameters include:
   Output Parameters: Includes response output types and the JSON callback parameters.
   Culture Parameter: Includes a list of the supported cultures.
   User Context Parameters: Includes parameters that set user location and viewport values to
     help determine locations. For example, these values may help prioritize a set of possible
     locations when you specify a partial address for a destination.
     When an alias is provided, you can use the alias to shorten the length of the query
     parameter. For example, destination=47.610,-122.107 can be shortened to dest=47.610,-
     122.107.
     Parameter values are not case-sensitive.


Parameter         Alia   Description                  Values
                  s

destination       dest   Required. Specifies          A destination can be specified as a Point, a
                         the final location for all   landmark, or an address. For more information
                         the routes.                  about Point values, see Location and Area
                                                      Types.
                                                      Examples:
                                                      destination=47.610,-122.107 [Point]
                                                      destination=Eiffel%20Tower [landmark]
                                                      dest=1%20Microsoft%20Way%20Redmond%20

                                                                                                    268
Parameter       Alia   Description               Values
                s
                                                 WA [address]

exclude         excl   Optional. Specifies to    The only value for this parameter is routes.
                       return only starting      Examples:
                       points for each major
                                                 exclude=routes
                       route in the response.
                       When this option is not   excl=routes
                       specified, detailed
                       directions for each
                       route are returned.

routePathOutp   rpo    Optional. Specifies       One of the following values:
ut                     whether the response         Points: A list of Point values for each route’s
                       should include                 path is provided in the response.
                       information about            None [default]: No route path information is
                       Point (latitude and            provided in the response.
                       longitude) values for     Example: routePathOutput=Points
                       each route’s path.


                           When the
                           exclude
                           parameter is
                           specified, the
                           routePathOutp
                           ut parameter
                           is not used.

distanceUnit    du     Optional. The units to    One of the following values:
                       use for distance.            Mile or mi
                                                    Kilometer or km [default]
                           When the              Example: distanceUnit=mi
                           exclude
                           parameter is
                           specified, the
                           distanceUnit
                           parameter is
                           not used.




                                                                                                 269
Response
A set of Route resources that contain route information from major roads is returned when you
make a request using this template and do not specify the exclude=routes parameter value. If you
specify the exclude=routes, a set of Location resources are returned that contain starting points
(latitude and longitude values) for routes to your destination from major roads. For more
information about the Route resource, see Route Data. For more information about the Locations
resource, see Location Data. For more information about the common response syntax for the
Bing Maps REST Services, see Common Response Description. JSON and XML responses are
provided for the URL examples in the following section.
These URLs support JSON (application/json) and XML (application/xml) response formats. A
JSON response is provided by default, unless you request XML output by setting the output (o)
parameter. For more information, see Output Parameters.

Examples
Find starting points of the driving routes from major roads to a street address.
This example returns starting points for routes from major roads for the specified street address.
The exclude=routes parameter is specified so that only the starting points of the major routes are
returned. If you do not include this parameter, detailed route instructions are also provided in the
response.
http://dev.virtualearth.net/REST/V1/Routes/FromMajorRoads?dest=1%20Microsoft%20Way%20Redm
ond%20WA%2098052&exclude=routes&output=xml&key=BingMapsKey

XML response
The response for this example contains a set of Location resources that specify the starting
points of the major routes. The Name field defines the route that corresponds with the starting
location. For example, the first Name value below specifies that this is the starting point of a route
from the north and uses Interstate I-405 South.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

  <Copyright>Copyright © 2010 Microsoft and its suppliers. All rights reserved. This API
cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.</Copyright>

  <BrandLogoUri>http://veintplat3.live-
int.com/Branding/logo_powered_by.png</BrandLogoUri>

  <StatusCode>200</StatusCode>

  <StatusDescription>OK</StatusDescription>

  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

  <TraceId>d9c83b7e348e41c0b93255e36cb944f3</TraceId>



                                                                                                    270
<ResourceSets>

 <ResourceSet>

   <EstimatedTotal>4</EstimatedTotal>

   <Resources>

     <Location>

       <Name>the north (on I-405 S)</Name>

       <Point>

         <Latitude>47.684789299964905</Latitude>

         <Longitude>-122.18332171440125</Longitude>

       </Point>

       <Confidence>High</Confidence>

     </Location>

     <Location>

       <Name>the south (on I-405 N)</Name>

       <Point>

         <Latitude>47.615979909896851</Latitude>

         <Longitude>-122.18860030174255</Longitude>

       </Point>

       <Confidence>High</Confidence>

     </Location>

     <Location>

       <Name>the east (on SR-520 W)</Name>

       <Point>

         <Latitude>47.671131491661072</Latitude>

         <Longitude>-122.10670173168182</Longitude>

       </Point>

       <Confidence>High</Confidence>

     </Location>

     <Location>

       <Name>the west (on SR-520 E)</Name>

       <Point>

         <Latitude>47.636691927909851</Latitude>

         <Longitude>-122.19275772571564</Longitude>

       </Point>

                                                      271
            <Confidence>High</Confidence>

           </Location>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>



JSON Response
You would receive the following JSON response if the output=xml parameter was not set in this
example.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2010 Microsoft and its suppliers. All rights reserved. This A
PI cannot be accessed and the content and any results may not be used, reproduced or tran
smitted in any manner without express written permission from Microsoft Corporation.",

    "resourceSets":[

       {

           "estimatedTotal":4,

           "resources":[

              {

                   "__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest
\/v1",

                   "name":"the north (on I-405 S)",

                   "point":{

                        "type":"Point",

                        "coordinates":[

                            47.684789299964905,

                            -122.18332171440125

                        ]

                   },

                   "confidence":"High",

                   "entityType":null

              },

              {

                                                                                            272
              "__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest
\/v1",

              "name":"the south (on I-405 N)",

              "point":{

                   "type":"Point",

                   "coordinates":[

                       47.615979909896851,

                       -122.18860030174255

                   ]

              },

              "confidence":"High",

              "entityType":null

         },

         {

              "__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest
\/v1",

              "name":"the east (on SR-520 W)",

              "point":{

                   "type":"Point",

                   "coordinates":[

                       47.671131491661072,

                       -122.10670173168182

                   ]

              },

              "confidence":"High",

              "entityType":null

         },

         {

              "__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest
\/v1",

              "name":"the west (on SR-520 E)",

              "point":{

                   "type":"Point",

                   "coordinates":[


                                                                                     273
                              47.636691927909851,

                              -122.19275772571564

                          ]

                     },

                     "confidence":"High",

                     "entityType":null

                 }

             ]

         }

    ],

    "statusCode":200,

    "statusDescription":"OK",

    "traceId":"e2bbc0171d224d85bbf5f41a91233b72"

}

Find driving routes from major roads.
This example returns routes to Spokane, Washington from major roads.
http://dev.virtualearth.net/REST/V1/Routes/FromMajorRoads?dest=Spokane%20WA&output=xml&ke
y=BingMapsKey



XML response
The response for this example contains a set of Route resources that provide directions for routes
to Spokane, Washington from major roads.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

    <Copyright>Copyright © 2010 Microsoft and its suppliers. All rights reserved. This API
cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.</Copyright>

    <BrandLogoUri>http://veintplat3.live-
int.com/Branding/logo_powered_by.png</BrandLogoUri>

    <StatusCode>200</StatusCode>

    <StatusDescription>OK</StatusDescription>

    <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

    <TraceId>b081f10cb6194b54865e9eace7789385|BR1M006800</TraceId>



                                                                                              274
 <ResourceSets>

   <ResourceSet>

     <EstimatedTotal>4</EstimatedTotal>

     <Resources>

       <Route>

         <Id>v60,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m0,o0,t0,woGQ8BOjrkPU=~kmIi/8mBtAAAAA4BAAAAAAA=~dGhlIGVhc3QgKG9uIE
ktOTAgVyk=~~~,wqXc8BOY3kPU=~kmIi/8ntswAAAA4BjKv/PgA=~U3Bva2FuZSwgV0E=~0~~,k1</Id>

         <BoundingBox>

           <SouthLatitude>47.65221118927002</SouthLatitude>

           <WestLongitude>-117.41227939724922</WestLongitude>

           <NorthLatitude>47.657259106636047</NorthLatitude>

           <EastLongitude>-117.38137900829315</EastLongitude>

         </BoundingBox>

         <DistanceUnit>Kilometer</DistanceUnit>

         <DurationUnit>Second</DurationUnit>

         <TravelDistance>2.844</TravelDistance>

         <TravelDuration>214</TravelDuration>

         <RouteLeg>

           <TravelDistance>2.844</TravelDistance>

           <TravelDuration>214</TravelDuration>

           <ActualStart>

             <Latitude>47.653992176055908</Latitude>

             <Longitude>-117.38137900829315</Longitude>

           </ActualStart>

           <ActualEnd>

             <Latitude>47.657259106636047</Latitude>

             <Longitude>-117.41227939724922</Longitude>

           </ActualEnd>

           <StartLocation>

             <Name>the east (on I-90 W)</Name>

             <Point>

                 <Latitude>47.653992176055908</Latitude>

                 <Longitude>-117.38137900829315</Longitude>


                                                                                      275
             </Point>

             <Confidence>High</Confidence>

           </StartLocation>

           <EndLocation>

             <Name>Spokane, WA</Name>

             <Point>

               <Latitude>47.6572597771883</Latitude>

               <Longitude>-117.41227939724922</Longitude>

             </Point>

             <Confidence>High</Confidence>

           </EndLocation>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>1.866</TravelDistance>

             <TravelDuration>67</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.653992176055908</Latitude>

               <Longitude>-117.38137900829315</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="DepartStart">Depart I-90 West</Instruction>

             <CompassDirection>west</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.482</TravelDistance>

             <TravelDuration>66</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.652361392974854</Latitude>

               <Longitude>-117.40572810173035</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TakeRampRight">At exit 281, take ramp right for
US-395 North / US-2 North toward Newport / Colville</Instruction>

             <CompassDirection>west</CompassDirection>

           </ItineraryItem>


                                                                                      276
           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.418</TravelDistance>

             <TravelDuration>57</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.653520107269287</Latitude>

               <Longitude>-117.41123735904694</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="BearRight">Bear right onto US-2 East / US-395
North / S Division St</Instruction>

             <CompassDirection>north</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.078</TravelDistance>

             <TravelDuration>22</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.657259106636047</Latitude>

               <Longitude>-117.41123735904694</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TurnLeft">Turn left onto W Sprague
Ave</Instruction>

             <CompassDirection>west</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0</TravelDistance>

             <TravelDuration>0</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.657259106636047</Latitude>

               <Longitude>-117.41227939724922</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="ArriveFinish">Arrive at Spokane,
WA</Instruction>


                                                                                        277
             <CompassDirection>west</CompassDirection>

             <Hint hintType="PreviousIntersection">The last intersection is US-2 North /
US-395 East / N Division St</Hint>

             <Hint hintType="NextIntersection">If you reach US-2 South / US-395 West / N
Browne St, you've gone too far</Hint>

           </ItineraryItem>

         </RouteLeg>

       </Route>

       <Route>

         <Id>v60,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m0,o0,t0,wqNg8BHg+kPU=~kmIi/zEItAAAAA4BAAAAAAA=~dGhlIG5vcnRoIChvbi
BVUy0yIFcgLyBVUy0zOTUgUyAvIE4gRGl2aXNpb24gU3Qp~~~,wqXc8BOY3kPU=~kmIi/8ntswAAAA4BjKv/PgA=~
U3Bva2FuZSwgV0E=~0~~,k1</Id>

         <BoundingBox>

           <SouthLatitude>47.657259106636047</SouthLatitude>

           <WestLongitude>-117.41332948207855</WestLongitude>

           <NorthLatitude>47.6739102602005</NorthLatitude>

           <EastLongitude>-117.41115152835846</EastLongitude>

         </BoundingBox>

         <DistanceUnit>Kilometer</DistanceUnit>

         <DurationUnit>Second</DurationUnit>

         <TravelDistance>2.032</TravelDistance>

         <TravelDuration>199</TravelDuration>

         <RouteLeg>

           <TravelDistance>2.032</TravelDistance>

           <TravelDuration>199</TravelDuration>

           <ActualStart>

             <Latitude>47.6739102602005</Latitude>

             <Longitude>-117.41115152835846</Longitude>

           </ActualStart>

           <ActualEnd>

             <Latitude>47.657259106636047</Latitude>

             <Longitude>-117.41227939724922</Longitude>

           </ActualEnd>

           <StartLocation>

                                                                                      278
             <Name>the north (on US-2 W / US-395 S / N Division St)</Name>

             <Point>

               <Latitude>47.6739102602005</Latitude>

               <Longitude>-117.41115152835846</Longitude>

             </Point>

             <Confidence>High</Confidence>

           </StartLocation>

           <EndLocation>

             <Name>Spokane, WA</Name>

             <Point>

               <Latitude>47.6572597771883</Latitude>

               <Longitude>-117.41227939724922</Longitude>

             </Point>

             <Confidence>High</Confidence>

           </EndLocation>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>1.954</TravelDistance>

             <TravelDuration>176</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.6739102602005</Latitude>

               <Longitude>-117.41115152835846</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="DepartStart">Depart US-2 West / US-395 South / N
Division St toward W Augusta Ave</Instruction>

             <CompassDirection>south</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.078</TravelDistance>

             <TravelDuration>22</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.657259106636047</Latitude>

               <Longitude>-117.41331875324249</Longitude>


                                                                                     279
             </ManeuverPoint>

             <Instruction maneuverType="TurnLeft">Turn left onto W Sprague
Ave</Instruction>

             <CompassDirection>east</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0</TravelDistance>

             <TravelDuration>0</TravelDuration>

             <ManeuverPoint>

                 <Latitude>47.657259106636047</Latitude>

                 <Longitude>-117.41227939724922</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="ArriveFinish">Arrive at Spokane,
WA</Instruction>

             <CompassDirection>east</CompassDirection>

             <Hint hintType="PreviousIntersection">The last intersection is US-2 South /
US-395 West / N Browne St</Hint>

             <Hint hintType="NextIntersection">If you reach US-2 North / US-395 East / N
Division St, you've gone too far</Hint>

           </ItineraryItem>

         </RouteLeg>

       </Route>

       <Route>

         <Id>v60,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m0,o0,t0,wCLc7BHCbj/U=~kmIi/8k0swAAAA4BAAAAAAA=~dGhlIHNvdXRoIChvbi
BVUy0xOTUgTik=~~~,wqXc8BOY3kPU=~kmIi/8ntswAAAA4BjKv/PgA=~U3Bva2FuZSwgV0E=~0~~,k1</Id>

         <BoundingBox>

           <SouthLatitude>47.624192833900452</SouthLatitude>

           <WestLongitude>-117.4500972032547</WestLongitude>

           <NorthLatitude>47.657259106636047</NorthLatitude>

           <EastLongitude>-117.41123735904694</EastLongitude>

         </BoundingBox>

         <DistanceUnit>Kilometer</DistanceUnit>

         <DurationUnit>Second</DurationUnit>

                                                                                        280
<TravelDistance>6.357</TravelDistance>

<TravelDuration>352</TravelDuration>

<RouteLeg>

 <TravelDistance>6.357</TravelDistance>

 <TravelDuration>352</TravelDuration>

 <ActualStart>

   <Latitude>47.624192833900452</Latitude>

   <Longitude>-117.43913769721985</Longitude>

 </ActualStart>

 <ActualEnd>

   <Latitude>47.657259106636047</Latitude>

   <Longitude>-117.41227939724922</Longitude>

 </ActualEnd>

 <StartLocation>

   <Name>the south (on US-195 N)</Name>

   <Point>

     <Latitude>47.624192833900452</Latitude>

     <Longitude>-117.43913769721985</Longitude>

   </Point>

   <Confidence>High</Confidence>

 </StartLocation>

 <EndLocation>

   <Name>Spokane, WA</Name>

   <Point>

     <Latitude>47.6572597771883</Latitude>

     <Longitude>-117.41227939724922</Longitude>

   </Point>

   <Confidence>High</Confidence>

 </EndLocation>

 <ItineraryItem>

   <TravelMode>Driving</TravelMode>

   <TravelDistance>2.366</TravelDistance>

   <TravelDuration>92</TravelDuration>

   <ManeuverPoint>

                                                  281
               <Latitude>47.624192833900452</Latitude>

               <Longitude>-117.43913769721985</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="DepartStart">Depart US-195 North toward W Thorpe
Rd</Instruction>

             <CompassDirection>northwest</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>2.88</TravelDistance>

             <TravelDuration>126</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.644169926643372</Latitude>

               <Longitude>-117.44960904121399</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="RampThenHighwayRight">Take ramp right for I-90
East / US-2 North / US-395 East toward Spokane</Instruction>

             <CompassDirection>north</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.457</TravelDistance>

             <TravelDuration>24</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.652651071548462</Latitude>

               <Longitude>-117.41769075393677</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TakeRampRight">At exit 281, take ramp right for
Division St / US-2 East / US-395 North toward Newport / Colville</Instruction>

             <CompassDirection>east</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.57600000000000007</TravelDistance>


                                                                                     282
             <TravelDuration>86</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.652232646942139</Latitude>

               <Longitude>-117.41167724132538</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TurnLeft">Turn left onto US-2 East / US-395
North / S Division St</Instruction>

             <CompassDirection>north</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.078</TravelDistance>

             <TravelDuration>22</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.657259106636047</Latitude>

               <Longitude>-117.41123735904694</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TurnLeft">Turn left onto W Sprague
Ave</Instruction>

             <CompassDirection>west</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0</TravelDistance>

             <TravelDuration>0</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.657259106636047</Latitude>

               <Longitude>-117.41227939724922</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="ArriveFinish">Arrive at Spokane,
WA</Instruction>

             <CompassDirection>west</CompassDirection>

             <Hint hintType="PreviousIntersection">The last intersection is US-2 North /
US-395 East / N Division St</Hint>



                                                                                      283
             <Hint hintType="NextIntersection">If you reach US-2 South / US-395 West / N
Browne St, you've gone too far</Hint>

           </ItineraryItem>

         </RouteLeg>

       </Route>

       <Route>

         <Id>v60,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m0,o0,t0,wqBg8BIBJjvU=~kmIi/7masgAAAA4BAAAAAAA=~dGhlIHdlc3QgKG9uIF
VTLTIgRSk=~~~,wqXc8BOY3kPU=~kmIi/8ntswAAAA4BjKv/PgA=~U3Bva2FuZSwgV0E=~0~~,k1</Id>

         <BoundingBox>

           <SouthLatitude>47.632818818092346</SouthLatitude>

           <WestLongitude>-117.49714851379395</WestLongitude>

           <NorthLatitude>47.657259106636047</NorthLatitude>

           <EastLongitude>-117.41123735904694</EastLongitude>

         </BoundingBox>

         <DistanceUnit>Kilometer</DistanceUnit>

         <DurationUnit>Second</DurationUnit>

         <TravelDistance>8.071</TravelDistance>

         <TravelDuration>406</TravelDuration>

         <RouteLeg>

           <TravelDistance>8.071</TravelDistance>

           <TravelDuration>406</TravelDuration>

           <ActualStart>

             <Latitude>47.6409512758255</Latitude>

             <Longitude>-117.49714851379395</Longitude>

           </ActualStart>

           <ActualEnd>

             <Latitude>47.657259106636047</Latitude>

             <Longitude>-117.41227939724922</Longitude>

           </ActualEnd>

           <StartLocation>

             <Name>the west (on US-2 E)</Name>

             <Point>

                 <Latitude>47.6409512758255</Latitude>


                                                                                      284
               <Longitude>-117.49714851379395</Longitude>

             </Point>

             <Confidence>High</Confidence>

           </StartLocation>

           <EndLocation>

             <Name>Spokane, WA</Name>

             <Point>

               <Latitude>47.6572597771883</Latitude>

               <Longitude>-117.41227939724922</Longitude>

             </Point>

             <Confidence>High</Confidence>

           </EndLocation>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>1.183</TravelDistance>

             <TravelDuration>43</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.6409512758255</Latitude>

               <Longitude>-117.49714851379395</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="DepartStart">Depart US-2 East</Instruction>

             <CompassDirection>southeast</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>5.777</TravelDistance>

             <TravelDuration>229</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.635141611099243</Latitude>

               <Longitude>-117.48395204544067</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="RampThenHighwayLeft">Take ramp left for I-90
East / US-2 North / US-395 East toward Spokane</Instruction>

             <CompassDirection>southeast</CompassDirection>


                                                                                       285
           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.457</TravelDistance>

             <TravelDuration>24</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.652651071548462</Latitude>

               <Longitude>-117.41769075393677</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TakeRampRight">At exit 281, take ramp right for
Division St / US-2 East / US-395 North toward Newport / Colville</Instruction>

             <CompassDirection>east</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.57600000000000007</TravelDistance>

             <TravelDuration>86</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.652232646942139</Latitude>

               <Longitude>-117.41167724132538</Longitude>

             </ManeuverPoint>

             <Instruction maneuverType="TurnLeft">Turn left onto US-2 East / US-395
North / S Division St</Instruction>

             <CompassDirection>north</CompassDirection>

           </ItineraryItem>

           <ItineraryItem>

             <TravelMode>Driving</TravelMode>

             <TravelDistance>0.078</TravelDistance>

             <TravelDuration>22</TravelDuration>

             <ManeuverPoint>

               <Latitude>47.657259106636047</Latitude>

               <Longitude>-117.41123735904694</Longitude>

             </ManeuverPoint>




                                                                                      286
               <Instruction maneuverType="TurnLeft">Turn left onto W Sprague
Ave</Instruction>

               <CompassDirection>west</CompassDirection>

              </ItineraryItem>

              <ItineraryItem>

               <TravelMode>Driving</TravelMode>

               <TravelDistance>0</TravelDistance>

               <TravelDuration>0</TravelDuration>

               <ManeuverPoint>

                 <Latitude>47.657259106636047</Latitude>

                 <Longitude>-117.41227939724922</Longitude>

               </ManeuverPoint>

               <Instruction maneuverType="ArriveFinish">Arrive at Spokane,
WA</Instruction>

               <CompassDirection>west</CompassDirection>

               <Hint hintType="PreviousIntersection">The last intersection is US-2 North /
US-395 East / N Division St</Hint>

               <Hint hintType="NextIntersection">If you reach US-2 South / US-395 West / N
Browne St, you've gone too far</Hint>

              </ItineraryItem>

           </RouteLeg>

         </Route>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>



JSON Response
You would receive the following JSON response if the output=xml parameter was not set in this
example.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/veintplat3.live-int.com\/Branding\/logo_powered_by.png",




                                                                                            287
  "copyright":"Copyright © 2010 Microsoft and its suppliers. All rights reserved. This A
PI cannot be accessed and the content and any results may not be used, reproduced or tran
smitted in any manner without express written permission from Microsoft Corporation.",

  "resourceSets":[

      {

          "estimatedTotal":4,

          "resources":[

            {

                "__type":"Route:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v
1",

                "bbox":[

                     47.624192833900452,

                     -117.4500972032547,

                     47.657259106636047,

                     -117.41123735904694

                ],

                "id":"v60,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m0,o0,t0,wCLc7BHCbj\/U=~kmIi\/8k0swAAAA4BAAAAAAA=~dGhlIHNvdXRoIChv
biBVUy0xOTUgTik=~~~,wqXc8BOc3kPU=~kmIi\/8ntswAAAA4BkMT\/PgA=~U3Bva2FuZSwgV0E=~0~~,k1",

                "distanceUnit":"Kilometer",

                "durationUnit":"Second",

                "routeLegs":[

                     {

                         "actualEnd":{

                              "type":"Point",

                              "coordinates":[

                                  47.657259106636047,

                                  -117.41227872669697

                              ]

                         },

                         "actualStart":{

                              "type":"Point",

                              "coordinates":[

                                  47.624192833900452,

                                  -117.43913769721985

                                                                                         288
     ]

},

"endLocation":{

     "name":"Spokane, WA",

     "point":{

          "type":"Point",

          "coordinates":[

               47.65726,

               -117.412279

          ]

     },

     "confidence":"High",

     "entityType":null

},

"itineraryItems":[

     {

          "compassDirection":"northwest",

          "instruction":{

               "maneuverType":"DepartStart",

               "text":"Depart US-195 North toward W Thorpe Rd"

          },

          "maneuverPoint":{

               "type":"Point",

               "coordinates":[

                   47.624192833900452,

                   -117.43913769721985

               ]

          },

          "travelDistance":2.366,

          "travelDuration":92,

          "travelMode":"Driving"

     },

     {

          "compassDirection":"north",

                                                                 289
                                "instruction":{

                                     "maneuverType":"RampThenHighwayRight",

                                     "text":"Take ramp right for I-90 East \/ US-2 North \/ US-
395 East toward Spokane"

                                },

                                "maneuverPoint":{

                                     "type":"Point",

                                     "coordinates":[

                                         47.644169926643372,

                                         -117.44960904121399

                                     ]

                                },

                                "travelDistance":2.88,

                                "travelDuration":126,

                                "travelMode":"Driving"

                           },

                           {

                                "compassDirection":"east",

                                "instruction":{

                                     "maneuverType":"TakeRampRight",

                                     "text":"At exit 281, take ramp right for Division St \/ US-
2 East \/ US-395 North toward Newport \/ Colville"

                                },

                                "maneuverPoint":{

                                     "type":"Point",

                                     "coordinates":[

                                         47.652651071548462,

                                         -117.41769075393677

                                     ]

                                },

                                "travelDistance":0.457,

                                "travelDuration":24,

                                "travelMode":"Driving"

                           },


                                                                                             290
                       {

                            "compassDirection":"north",

                            "instruction":{

                                 "maneuverType":"TurnLeft",

                                 "text":"Turn left onto US-2 East \/ US-
395 North \/ S Division St"

                            },

                            "maneuverPoint":{

                                 "type":"Point",

                                 "coordinates":[

                                     47.652232646942139,

                                     -117.41167724132538

                                 ]

                            },

                            "travelDistance":0.57600000000000007,

                            "travelDuration":86,

                            "travelMode":"Driving"

                       },

                       {

                            "compassDirection":"west",

                            "instruction":{

                                 "maneuverType":"TurnLeft",

                                 "text":"Turn left onto W Sprague Ave"

                            },

                            "maneuverPoint":{

                                 "type":"Point",

                                 "coordinates":[

                                     47.657259106636047,

                                     -117.41123735904694

                                 ]

                            },

                            "travelDistance":0.078,

                            "travelDuration":22,

                            "travelMode":"Driving"


                                                                           291
                         },

                         {

                              "compassDirection":"west",

                              "hints":[

                                   {

                                        "hintType":"PreviousIntersection",

                                        "text":"The last intersection is US-2 North \/ US-
395 East \/ N Division St"

                                   },

                                   {

                                        "hintType":"NextIntersection",

                                        "text":"If you reach US-2 South \/ US-
395 West \/ N Browne St, you've gone too far"

                                   }

                              ],

                              "instruction":{

                                   "maneuverType":"ArriveFinish",

                                   "text":"Arrive at Spokane, WA"

                              },

                              "maneuverPoint":{

                                   "type":"Point",

                                   "coordinates":[

                                        47.657259106636047,

                                        -117.41227872669697

                                   ]

                              },

                              "travelDistance":0,

                              "travelDuration":0,

                              "travelMode":"Driving"

                         }

                    ],

                    "startLocation":{

                         "name":"the south (on US-195 N)",

                         "point":{


                                                                                             292
                                   "type":"Point",

                                   "coordinates":[

                                       47.624192833900452,

                                       -117.43913769721985

                                   ]

                              },

                              "confidence":"High",

                              "entityType":null

                         },

                         "travelDistance":6.357,

                         "travelDuration":352

                     }

                ],

                "travelDistance":6.357,

                "travelDuration":352

           },

           {

                "__type":"Route:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v
1",

                "bbox":[

                     47.657259106636047,

                     -117.41332948207855,

                     47.6739102602005,

                     -117.41115152835846

                ],

                "id":"v60,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m0,o0,t0,wqNg8BHg+kPU=~kmIi\/zEItAAAAA4BAAAAAAA=~dGhlIG5vcnRoIChvb
iBVUy0yIFcgLyBVUy0zOTUgUyAvIE4gRGl2aXNpb24gU3Qp~~~,wqXc8BOc3kPU=~kmIi\/8ntswAAAA4BkMT\/Pg
A=~U3Bva2FuZSwgV0E=~0~~,k1",

                "distanceUnit":"Kilometer",

                "durationUnit":"Second",

                "routeLegs":[

                     {

                         "actualEnd":{



                                                                                       293
                         "type":"Point",

                         "coordinates":[

                              47.657259106636047,

                              -117.41227872669697

                         ]

                    },

                    "actualStart":{

                         "type":"Point",

                         "coordinates":[

                              47.6739102602005,

                              -117.41115152835846

                         ]

                    },

                    "endLocation":{

                         "name":"Spokane, WA",

                         "point":{

                              "type":"Point",

                              "coordinates":[

                                   47.65726,

                                   -117.412279

                              ]

                         },

                         "confidence":"High",

                         "entityType":null

                    },

                    "itineraryItems":[

                         {

                              "compassDirection":"south",

                              "instruction":{

                                   "maneuverType":"DepartStart",

                                   "text":"Depart US-2 West \/ US-
395 South \/ N Division St toward W Augusta Ave"

                              },

                              "maneuverPoint":{


                                                                     294
                                     "type":"Point",

                                     "coordinates":[

                                         47.6739102602005,

                                         -117.41115152835846

                                     ]

                                },

                                "travelDistance":1.954,

                                "travelDuration":176,

                                "travelMode":"Driving"

                           },

                           {

                                "compassDirection":"east",

                                "instruction":{

                                     "maneuverType":"TurnLeft",

                                     "text":"Turn left onto W Sprague Ave"

                                },

                                "maneuverPoint":{

                                     "type":"Point",

                                     "coordinates":[

                                         47.657259106636047,

                                         -117.41331875324249

                                     ]

                                },

                                "travelDistance":0.078,

                                "travelDuration":22,

                                "travelMode":"Driving"

                           },

                           {

                                "compassDirection":"east",

                                "hints":[

                                     {

                                         "hintType":"PreviousIntersection",

                                         "text":"The last intersection is US-2 South \/ US-
395 West \/ N Browne St"


                                                                                              295
                                   },

                                   {

                                        "hintType":"NextIntersection",

                                        "text":"If you reach US-2 North \/ US-
395 East \/ N Division St, you've gone too far"

                                   }

                              ],

                              "instruction":{

                                   "maneuverType":"ArriveFinish",

                                   "text":"Arrive at Spokane, WA"

                              },

                              "maneuverPoint":{

                                   "type":"Point",

                                   "coordinates":[

                                        47.657259106636047,

                                        -117.41227872669697

                                   ]

                              },

                              "travelDistance":0,

                              "travelDuration":0,

                              "travelMode":"Driving"

                         }

                    ],

                    "startLocation":{

                         "name":"the north (on US-2 W \/ US-395 S \/ N Division St)",

                         "point":{

                              "type":"Point",

                              "coordinates":[

                                   47.6739102602005,

                                   -117.41115152835846

                              ]

                         },

                         "confidence":"High",

                         "entityType":null


                                                                                        296
                         },

                         "travelDistance":2.032,

                         "travelDuration":199

                     }

                ],

                "travelDistance":2.032,

                "travelDuration":199

           },

           {

                "__type":"Route:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v
1",

                "bbox":[

                     47.632818818092346,

                     -117.49714851379395,

                     47.657259106636047,

                     -117.41123735904694

                ],

                "id":"v60,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m0,o0,t0,wqBg8BIBJjvU=~kmIi\/7masgAAAA4BAAAAAAA=~dGhlIHdlc3QgKG9uI
FVTLTIgRSk=~~~,wqXc8BOc3kPU=~kmIi\/8ntswAAAA4BkMT\/PgA=~U3Bva2FuZSwgV0E=~0~~,k1",

                "distanceUnit":"Kilometer",

                "durationUnit":"Second",

                "routeLegs":[

                     {

                         "actualEnd":{

                              "type":"Point",

                              "coordinates":[

                                  47.657259106636047,

                                  -117.41227872669697

                              ]

                         },

                         "actualStart":{

                              "type":"Point",

                              "coordinates":[


                                                                                       297
          47.6409512758255,

          -117.49714851379395

     ]

},

"endLocation":{

     "name":"Spokane, WA",

     "point":{

          "type":"Point",

          "coordinates":[

               47.65726,

               -117.412279

          ]

     },

     "confidence":"High",

     "entityType":null

},

"itineraryItems":[

     {

          "compassDirection":"southeast",

          "instruction":{

               "maneuverType":"DepartStart",

               "text":"Depart US-2 East"

          },

          "maneuverPoint":{

               "type":"Point",

               "coordinates":[

                   47.6409512758255,

                   -117.49714851379395

               ]

          },

          "travelDistance":1.183,

          "travelDuration":43,

          "travelMode":"Driving"

     },

                                               298
                           {

                                "compassDirection":"southeast",

                                "instruction":{

                                     "maneuverType":"RampThenHighwayLeft",

                                     "text":"Take ramp left for I-90 East \/ US-2 North \/ US-
395 East toward Spokane"

                                },

                                "maneuverPoint":{

                                     "type":"Point",

                                     "coordinates":[

                                         47.635141611099243,

                                         -117.48395204544067

                                     ]

                                },

                                "travelDistance":5.777,

                                "travelDuration":229,

                                "travelMode":"Driving"

                           },

                           {

                                "compassDirection":"east",

                                "instruction":{

                                     "maneuverType":"TakeRampRight",

                                     "text":"At exit 281, take ramp right for Division St \/ US-
2 East \/ US-395 North toward Newport \/ Colville"

                                },

                                "maneuverPoint":{

                                     "type":"Point",

                                     "coordinates":[

                                         47.652651071548462,

                                         -117.41769075393677

                                     ]

                                },

                                "travelDistance":0.457,

                                "travelDuration":24,


                                                                                             299
                            "travelMode":"Driving"

                       },

                       {

                            "compassDirection":"north",

                            "instruction":{

                                 "maneuverType":"TurnLeft",

                                 "text":"Turn left onto US-2 East \/ US-
395 North \/ S Division St"

                            },

                            "maneuverPoint":{

                                 "type":"Point",

                                 "coordinates":[

                                     47.652232646942139,

                                     -117.41167724132538

                                 ]

                            },

                            "travelDistance":0.57600000000000007,

                            "travelDuration":86,

                            "travelMode":"Driving"

                       },

                       {

                            "compassDirection":"west",

                            "instruction":{

                                 "maneuverType":"TurnLeft",

                                 "text":"Turn left onto W Sprague Ave"

                            },

                            "maneuverPoint":{

                                 "type":"Point",

                                 "coordinates":[

                                     47.657259106636047,

                                     -117.41123735904694

                                 ]

                            },

                            "travelDistance":0.078,


                                                                           300
                              "travelDuration":22,

                              "travelMode":"Driving"

                         },

                         {

                              "compassDirection":"west",

                              "hints":[

                                   {

                                        "hintType":"PreviousIntersection",

                                        "text":"The last intersection is US-2 North \/ US-
395 East \/ N Division St"

                                   },

                                   {

                                        "hintType":"NextIntersection",

                                        "text":"If you reach US-2 South \/ US-
395 West \/ N Browne St, you've gone too far"

                                   }

                              ],

                              "instruction":{

                                   "maneuverType":"ArriveFinish",

                                   "text":"Arrive at Spokane, WA"

                              },

                              "maneuverPoint":{

                                   "type":"Point",

                                   "coordinates":[

                                        47.657259106636047,

                                        -117.41227872669697

                                   ]

                              },

                              "travelDistance":0,

                              "travelDuration":0,

                              "travelMode":"Driving"

                         }

                    ],

                    "startLocation":{


                                                                                             301
                              "name":"the west (on US-2 E)",

                              "point":{

                                   "type":"Point",

                                   "coordinates":[

                                       47.6409512758255,

                                       -117.49714851379395

                                   ]

                              },

                              "confidence":"High",

                              "entityType":null

                         },

                         "travelDistance":8.071,

                         "travelDuration":406

                     }

                ],

                "travelDistance":8.071,

                "travelDuration":406

           },

           {

                "__type":"Route:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v
1",

                "bbox":[

                     47.65221118927002,

                     -117.41227872669697,

                     47.657259106636047,

                     -117.38137900829315

                ],

                "id":"v60,i0,a0,cen-
US,dAAAAAAAAAAA=,y0,s1,m0,o0,t0,woGQ8BOjrkPU=~kmIi\/8mBtAAAAA4BAAAAAAA=~dGhlIGVhc3QgKG9uI
EktOTAgVyk=~~~,wqXc8BOc3kPU=~kmIi\/8ntswAAAA4BkMT\/PgA=~U3Bva2FuZSwgV0E=~0~~,k1",

                "distanceUnit":"Kilometer",

                "durationUnit":"Second",

                "routeLegs":[

                     {


                                                                                       302
"actualEnd":{

     "type":"Point",

     "coordinates":[

          47.657259106636047,

          -117.41227872669697

     ]

},

"actualStart":{

     "type":"Point",

     "coordinates":[

          47.653992176055908,

          -117.38137900829315

     ]

},

"endLocation":{

     "name":"Spokane, WA",

     "point":{

          "type":"Point",

          "coordinates":[

               47.65726,

               -117.412279

          ]

     },

     "confidence":"High",

     "entityType":null

},

"itineraryItems":[

     {

          "compassDirection":"west",

          "instruction":{

               "maneuverType":"DepartStart",

               "text":"Depart I-90 West"

          },

          "maneuverPoint":{

                                               303
                                  "type":"Point",

                                  "coordinates":[

                                      47.653992176055908,

                                      -117.38137900829315

                                  ]

                             },

                             "travelDistance":1.866,

                             "travelDuration":67,

                             "travelMode":"Driving"

                        },

                        {

                             "compassDirection":"west",

                             "instruction":{

                                  "maneuverType":"TakeRampRight",

                                  "text":"At exit 281, take ramp right for US-
395 North \/ US-2 North toward Newport \/ Colville"

                             },

                             "maneuverPoint":{

                                  "type":"Point",

                                  "coordinates":[

                                      47.652361392974854,

                                      -117.40572810173035

                                  ]

                             },

                             "travelDistance":0.482,

                             "travelDuration":66,

                             "travelMode":"Driving"

                        },

                        {

                             "compassDirection":"north",

                             "instruction":{

                                  "maneuverType":"BearRight",

                                  "text":"Bear right onto US-2 East \/ US-
395 North \/ S Division St"


                                                                                 304
     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              47.653520107269287,

              -117.41123735904694

          ]

     },

     "travelDistance":0.418,

     "travelDuration":57,

     "travelMode":"Driving"

},

{

     "compassDirection":"west",

     "instruction":{

          "maneuverType":"TurnLeft",

          "text":"Turn left onto W Sprague Ave"

     },

     "maneuverPoint":{

          "type":"Point",

          "coordinates":[

              47.657259106636047,

              -117.41123735904694

          ]

     },

     "travelDistance":0.078,

     "travelDuration":22,

     "travelMode":"Driving"

},

{

     "compassDirection":"west",

     "hints":[

          {

              "hintType":"PreviousIntersection",

                                                   305
                                        "text":"The last intersection is US-2 North \/ US-
395 East \/ N Division St"

                                   },

                                   {

                                        "hintType":"NextIntersection",

                                        "text":"If you reach US-2 South \/ US-
395 West \/ N Browne St, you've gone too far"

                                   }

                              ],

                              "instruction":{

                                   "maneuverType":"ArriveFinish",

                                   "text":"Arrive at Spokane, WA"

                              },

                              "maneuverPoint":{

                                   "type":"Point",

                                   "coordinates":[

                                        47.657259106636047,

                                        -117.41227872669697

                                   ]

                              },

                              "travelDistance":0,

                              "travelDuration":0,

                              "travelMode":"Driving"

                         }

                    ],

                    "startLocation":{

                         "name":"the east (on I-90 W)",

                         "point":{

                              "type":"Point",

                              "coordinates":[

                                   47.653992176055908,

                                   -117.38137900829315

                              ]

                         },


                                                                                             306
                                    "confidence":"High",

                                    "entityType":null

                               },

                               "travelDistance":2.844,

                               "travelDuration":214

                           }

                      ],

                      "travelDistance":2.844,

                      "travelDuration":214

                  }

              ]

          }

     ],

     "statusCode":200,

     "statusDescription":"OK",

     "traceId":"84c3d8e2626340e99a02f6e1c0c06543"

}


HTTP Status Codes


     For more details about these HTTP status codes, see Status Codes and Errors.
When the request is successful, the following HTTP status code is returned.
   200
When the request is not successful, the response returns one of the following errors.
   400
   401
   404
   500
   503


Route Data
The response returned by a Routes URL contains a Route resource. The information provided in
the Route resource includes the route distance, the travel time, and the itinerary details for each
route leg. A route leg is a section of the route defined by two waypoints, and it provides a set of
route steps to follow. A route step includes instructions, as well as further details (warnings and
hints) about the route, when available. When a route path is requested by setting the


                                                                                                307
routePathOutput parameter in the request, the Route resource also provides a set of Point
(latitude and longitude) values for each route leg. The following tables provide the descriptions of
the Route resource fields, followed by XML and JSON examples.
For more information about the common response container for the Bing Maps REST Services,
see Common Response Description.

Route Resource
The following tables describe the fields in the Route resource in a hierarchical manner.
Top-level Route Resource Fields
The following fields are the top-level fields in the Routes resource. Additional tables describe the
fields in each of the collections.


JSON                     XML                      Type                     Description

id                       Id                       string                   A unique ID for the
                                                                           resource.

bbox                     BoundingBox              BoundingBox. For         Defines a rectangular
                                                  more information         area by using latitude
                                                  about the                and longitude
                                                  BoundingBox type,        boundaries that contain
                                                  see Location and         the corresponding route
                                                  Area Types.              or location. A bounding
                                                                           box contains
                                                                           SouthLatitude,
                                                                           WestLongitude,
                                                                           NorthLatitude, and
                                                                           EastLongitude elements.

distanceUnit             DistanceUnit             string                   The unit used for
                                                                           distance.

durationUnit             DurationUnit             string                   The unit used for time of
                                                                           travel.

travelDistance           TravelDistance           double                   The physical distance
                                                                           covered by the entire
                                                                           route.


                                                                               This value is not
                                                                               supported for
                                                                               the Transit travel
                                                                               mode.

travelDuration           TravelDuration           double                   The time in seconds that

                                                                                                    308
JSON                    XML                      Type                    Description
                                                                         it takes to travel a
                                                                         corresponding
                                                                         TravelDistance.

routeLegs               RouteLeg                 collection              Information about a
                                                                         section of a route
                                                                         between two waypoints.
                                                                         For more information
                                                                         about the fields
                                                                         contained ina routeLeg,
                                                                         see the Route Leg
                                                                         Fields section below.

routePath               RoutePath                collection              A representation of the
                                                                         path of a route. A
                                                                         RoutePath is returned
                                                                         only if the
                                                                         routePathOutput
                                                                         parameter is set to
                                                                         Points. A RoutePath is
                                                                         defined by a Line
                                                                         element that contains of
                                                                         a collection of points.
                                                                         The path of the route is
                                                                         the line that connects
                                                                         these Points. For more
                                                                         information about the
                                                                         fields contained in a
                                                                         route Path, see the
                                                                         Route Path Fields
                                                                         section below.



Route Leg Fields
These fields are specific to the RouteLeg collection in the Route resource.


JSON                     XML                       Type                   Description

travelDistance           TravelDistance            double                 The physical distance
                                                                          covered by a route leg.

travelDuration           TravelDuration            double                 The time, in seconds,
                                                                          that it takes to travel a

                                                                                                 309
JSON            XML             Type                  Description
                                                      corresponding
                                                      TravelDistance.

actualStart     ActualStart     Point. For more       The Point (latitude and
                                information about     longitude) that was
                                the Point type, see   used as the actual
                                Location and Area     starting location for the
                                Types.                route leg. In most
                                                      cases, the ActualStart
                                                      is the same as the
                                                      requested waypoint.
                                                      However, if a waypoint
                                                      is not close to a road,
                                                      the Routes API
                                                      chooses a location on
                                                      the nearest road as the
                                                      starting point of the
                                                      route. This ActualStart
                                                      element contains the
                                                      latitude and longitude of
                                                      this new location.

actualEnd       ActualEnd       Point. For more       The Point (latitude and
                                information about     longitude) that was
                                the Point type, see   used as the actual
                                Location and Area     ending location for the
                                Types.                route leg. In most
                                                      cases, the ActualEnd is
                                                      the same as the
                                                      requested waypoint.
                                                      However, if a waypoint
                                                      is not close to a road,
                                                      the Routes API
                                                      chooses a location on
                                                      the nearest road as the
                                                      ending point of the
                                                      route. This ActualEnd
                                                      element contains the
                                                      latitude and longitude of
                                                      this new location.

startLocation   StartLocation   collection            Information about the
                                                      location of the starting

                                                                            310
JSON                     XML                      Type                      Description
                                                                            waypoint for a route. A
                                                                            StartLocation is
                                                                            provided only when the
                                                                            waypoint is specified as
                                                                            a landmark or an
                                                                            address. For more
                                                                            information about the
                                                                            fields contained in a
                                                                            Location collection, see
                                                                            the Location Fields
                                                                            table below.

endLocation              EndLocation              collection                Information about the
                                                                            location of the ending
                                                                            waypoint for a route. An
                                                                            EndLocation is provided
                                                                            only when the waypoint
                                                                            is specified as a
                                                                            landmark or an
                                                                            address. For more
                                                                            information about the
                                                                            fields contained in a
                                                                            Location collection, see
                                                                            the Locations Fields
                                                                            table below.

itineraryItem            ItineraryItem            collection                Information that defines
                                                                            a step in the route. For
                                                                            information about the
                                                                            fields that make up the
                                                                            ItineraryItem collection,
                                                                            see the Itinerary Item
                                                                            Fields table below.




Location Fields
These fields are found in the StartLocation and EndLocation collections.


JSON                    XML                     Type                       Description

name                    Name                    string                     The name of a location,

                                                                                                  311
JSON            XML            Type                    Description
                                                       such as San Francisco,
                                                       CA.

point           Point          Point. For more         The coordinates of a
                               information about the   point on the Earth. A
                               Point type, see         point contains Latitude
                               Location and Area       and Longitude elements.
                               Types.                  This point is also
                                                       included in the geocode
                                                       points collection.

geocodePoints   GeocodePoint   collection              A collection of geocoded
                                                       points that differ in how
                                                       they were calculated and
                                                       their suggested use. For
                                                       a description of the
                                                       points in this collection,
                                                       see the Geocode Point
                                                       Fields section below.

bbox            BoundingBox    BoundingBox. For        Defines a rectangular
                               more information        area by using latitude
                               about the               and longitude boundaries
                               BoundingBox type,       that contain the
                               see Location and        corresponding route or
                               Area Types.             location. A bounding box
                                                       contains SouthLatitude,
                                                       WestLongitude,
                                                       NorthLatitude, and
                                                       EastLongitude elements.

entityType      EntityType     string                  A type of location.
                                                       Examples include
                                                       PopulatedPlace and
                                                       Monument.

address         Address        Address                 The postal address of a
                                                       location. An Address can
                                                       contain AddressLine,
                                                       AdminDistrict,
                                                       AdminDistrict2,
                                                       CountryRegion,
                                                       FormattedAddress,
                                                       Locality, and PostalCode

                                                                              312
JSON         XML          Type                   Description
                                                 elements.

confidence   Confidence   One of the following   The confidence of the
                          values:                match.
                          High, Medium, Low,
                          Unknown

matchCodes   MatchCode    One or more of the     A collection of match
                          following values:      code values that
                          Good, Ambiguous,       represent the geocoding
                          UpHierarchy            level for each location in
                                                 the response. The
                                                 possible values are:
                                                 Good: The location has
                                                 only one match.
                                                 Ambiguous: The
                                                 location is one of a set of
                                                 possible matches. For
                                                 example, when you
                                                 query for the street
                                                 address 128 Main St.,
                                                 the response may return
                                                 two locations for 128
                                                 North Main St. and 128
                                                 South Main St. because
                                                 there is not enough
                                                 information to determine
                                                 which option to choose.
                                                 UpHierarchy: The
                                                 location represents a
                                                 move up the geographic
                                                 hierarchy. This occurs
                                                 when a match for the
                                                 location request was not
                                                 found, so a less precise
                                                 result is returned. For
                                                 example, if a match for
                                                 the requested address
                                                 cannot be found, then a
                                                 match code of
                                                 UpHierarchy with a
                                                 postal code may be

                                                                         313
JSON                    XML                     Type                      Description
                                                                          returned.




Geocode Point Fields
The following fields are provided for each geocode point in the Geocode Points collection.


JSON                     XML                       Type                          Description

point                    Point                     Point. For more               The latitude and
                                                   information about the         longitude
                                                   Point type, see Location      coordinates of the
                                                   and Area Types.               geocode point.

calculationMethod        CalculationMethod         One of the following          The method that
                                                   values:                       was used to
                                                      Interpolation: The       compute the
                                                        geocode point was        geocode point.
                                                        matched to a point on
                                                        a road using
                                                        interpolation.
                                                      InterpolationOffset:
                                                        The geocode point
                                                        was matched to a
                                                        point on a road using
                                                        interpolation with an
                                                        additional offset to
                                                        shift the point to the
                                                        side of the street.
                                                      ParcelCentroid: The
                                                        geocode point was
                                                        matched to the center
                                                        of a parcel.
                                                      Rooftop: The geocode
                                                        point was matched to
                                                        the rooftop of a
                                                        building.

usageTypes               usageType                 One or more of the            The best use for
                                                   following values:             the geocode
                                                      Display                  point.
                                                      Route                    Each geocode
                                                                                 point is defined

                                                                                                314
JSON                      XML                       Type                            Description
                                                                                    as a Route point,
                                                                                    a Display point or
                                                                                    both.
                                                                                    Use Route points
                                                                                    if you are creating
                                                                                    a route to the
                                                                                    location. Use
                                                                                    Display points if
                                                                                    you are showing
                                                                                    the location on a
                                                                                    map. For
                                                                                    example, if the
                                                                                    location is a park,
                                                                                    a Route point
                                                                                    may specify an
                                                                                    entrance to the
                                                                                    park where you
                                                                                    can enter with a
                                                                                    car, and a
                                                                                    Display point may
                                                                                    be a point that
                                                                                    specifies the
                                                                                    center of the
                                                                                    park.




Itinerary Item Fields
These fields are found in the ItineraryItem collection. Each itinerary item provides information
about a route step.


JSON                     XML                        Type              Description

childItineraryItems      ChildItineraryItems        collection        A collection of ItineraryItems
                                                                      that divides an itinerary item
                                                                      into smaller steps. An
                                                                      itinerary item can have only
                                                                      one set of
                                                                      ChildItineraryItems.

compassDirection         CompassDirection           string            The direction of travel
                                                                      associated with a maneuver
                                                                                                   315
JSON       XML        Type         Description
                                   on a route, such as south or
                                   southwest.


                                        This value is not
                                        supported for the
                                        Transit travel mode.

details    Detail     collection   Information about one of the
                                   maneuvers that is part of the
                                   itinerary item. An
                                   ItineraryItem can contain
                                   more than one Detail
                                   collection. For information
                                   about the fields contained in
                                   a Detail collection, see the
                                   Detail Fields table below.

exit       Exit       string       The name or number of the
                                   exit associated with this
                                   itinerary step.

hints      Hint       string       Additional information that
                                   may be helpful in following a
                                   route. In addition to the hint
                                   text, this element has an
                                   attribute hintType that
                                   specifies what the hint refers
                                   to, such as
                                   “NextIntersection.” Hint is an
                                   optional element and a route
                                   step can contain more than
                                   one hint.

iconType   IconType   string       The type of icon to display.
                                   Possible values include:
                                      None
                                      Airline
                                      Auto
                                      Bus
                                      Ferry
                                      Train
                                      Walk

                                                               316
JSON            XML             Type              Description
                                                     Other

instruction     Instruction     string            A description of a maneuver
                                                  in a set of directions. In
                                                  addition to the content of the
                                                  instruction field, this field has
                                                  an attribute maneuverType
                                                  that is set to the type of
                                                  maneuver, such as
                                                  “TurnLeft.”

maneuverPoint   ManeuverPoint   Point. For more   The coordinates of a point on
                                information       the Earth where a maneuver
                                about the Point   is required, such as a left
                                type, see         turn. A ManeuverPoint
                                Location and      contains Latitude and
                                Area Types.       Longitude elements.


                                                       This value is not
                                                       supported for
                                                       ItineraryItems that
                                                       are part of a
                                                       ChildItineraryItems
                                                       collection.

sideOfStreet    SideOfStreet    string            The side of the street where
                                                  the destination is found
                                                  based on the arrival
                                                  direction. This field applies to
                                                  the last itinerary item only.
                                                  Possible values include:
                                                     Left
                                                     Right
                                                     Unknown

signs           Sign            string            Signage text for the route.
                                                  There may be more than one
                                                  sign value for an itinerary
                                                  item.

time            Time            DateTime          The arrival or departure time
                                                  for the transit step.


                                                                               317
JSON              XML               Type         Description
                                                 Examples:
                                                 XML: 2011-10-7T9:37:47
                                                 JSON: 1318005467000-0700
                                                 The JSON response returns
                                                 departure and arrival times
                                                 as DateTime strings, such as
                                                 1318005467000-0700. The first
                                                 integer in the string
                                                 (1318005467000) represents
                                                 the number of seconds since
                                                 12:00:00 midnight, January
                                                 1, 1970 UTC. The remainder
                                                 of the string (-0700)
                                                 represents an offset in hours
                                                 that you must apply to get
                                                 the local time. For example,
                                                 the integer 1318005467000
                                                 represents the time
                                                 '10/7/2011 4:37:47 PM'.
                                                 When you apply the -0700
                                                 offset, you compute the local
                                                 time as '10/7/2011 9:37:47
                                                 AM'. For more information,
                                                 see DateTime Structure.

tollZone          tollZone          string       The name or number of the
                                                 toll zone.

towardsRoadName   TowardsRoadName   string       The name of the street that
                                                 the route goes towards in the
                                                 first itinerary item.

transitLine       TransitLine       collection   Information about the transit
                                                 line associated with the
                                                 itinerary item. For more
                                                 information about the fields
                                                 contained in the TransitLine
                                                 collection, see the Transit
                                                 Line Fields table below.

transitStopId     TransitStopId     string       The ID assigned to the transit
                                                 stop by the transit agency.


                                                                           318
JSON              XML               Type     Description

transitTerminus   TransitTerminus   string   The end destination for the
                                             transit line in the direction
                                             you are traveling.

travelDistance    TravelDistance    double   The physical distance
                                             covered by this route step.


                                                 This value is not
                                                 supported for the
                                                 Transit travel mode.

travelDuration    TravelDuration    double   The time in seconds that it
                                             takes to travel a
                                             corresponding
                                             TravelDistance.

travelMode        TravelMode        string   The mode of travel for a
                                             specific step in the route.


                                                 This value is not
                                                 supported for
                                                 ItineraryItems that
                                                 are part of a
                                                 ChildItineraryItems
                                                 collection.

warnings          Warning           string   Information about a condition
                                             that may affect a specific
                                             step in the route. Warning is
                                             an optional element and a
                                             route step can contain more
                                             than one warning. Warnings
                                             can include traffic incident
                                             information such as
                                             congestion, accident and
                                             blocked road reports.
                                             Warning elements are further
                                             defined by two attributes:
                                             Severity and WarningType.
                                             Severity can have the
                                             following values: Low Impact,


                                                                           319
JSON                    XML                        Type               Description
                                                                      Minor, Moderate, or Serious.
                                                                      See Warning Types for a list
                                                                      of warning types.




Detail Fields


   Any detail fields that are returned in the response and that are not in this table are not
   supported.


JSON                     XML                         Type              Description

compassDegrees           CompassDegrees              string            The direction in degrees.


                                                                           This value is not
                                                                           supported for the
                                                                           Transit travel mode.

maneuverType             ManeuverType                string            The type of maneuver
                                                                       described by this detail
                                                                       collection. The
                                                                       ManeuverType in A detail
                                                                       collection can provide
                                                                       information for a portion of
                                                                       the maneuver described by
                                                                       the maneuverType attribute
                                                                       of the corresponding
                                                                       Instruction. For example the
                                                                       maneuverType attribute of
                                                                       an Instruction may specify
                                                                       TurnLeftThenTurnRight as
                                                                       the maneuver while the
                                                                       associated detail items may
                                                                       specify specifics about the
                                                                       TurnLeft and TurnRight
                                                                       maneuvers.
                                                                       For a list of maneuver types,
                                                                       see Maneuver Types.



                                                                                                   320
JSON               XML              Type      Description

names              Name             string    A street, highway or
                                              intersection where the
                                              maneuver occurs. If the
                                              maneuver is complex, there
                                              may be more than one
                                              name field in the details
                                              collection. The name field
                                              may also have no value.
                                              This can occur if the name
                                              is not known or if a street,
                                              highway or intersection
                                              does not have a name.


                                                  This value is only
                                                  supported for the
                                                  transit travel mode.

StartPathIndices   StartPathIndex   strings   These fields specify index
EndPathIndices     EndPathIndex               values for specific route
                                              path points that are returned
                                              in the response when the
                                              routePathOutput parameter
                                              is set to Points. Together,
                                              these two index values
                                              define a range of route path
                                              points that correspond to a
                                              maneuver. Route path index
                                              values are integers where
                                              the first route path point has
                                              an index value of 0.

roadType           RoadType         string    The type of road.

locationCode       LocationCode     string    A traffic location code. Each
                                              location code provides
                                              traffic incident information
                                              for pre-defined road
                                              segments. There may be
                                              multiple codes for each
                                              Detail collection in the
                                              response. A subscription is
                                              typically required to be able

                                                                         321
JSON                  XML                Type        Description
                                                     to interpret these codes for
                                                     a geographical area or
                                                     country.




Transit Line Fields


JSON                   XML                  Type           Description

verboseName            VerboseName          string         The full name of the
                                                           transit line.

abbreviatedName        AbbreviatedName      string         The abbreviated
                                                           name of the transit
                                                           line, such as the bus
                                                           number.

AgencyId               AgencyId             string         The ID associated
                                                           with the transit
                                                           agency.

agencyName             AgencyName           string         The name of the
                                                           transit agency.

lineColor              LineColor            string         The color associated
                                                           with the transit line.
                                                           The color is provided
                                                           as an RGB value.

lineTextColor          LineTextColor        string         The color to use for
                                                           text associated with
                                                           the transit line. The
                                                           color is provided as
                                                           an RGB value.

uri                    Uri                  string         The URI for the
                                                           transit agency.

phoneNumber            PhoneNumber          string         The phone number of
                                                           the transit agency.

providerInfo           ProviderInfo         string         The contact
                                                           information for the
                                                           provider of the transit


                                                                               322
JSON                          XML                      Type                Description
                                                                           information.


Route Path Fields
A Route Path is included in the response when the RoutePathOutput parameter is set to Points in
the request. The Route Path provides a set of latitude and longitude values that make up the
route path. When tolerances are specified in the request, subsets of these points called route
path generalizations are provided that can be used to represent the route on maps that do not
need the accuracy of the complete set of points.


JSON                  XML                          Type              Description

line                  Line                         collection        A collection of point
                                                                     (latitude and longitude)
                                                                     elements. When the points
                                                                     in the line are connected,
                                                                     they represent the path of
                                                                     the route.

point                 Point                        Point. For        The coordinates of a point
                                                   more              on the Earth. A point
                                                   information       contains Latitude and
                                                   about the point   Longitude elements.
                                                   type, see
                                                   Location and
                                                   Area Types.

generalizations       RoutePathGeneralization      collection        A generalization is a
                                                                     collection of index elements
                                                                     and a latlongtolerance
                                                                     element specifying a subset
                                                                     of route points that satisfy
                                                                     the tolerance.

pathIndices           Index                        integer           Specifies a subset of points
                                                                     from the complete set of
                                                                     route path points (line
                                                                     collection) to include in the
                                                                     RoutePathGeneralization.
                                                                     The list of point values in
                                                                     the route path line collection
                                                                     are given indices starting
                                                                     with 0. For example, an
                                                                     index value of 0 indicates

                                                                                               323
JSON                   XML                          Type               Description
                                                                       that the first point in the
                                                                       Line collection is included in
                                                                       this
                                                                       RoutePathGeneralization.

latLongTolerance       LatLongTolerance             integer            The tolerance specified in
                                                                       the route request that is
                                                                       associated with the
                                                                       RoutePathGeneralization.


Examples
See the following topics for response examples.
   Walking Route Example
   Driving Route Example
   Transit Route Example
   Driving Route with Route Path Example
   Driving Route using Tolerances Example


Maneuver Types
The following maneuver type values are returned the Routes API in the maneuverType field in the
HTTP response. For more information about the values returned in the Routes API response, see
Route Data.


Maneuver Type                                     Instruction

ArriveFinish                                      Arrive at the final destination.

ArriveIntermediate                                Arrive at an intermediate waypoint.

BearLeft                                          Bear left.

BearLeftThenBearLeft                              Bear left and then bear left again.

BearLeftThenBearRight                             Bear left and then bear right.

BearLeftThenTurnLeft                              Bear left and then turn left.

BearLeftThenTurnRight                             Bear left and then turn right.

BearRight                                         Bear right.

BearRightThenBearLeft                             Bear right and then bear left.


BearRightThenBearRight                            Bear right and then bear right again.

                                                                                                 324
Maneuver Type                     Instruction

BearRightThenTurnLeft             Bear right and then turn left.

BearRightThenTurnRight            Bear right and then turn right.

BearThenKeep                      Bear instruction and then a keep instruction

BearThenMerge                     Bear instruction and then a merge instruction.

Continue                          Continue on the current road.

DepartIntermediateStop            Leave an intermediate waypoint in a different
                                  direction and road than you arrived on.

DepartIntermediateStopReturning   Leave an intermediate waypoint in the same
                                  direction and on the same road that you arrived
                                  on.

DepartStart                       Leave the starting point.

EnterRoundabout                   Enter a roundabout.

ExitRoundabout                    Exit a roundabout.

EnterThenExitRoundabout           Enter and exit a roundabout.

KeepLeft                          Keep left onto a different road.

KeepOnRampLeft                    Keep left and continue onto ramp.

KeepOnRampRight                   Keep right and continue onto ramp.

KeepOnRampStraight                Keep straight and continue onto ramp.

KeepRight                         Keep right onto a different road.

KeepStraight                      Keep straight onto a different road.

KeepToStayLeft                    Keep left to stay on the same road.

KeepToStayRight                   Keep right to stay on the same road.

KeepToStayStraight                Keep straight to stay on the same road.

Merge                             Merge onto a highway.

None                              No instruction.

RampThenHighwayLeft               Take left ramp onto highway. This is part of a
                                  combined instruction.

RampThenHighwayRight              Take right ramp onto highway. This is part of a
                                  combined instruction.

RampThenHighwayStraight           Stay straight to take ramp onto highway. This is

                                                                                 325
Maneuver Type            Instruction
                         part of a combined instruction.

RoadNameChange           Road name changes.

Take                     Take the road. This instruction is used when
                         you are entering or exiting a ferry.
                         For example the following two route instructions
                         use the Take maneuver to tell the user to take
                         the Seattle-Bainbridge ferry and then to exit the
                         ferry onto Olympic Drive.
                            Take Seattle-Bainbridge Ferry.
                            Take Olympic Drive.

TakeRampLeft             Take ramp to the left.

TakeRampRight            Take ramp to the right.

TakeRampStraight         Stay straight to take ramp.

TakeTransit              Take transit.

Transfer                 Transfer between public transit at transit stop.

TransitArrive            Get off public transit at transit stop.

TransitDepart            Get on public transit at transit stop.

TurnBack                 Turn back sharply.

TurnLeft                 Turn left.

TurnLeftThenBearLeft     Turn left and then bear left.

TurnLeftThenBearRight    Turn left and then bear right.

TurnLeftThenTurnLeft     Turn left and then turn left again.

TurnLeftThenTurnRight    Turn left and then turn right.

TurnRight                Turn right.

TurnRightThenBearLeft    Turn right and then bear left.

TurnRightThenBearRight   Turn right and then bear right.

TurnRightThenTurnLeft    Turn right and then turn left.

TurnRightThenTurnRight   Turn right and then turn right again

TurnThenMerge            Turn instruction followed by a merge
                         instruction.


                                                                        326
Maneuver Type                                     Instruction

TurnToStayLeft                                    Turn left to stay on the same road.

TurnToStayRight                                   Turn right to stay on the same road.

Unknown                                           The instruction is unknown.

UTurn                                             Make a u-turn to go in the opposite direction.

Wait                                              Wait at a transit stop.

Walk                                              Walk.



Warning Types
The following warning type values are used to set the warningType attribute that is returned with
warning text by the Routes API when there is a potential issue along a route segment. For more
information about warnings and other information returned in the Routes API response, see
Route Data.


Warning Type                                      Description

Accident                                          There is a traffic accident.

AdminDivisionChange                               The route has left one administrative division
                                                  and entered another.

BlockedRoad                                       The road is closed or blocked.

CheckTimetable                                    Check a time table. This usually refers to a
                                                  ferry or Autorail time table.

Congestion                                        The traffic is slow.

CountryChange                                     The route has left one country and entered
                                                  another.

DisabledVehicle                                   There is a disabled vehicle.

GateAccess                                        A gate blocks the road and access is required
                                                  to continue along the route.

GetOffTransit                                     Get off the transit at this location.

GetOnTransit                                      Get on the transit at this location.

IllegalUTurn                                      A U-turn is illegal at this location.

MassTransit                                       There is mass transit incident.

Miscellaneous                                     A miscellaneous warning is available for this

                                                                                                  327
Warning Type            Description
                        location.

NoIncident              There is no incident at this location.

None                    There is no warning at this location.

Other                   There is a warning at this location that cannot
                        be classified as any other type of warning.

OtherNews               There is additional traffic incident information.

OtherTrafficIncidents   There are other traffic incidents at this location.

PlannedEvents           There are scheduled events in the area.

PrivateRoad             The road being travelled on is private.

RestrictedTurn          The turn may be restricted.

RoadClosures            There are road closures at this location.

RoadHazard              There is a road hazard.

ScheduledConstruction   There is construction along the route. The
                        ScheduledConstruction value is used for any
                        type of construction and not just construction
                        that has specific start and end dates.

SeasonalClosures        A seasonal closure occurs at this location.

Tollbooth               A toll is required at this location to continue
                        along the route.

TollRoad                The road is a toll road.

TollZoneEnter           The entrance to a toll zone.

TollZoneExit            The exit of a toll zone.

TrafficFlow             The warning is about traffic flow.

TransitLineChange       There is a transit line change but a change of
                        vehicle is not required.

UnpavedRoad             The road is unpaved.

Weather                 There is significant weather at this location.




                                                                          328
Traffic API
Use the Traffic API to get information about traffic incidents and issues, such as construction sites
and traffic congestion. Traffic incident information is currently available for the United States and
Canada. For an overview of how traffic incident information is returned by the Routes API and the
Traffic API, see Getting Traffic Incident Data.


In this section

Get Traffic Incidents                               Use this URL to get information about traffic
                                                    incidents and issues.

Traffic Incident Data                               Use this description to understand the results
                                                    returned for a Traffic API request.



Get Traffic Incidents
Use the following URL template to request traffic incident information. A collection of traffic
incidents is returned in the response.
For more information about the traffic incident data that is returned in the response, see Traffic
Incident Data. You can also view the example URL and response values in the Examples section
below. For an overview of how traffic incident information is returned by Bing Maps REST
Services, see Getting Traffic Incident Data.

URL Templates


     These templates support both HTTP and HTTPS protocols.
Get traffic incidents.
http://dev.virtualearth.net/REST/v1/Traffic/Incidents/mapArea/includeLocationCodes?severi
ty=severity1,severity2,severityn&type=type1,type2,typen&key=BingMapsKey

Template Parameters


     See the Common Parameters and Types section for additional common parameters to
     use with these URLs.
     Common parameters include:
   Output Parameters: Includes response output types and the JSON callback parameters.
   Culture Parameter: Includes a list of the supported cultures.
     When an alias is provided, you can use the alias to shorten the length of the query
     parameter. For example, severity=6,9 can be shortened to s=6,9.
     Parameter values are not case-sensitive.


                                                                                                    329
Parameter              Alias   Description              Values

mapArea                        Required. Specifies      A rectangular area
                               the area to search for   specified as a bounding
                               traffic incident         box. A bounding box
                               information.             defines an area by
                                                        specifying
                                                        SouthLatitude,
                                                        WestLongitude,
                                                        NorthLatitude, and
                                                        EastLongitude values.
                                                        For more information,
                                                        see Location and Area
                                                        Types.
                                                        Example: 45.219,-
                                                        122.325,47.610,-
                                                        122.107

includeLocationCodes           Optional. Specifies      One of the following
                               whether to include       values:
                               traffic location codes      true
                               in the response.            false [default]
                               Traffic location codes
                                                        If you want to use the
                               provide traffic
                                                        default value, you can
                               incident information
                                                        omit this parameter from
                               for pre-defined road
                                                        the URL request.
                               segments. A
                               subscription is
                               typically required to
                               be able to interpret
                               these codes for a
                               geographical area or
                               country.

severity               s       Optional. Specifies       One or more of the
                               severity level of traffic following integer values:
                               incidents to return.       1: LowImpact
                                                           2: Minor
                                                           3: Moderate
                                                           4: Serious
                                                        The default is to return
                                                        traffic incidents for all
                                                        severity levels.


                                                                               330
Parameter                      Alias             Description             Values
                                                                         Examples:
                                                                         severity=2,3,4
                                                                         s=2,3,4

type                           t                 Optional. Specifies     One or more of the
                                                 the type of traffic     following integer values:
                                                 incidents to return.       1: Accident
                                                                            2: Congestion
                                                                            3: DisabledVehicle
                                                                            4: MassTransit
                                                                            5: Miscellaneous
                                                                            6: OtherNews
                                                                            7: PlannedEvent
                                                                            8: RoadHazard
                                                                            9: Construction
                                                                            10: Alert
                                                                            11: Weather
                                                                         Examples:
                                                                         type=2
                                                                         t=2,9


Response
A collection of TrafficIncident resources is returned when you make a request with the URL
above. For more information about the TrafficIncident resource, see Traffic Incident Data. For
more information about the common response syntax for the Bing Maps REST Services, see
Common Response Description.
These URLs support JSON (application/json) and XML (application/xml) response formats. A
JSON response is provided by default, unless you request XML output by setting the output (o)
parameter. For more information, see Output Parameters.
JSON and XML responses are provided for the URL examples in the following section.

Examples
Get all traffic incidents in a specified area.
The following example shows how to request all traffic incident for an area defined as a bounding
box (South Latitude, West Longitude, North Latitude, East Longitude). For more information about
defining a bounding box, see Location and Area Types. Note that the includeLocationCodes
parameter is not specified in this example.



                                                                                                 331
http://dev.virtualearth.net/REST/v1/Traffic/Incidents/37,-105,45,-94?key=YourBingMapsKey

JSON Response
This URL returns a response with the following format that includes a list of traffic incidents as
traffic incident resources. For more information on the fields returned for a traffic incident
resource, see Traffic Incident Data.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

      {

          "estimatedTotal":131,

          "resources":[

             {



"__type":"TrafficIncident:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                 "point":{

                      "type":"Point",

                      "coordinates":[

                          38.85135,

                          -94.34033

                      ]

                 },

                 "congestion":"",

                 "description":"MO-150 is closed between 5th Ave S and Court Dr -
construction",

                 "detour":"",

                 "end":"\/Date(1310396400000)\/",

                 "incidentId":210546697,

                 "lane":"",

                 "lastModified":"\/Date(1309391096593)\/",

                 "roadClosed":true,


                                                                                                     332
                    "severity":3,

                    "start":"\/Date(1307365200000)\/",

                    "type":9,

                    "verified":true

               },

               {



"__type":"TrafficIncident:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                    "point":{

                         "type":"Point",

                         "coordinates":[

                             38.85872,

                             -94.54638

                         ]

                    },

                    "congestion":"",

                    "description":"Botts Rd is closed between Andrews Rd and 142nd St -
construction",

                    "detour":"To go north take US-71 NB to 140th St and go west on 140th St to
access Botts Rd- To go south continue west on MO-150 to Thunderbird Rd to 149th St",

                    "end":"\/Date(1315244760000)\/",

                    "incidentId":191097424,

                    "lane":"",

                    "lastModified":"\/Date(1309391096593)\/",

                    "roadClosed":true,

                    "severity":1,

                    "start":"\/Date(1295704800000)\/",

                    "type":9,

                    "verified":true

               }

           ]

       }

  ],

  "statusCode":200,


                                                                                           333
    "statusDescription":"OK",

    "traceId":"38491198bf6a42f5b7e60c18aa08ec02"

}

XML Response
If the output parameter is specified and set to xml (o=xml) in this URL, the URL returns a
response with the following format.
<Response xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance">

    <Copyright>Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API
cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.</Copyright>

    <BrandLogoUri>http://dev.virtualearth.net/Branding/logo_powered_by.png</BrandLogoUri>

    <StatusCode>200</StatusCode>

    <StatusDescription>OK</StatusDescription>

    <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

    <TraceId>c0f1945558bf49ceb0b35816d5bca10</TraceId>

    <ResourceSets>

      <<ResourceSet>

       <EstimatedTotal>128</EstimatedTotal

       <Resources>

         <TrafficIncident>

           <Point>

             <Latitude>38.85135</Latitude>

             <Longitude>-94.34033</Longitude>

           </Point>

           <IncidentId>210546697</IncidentId>

           <LastModifiedUTC>2011-06-29T23:44:56.593Z</LastModifiedUTC>

           <StartTimeUTC>2011-06-06T13:00:00Z</StartTimeUTC>

           <EndTimeUTC>2011-07-11T15:00:00Z</EndTimeUTC>

           <Type>Construction</Type>

           <Severity>Moderate</Severity>

           <Verified>true</Verified>

           <RoadClosed>true</RoadClosed>


                                                                                             334
         <Description>MO-150 is closed between 5th Ave S and Court Dr -
construction</Description>

         <DetourInfo/>

         <LaneInfo/>

         <CongestionInfo/>

       </TrafficIncident>

       <TrafficIncident>

         <Point>

              <Latitude>38.85872</Latitude>

              <Longitude>-94.54638</Longitude>

         </Point>

         <IncidentId>191097424</IncidentId>

         <LastModifiedUTC>2011-06-29T23:44:56.593Z</LastModifiedUTC>

         <StartTimeUTC>2011-01-22T14:00:00Z</StartTimeUTC>

         <EndTimeUTC>2011-09-05T17:46:00Z</EndTimeUTC>

         <Type>Construction</Type>

         <Severity>LowImpact</Severity>

         <Verified>true</Verified>

         <RoadClosed>true</RoadClosed>

         <Description>Botts Rd is closed between Andrews Rd and 142nd St -
construction</Description>

         <DetourInfo>To go north take US-71 NB to 140th St and go west on 140th St to
access Botts Rd- To go south continue west on MO-150 to Thunderbird Rd to 149th
St</DetourInfo>

         <LaneInfo/>

         <CongestionInfo/>

       </TrafficIncident>

     </Resources>

   </ResourceSet>

 </ResourceSets>

</Response>




                                                                                        335
Get traffic incidents by type and severity and request traffic location codes.
The following example queries for congestion type traffic incidents (t=9) that are minor or
moderate in severity (s=2,3) and that occur in the bounding box defined by the coordinates
(37.0,-105.45,45.0,-94.0). Traffic location codes are requested by setting the
includeLocationCodes value 'true' in the URL. The requested output format is XML.
http://dev.virtualearth.net/REST/V1/Traffic/Incidents/37,-105,45,-
94/true?t=9,2&s=2,3&o=xml&key=BingMapsKey

XML Response
This URL returns an XML response with the following format.
<Response xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance">

  <Copyright>Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API
cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.</Copyright>

  <BrandLogoUri>http://dev.virtualearth.net/Branding/logo_powered_by.png</BrandLogoUri>

  <StatusCode>200</StatusCode>

  <StatusDescription>OK</StatusDescription>

  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

  <TraceId>3f09332c6ed44048bf8e9e19198fd154</TraceId>

  <ResourceSets>

    <ResourceSet>

      <EstimatedTotal>91</EstimatedTotal>-<Resources>

        <TrafficIncident>

          <Point>

             <Latitude>38.64829</Latitude>

             <Longitude>-94.36405</Longitude>

          </Point><IncidentId>214828828</IncidentId>

          <LastModifiedUTC>2011-07-11T12:02:30.29Z</LastModifiedUTC>

          <StartTimeUTC>2011-07-08T12:00:00Z</StartTimeUTC>

          <EndTimeUTC>2011-09-17T00:00:00Z</EndTimeUTC>

          <Type>Construction</Type><Severity>Minor</Severity>

          <Verified>true</Verified><RoadClosed>false</RoadClosed>

          <Description>in both directions between MO-2/MO-7 and MO-291/Cantrell Rd -
construction</Description>

                                                                                              336
 <DetourInfo/>

 <LaneInfo>Total Lanes lane blocked</LaneInfo>

 <CongestionInfo/>

 <ToPoint>

   <Latitude>38.65831</Latitude>

   <Longitude>-94.36706</Longitude>

 </ToPoint>

 <LocationCodes>

   <string>119+05041</string>

   <string>119+05042</string>

   <string>119-05041</string>

   <string>119-05042</string>

   <string>119N05041</string>

   <string>119N05042</string>

   <string>119P05041</string>

   <string>119P05042</string>

 </LocationCodes>

</TrafficIncident>

<TrafficIncident>

 <Point>

   <Latitude>38.80371</Latitude>

   <Longitude>-94.43887</Longitude>

 </Point>

 <IncidentId>213728243</IncidentId>

 <LastModifiedUTC>2011-07-11T12:02:30.29Z</LastModifiedUTC>

 <StartTimeUTC>2011-06-22T12:00:00Z</StartTimeUTC>

 <EndTimeUTC>2011-07-31T22:00:00Z</EndTimeUTC>

 <Type>Construction</Type>

 <Severity>Minor</Severity>

 <Verified>true</Verified>

 <RoadClosed>false</RoadClosed>

 <Description>SB MO-J between MO-58 and US-71 - construction</Description>

 <DetourInfo/>

 <LaneInfo>Total Lanes lane blocked</LaneInfo>

                                                                             337
            <CongestionInfo/>

           </TrafficIncident>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>

JSON Response
If the output parameter was not specified in this URL, a JSON response with the following format
is returned.
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

       {

           "estimatedTotal":91,

           "resources":[

              {



"__type":"TrafficIncident:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                  "point":{

                       "type":"Point",

                       "coordinates":[

                           38.64829,

                           -94.36405

                       ]

                  },

                  "congestion":"",

                  "description":"in both directions between MO-2\/MO-7 and MO-291\/Cantrell
Rd - construction",

                  "detour":"",

                  "end":"\/Date(1316217600000)\/",


                                                                                             338
                "incidentId":214828828,

                "lane":"Total Lanes lane blocked",

                "lastModified":"\/Date(1310385750290)\/",

                "roadClosed":false,

                "severity":2,

                "start":"\/Date(1310126400000)\/",

                "toPoint":{

                     "type":"Point",

                     "coordinates":[

                         38.65831,

                         -94.36706

                     ]

                },

                "locationCodes":[

                     "119+05041",

                     "119+05042",

                     "119-05041",

                     "119-05042",

                     "119N05041",

                     "119N05042",

                     "119P05041",

                     "119P05042"

                ],

                "type":9,

                "verified":true

           },

           {



"__type":"TrafficIncident:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

                "point":{

                     "type":"Point",

                     "coordinates":[

                         38.80371,

                         -94.43887


                                                                                      339
                           ]

                      },

                      "congestion":"",

                      "description":"SB MO-J between MO-58 and US-71 - construction",

                      "detour":"",

                      "end":"\/Date(1312149600000)\/",

                      "incidentId":213728243,

                      "lane":"Total Lanes lane blocked",

                      "lastModified":"\/Date(1310385750290)\/",

                      "roadClosed":false,

                      "severity":2,

                      "start":"\/Date(1308744000000)\/",

                      "type":9,

                      "verified":true

                  }

              ]

          }

     ],

     "statusCode":200,

     "statusDescription":"OK",

     "traceId":"9c2944a197db4457bb8d4def0007b657"

}


HTTP Status Codes


     For more details about these HTTP status codes, see Status Codes and Errors.
When the request is successful, the following HTTP status code is returned.
   200
When the request is not successful, the response returns one of the following errors.
   400
   401
   404
   500
   503



                                                                                        340
Traffic Incident Data
The response returned by a Traffic URL contains one or more TrafficIncident resources. Each
TrafficIncident resource contains information about a traffic issues that met the criteria specified
in the URL request, such as map area, incident type and severity. This following table provides
descriptions of the TrafficIncident resource fields and is followed by JSON and XML examples.

Traffic Incident Resource
The following table describes the fields in the traffic incident resource. One or more traffic incident
resources are returned when you request traffic data. These resources are inside a common
response wrapper for the Bing Maps REST Services. For more information about the common
response wrapper, see Common Response Description.
Fields marked Required are always provided for each traffic incident. Other fields are optional
and not always included.


JSON                    XML                         Type                 Description

point                   Point                       Required. Point.     The latitude and longitude
                                                                         coordinates where you
                                                                         encounter the incident.

congestion              CongestionInfo              string               A description of the
                                                                         congestion.
                                                                         Examples:
                                                                            generally slow
                                                                            sluggish

description             Description                 string               A description of the
                                                                         incident.
                                                                         Examples:
                                                                            W 95th St between
                                                                              Switzer Rd and
                                                                              Bluejacket Dr -
                                                                              construction
                                                                            WB Johnson Dr at I-
                                                                              435 - bridge repair

detour                  detourInfo                  string               A description of a detour.
                                                                         Examples:
                                                                            Take 63rd St to Roe
                                                                              Ave and head south to
                                                                              67th St
                                                                            take US-40 to Blue
                                                                              Ridge Cut-Off


                                                                                                    341
JSON           XML               Type       Description

start          StartTimeUTC      UTC Time   Required. The time the
                                            incident occurred. For more
                                            information about the
                                            format, see the About
                                            Time Values section
                                            below.
                                            Examples:
                                               JSON:
                                                 Date(1295704800000)
                                               XML: 2011-06-
                                                 29T23:44:56.593Z

end            EndTimeUTC        UTC Time   Required. The time that
                                            the traffic incident will end.
                                            For more information about
                                            the format, see the About
                                            Time Values section
                                            below.
                                            Examples:
                                               JSON:
                                                 Date(1295704800000)
                                               XML: 2011-06-
                                                 29T23:44:56.593Z

incidentId     IncidentId        long       Required. A unique ID for
                                            the incident.

lane           LaneInfo          string     A description specific to
                                            lanes, such as lane
                                            closures.
                                            Examples:
                                               All lanes blocked
                                               Left lane blocked

lastModified   LastModifiedUTC   DateTime   Required. The time the
                                            incident information was
                                            last updated. For more
                                            information about the
                                            format, see the About
                                            Time Values section
                                            below.
                                            Examples:

                                                                        342
JSON            XML             Type                Description
                                                       JSON:
                                                         Date(1295704800000)
                                                       XML: 2011-06-
                                                         29T23:44:56.593Z

roadClosed      RoadClosed      boolean             Required. A value of true
                                                    indicates that there is a
                                                    road closure.

severity        Severity        integer             Required. Specifies the
                                                    level of importance of
                                                    incident.
                                                       1: LowImpact
                                                       2: Minor
                                                       3: Moderate
                                                       4: Serious

toPoint         ToPoint         Point               The coordinates of the end
                                                    of a traffic incident, such as
                                                    the end of a construction
                                                    zone.




locationCodes   LocationCodes   string collection   A collection of traffic
                                                    location codes. This field is
                                                    provided when you set the
                                                    includeLocationCodes
                                                    parameter to true in the
                                                    request. These codes
                                                    associate an incident with
                                                    pre-defined road segments.
                                                    A subscription is typically
                                                    required to be able to
                                                    interpret these codes for a
                                                    geographical area or
                                                    country.

type            Type            integer             Required. Specifies the
                                                    type of incident.


                                                                              343
JSON                  XML                       Type                Description
                                                                       1: Accident
                                                                       2: Congestion
                                                                       3: DisabledVehicle
                                                                       4: MassTransit
                                                                       5: Miscellaneous
                                                                       6: OtherNews
                                                                       7: PlannedEvent
                                                                       8: RoadHazard
                                                                       9: Construction
                                                                       10: Alert
                                                                       11: Weather

verified              Verified                  boolean             Required. A value of true
                                                                    indicates that the incident
                                                                    has been visually verified or
                                                                    otherwise officially
                                                                    confirmed by a source like
                                                                    the local police department.


About time values
Time values in the TrafficIncident resource data use UTC time. The format for XML and JSON
responses are different.
For JSON responses, the time is specified as UTC time in seconds and uses the following format.
Date(seconds)

JSON Example: Date(1295704800000)
For XML responses, the time is specified as UTC time and uses the following format. A time zone
offset is not specified.
YYYY-MM-DDThh:mm:ss.sZ

XML Example: 2011-06-29T23:44:56.593Z
For more information about UTC time see W3C Date and Time Formats.

Examples
The following are TrafficIncident Data resource examples. To see the complete response
including the common response container, see the examples in Get Traffic Incidents and the
Common Response Description.
JSON Example
{




                                                                                              344
"__type":"TrafficIncident:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",

  "point":{

       "type":"Point",

       "coordinates":[

           38.64829,

           -94.36405

       ]

  },

  "congestion":"",

  "description":"in both directions between MO-2\/MO-7 and MO-291\/Cantrell Rd -
construction",

  "detour":"",

  "end":"\/Date(1316217600000)\/",

  "incidentId":214828828,

  "lane":"Total Lanes lane blocked",

  "lastModified":"\/Date(1310385750290)\/",

  "roadClosed":false,

  "severity":2,

  "start":"\/Date(1310126400000)\/",

  "toPoint":{

       "type":"Point",

       "coordinates":[

           38.65831,

           -94.36706

       ]

  },

  "locationCodes":[

       "119+05041",

       "119+05042",

       "119-05041",

       "119-05042",

       "119N05041",

       "119N05042",


                                                                                      345
         "119P05041",

         "119P05042"

    ],

    "type":9,

    "verified":true

}

XML Example
<TrafficIncident>

    <Point>

     <Latitude>38.64829</Latitude>

     <Longitude>-94.36405</Longitude>

    </Point>

    <IncidentId>214828828</IncidentId>

    <LastModifiedUTC>2011-07-11T12:02:30.29Z</LastModifiedUTC>

    <StartTimeUTC>2011-07-08T12:00:00Z</StartTimeUTC>

    <EndTimeUTC>2011-09-17T00:00:00Z</EndTimeUTC>

    <Type>Construction</Type>

    <Severity>Minor</Severity>

    <Verified>true</Verified>

    <RoadClosed>false</RoadClosed>

    <Description>in both directions between MO-2/MO-7 and MO-291/Cantrell Rd -
construction</Description>

    <DetourInfo/>

    <LaneInfo>Total Lanes lane blocked</LaneInfo>

    <CongestionInfo/>

    <ToPoint>

     <Latitude>38.65831</Latitude>

     <Longitude>-94.36706</Longitude>

    </ToPoint>

    <LocationCodes>

     <string>119+05041</string>

     <string>119+05042</string>

     <string>119-05041</string>

     <string>119-05042</string>


                                                                                 346
    <string>119N05041</string>

    <string>119N05042</string>

    <string>119P05041</string>

    <string>119P05042</string>

  </LocationCodes>

</TrafficIncident>




Common Parameters and Types
The Bing Maps REST Services use many common parameters and types. The topics in this
section describe these common parameters and types.


In this section

Bing Maps REST URL Structure                 Use the base URL for making calls to the Bing
                                             Maps REST Services.

Culture Parameter                            Use the culture parameter to set the culture so
                                             that items such as map labels and route
                                             directions are in the desired language.

Output Parameters                            Use the output parameter to specify the format
                                             of the response, such as JSON or XML.

User Context Parameters                      Use the user-context parameters to specify
                                             information about the user, such as the user’s
                                             location.

Location and Area Types                      Use the location types to define a location or
                                             geographical area.

Pushpin Syntax and Icon Styles               Use the pushpin syntax to specify pushpins on
                                             a map.

Entity Types                                 Use the entity type descriptions to understand
                                             the entity types returned by the Bing Maps
                                             REST Services.

Supported Culture Codes                      Use the list of supported culture codes to
                                             determine the languages supported by the Bing
                                             Maps REST Services.




                                                                                              347
Bing Maps REST URL Structure
The Bing Maps REST Services are all called by using the following base formats.
HTTP protocol
http://dev.virtualearth.net/REST/version/restApi/resourcePath?queryParameters&key=BingMap
sKey



HTTPS protocol
https://dev.virtualearth.net/REST/version/restApi/resourcePath?queryParameters&key=BingMa
psKey




Template Parameters


      All parameters in the Bing Maps REST Services are not case-sensitive.


URL parameter                   Description                 Values

version (v+ API version         Required. The version of    A string containing v and an integer
number)                         the Bing Maps REST          that specifies the version of the Bing
                                Services that you want to   Maps REST Services.
                                use.                        Example: v1.

restApi                         Required. The REST API      A part of the URL path that identifies
                                that you want to use.       the REST API.
                                                            Example: Imagery/Map

resourcePath                    Optional. Additional        A part of the URL path that specifies
                                parameters that define a    a resource, such as an address or
                                resource                    landmark.
                                                            Example:
                                                            BirdsEye/51.5063249319792,-
                                                            0.127144753932953

key                             Required. The Bing Maps A Bing Maps Key obtained from the
                                Key to use for the request. Bing Maps Account Center
                                                            Example:
                                                            key=A3sbe47EeFWsSlklbe


                                                                Although it is described
                                                                separately in this table
                                                                because of its importance,

                                                                                               348
URL parameter                    Description                  Values
                                                                 the Bing Maps Key is a
                                                                 query parameter.

queryParameters                  Optional with                Depending on the request, query
                                 exceptions. One or more      parameters may be optional or
                                 parameters and values        required. Query parameters consist
                                 that define the request.     of global parameters and parameters
                                                              that are specific to each REST API.
                                                              The Bing Maps Key is a required
                                                              query parameter.
                                                              Example: userLocation=49.1231,-
                                                              98.231


Example
The following example request specifies to use version one (v1) of the Bing Maps REST Services
to find location information for the city of Seattle. The information will be returned in an XML
format.
http://dev.virtualearth.net/REST/v1/Locations/seattle?output=xml?key=BingMapsKey


Culture Parameter
Use the culture parameter to specify a culture for your request. The culture parameter provides
the following strings in the language of the culture for:
1. Geographic entities and place names returned by the Bing Maps REST Services.
2. Map labels on map images.
3. Route instructions.
You can use the alias to shorten the length of the culture parameter. For example, culture=da can
be shortened to c=da.


Parameter                Alias                  Description               Values

culture                  c                      Optional. The culture to For a list of supported
                                                use for the request.     cultures, see
                                                                         Supported Culture
                                                                         Codes.


Example
The following example finds the location for an address string and provides the information in
German, which is the language associated with the culture code de.



                                                                                                 349
http://dev.virtualearth.net/REST/v1/Locations/Börsenplatz%201%20Frankfurt%20am%20Main%20H
essen%2060313?c=de&key=BingMapsKey




Output Parameters
Use output parameters to specify the output of the request.
When an alias is provided, you can use the alias to shorten the length of the query parameter.
For example, output=xml can be shortened to o=xml.


Parameter                Alias             Description            Values

output                   o                 Optional. The          One of the following values:
                                           output format for      json [default]
                                           the response.
                                                                  xml
                                                                  Example: output=xml

suppressStatus           ss                Optional. When set         true
                                           to true, the HTTP          false [default]
                                           Status returned is     Example: suppressStatus=true
                                           200 OK for all
                                           responses,
                                           including when
                                           there are errors.
                                           The content of the
                                           response always
                                           contains the actual
                                           HTTP Status.

jsonp                                      Optional. Name of      A string that contains the name
                                           JSON callback          of the callback function.
                                           function that is       Example:
                                           called when the        jsonp=MyCallbackFunction
                                           response to the
                                           request is received.
                                           The JSON object
                                           provided in the
                                           response is passed
                                           to the callback
                                           function.

jsonso                                     Optional. The state Any valid JavaScript string.
                                           object to pass to the Example: jsonso=abc3144sd
                                           JSON callback

                                                                                                 350
Parameter                Alias            Description             Values
                                          function. You can
                                          use a state object to
                                          match a response
                                          with a specific call.
                                          This value is
                                          provided as the
                                          second parameter
                                          to the callback
                                          function provided in
                                          the JSONP
                                          parameter.


Examples
This example returns the template that you can use to build a map that shows roads. The output
is requested in XML format.
http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Road?output=xml&key=BingMapsKey

This example returns the following response. The URL template is provided by the ImageURL
element.
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

  <Copyright>Copyright © 2010 Microsoft and its suppliers. All rights reserved. This API
cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.</Copyright>

  <BrandLogoUri>http://dev.virtualearth.net/Branding/logo_powered_by.png</BrandLogoUri>

  <StatusCode>200</StatusCode>

  <StatusDescription>OK</StatusDescription>

  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

  <TraceId>55da9336cd984609b45a91fc9fc26905</TraceId>

  <ResourceSets>

    <ResourceSet>

      <EstimatedTotal>1</EstimatedTotal>

      <Resources>

        <ImageryMetadata>




                                                                                            351
           <ImageUrl>http://ecn.{subdomain}.m3.tiles.live
int.com/tiles/r{quadkey}.jpeg?g=58&mkt={culture}&shading=hill&stl=H</ImageUrl>

           <ImageUrlSubdomains>

              <string>t0</string>

              <string>t1</string>

              <string>t2</string>

              <string>t3</string>

           </ImageUrlSubdomains>

           <ImageWidth>256</ImageWidth>

           <ImageHeight>256</ImageHeight>

           <ZoomMin>1</ZoomMin>

           <ZoomMax>19</ZoomMax>

        </ImageryMetadata>

      </Resources>

    </ResourceSet>

  </ResourceSets>

</Response>




This example gets a JSON object and specifies a callback function and a state parameter value.
http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Road?output=json&jsonp=MyCallbackFun
ction&jsonso=abc3144sd&key=BingMapsKey

For this example, the body of the response contains the following function call.
MyCallbackFunction({"authenticationResultCode":"ValidCredentials",

  "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

  "copyright":"Copyright © 2010 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",



"resourceSets":[{"estimatedTotal":1,"resources":[{"__type":"ImageryMetadata:http:\/\/sche
mas.microsoft.com\/search\/local\/ws\/rest\/v1",

  "imageHeight":256,




                                                                                            352
"imageUrl":"http:\/\/ecn.{subdomain}.tiles.virtualearth.net\/tiles\/r{quadkey}.jpeg?g=470
&mkt={culture}&shading=hill&stl=H",

  "imageUrlSubdomains":["t0","t1","t2","t3"],

  "imageWidth":256,

  "imageryProviders":null,

  "vintageEnd":null,"vintageStart":null,

  "zoomMax":19,"zoomMin":1}]}],

  "statusCode":200,

  "statusDescription":"OK",

  "traceId":"d172cd085d624f2cab9b2c0a07ae06f1"},

  "abc3144sd")


User Context Parameters
Use user context parameters to specify information about the user. You can increase the
accuracy of a location result when you specify a user context parameter in your request URL.
When an alias is provided, you can use the alias to shorten the length of the query parameter.


Parameter           Alias        Description        Values

userMapView         umv          Optional. The      A rectangular area on the earth defined as a
                                 geographic         bounding box object. The sides of the
                                 region that        rectangles are defined by latitude and
                                 corresponds to     longitude values. For more information, see
                                 the current        Location and Area Types. When you specify
                                 viewport.          this parameter, the geographical area is
                                                    taken into account when computing the
                                                    results of a location query.
                                                    Example: 40.879052728414536,-
                                                    122.51596324145794,49.77062925696373,-
                                                    105.74403114616871

userLocation        ul           Optional. The      A point on the earth specified as a latitude
                                 user’s current     and longitude. When you specify this
                                 position.          parameter, the user’s location is taken into
                                                    account and the results returned may be
                                                    more relevant to the user.
                                                    Example:
                                                    userLocation=51.504360719046616,-
                                                    0.12600176611298197

                                                                                                 353
Parameter           Alias        Description         Values

userIp              uip          Optional. An        The default address is the IPv4 address of
                                 Internet Protocol   the request. When you specify this
                                 version 4 (IPv4)    parameter, the location associated with the
                                 address.            IP address is taken into account in
                                                     computing the results of a location query.
                                                     Example: userIp=111.111.11.11



Location and Area Types
Use the following formats to specify locations and areas on the Earth.


Type                            Description                    Values and Syntax

Point                           A point on the Earth           The coordinates are double
                                specified by a latitude and    values that are separated by
                                longitude.                     commas and are specified in the
                                                               following order.
                                                               Latitude,Longitude
                                                               Use the following ranges of
                                                               values:
                                                                  Latitude (degrees): [-90, +90]
                                                                  Longitude (degrees): [-
                                                                    180,+180]
                                                               Example: 47.610679194331169,-
                                                               122.10788659751415

BoundingBox                     A rectangular area on the      A bounding box is defined by two
                                Earth.                         latitudes and two longitudes that
                                                               represent the four sides of a
                                                               rectangular area on the Earth. Use
                                                               the following syntax to specify a
                                                               bounding box.
                                                               South Latitude, West Longitude,
                                                               North Latitude, East Longitude
                                                               Example: 45.219,-
                                                               122.325,47.610,-122.107

Address                         Details about a point on the   An address can contain the
                                Earth that has additional      following fields: address line,
                                location information.          locality, neighborhood, admin
                                                               district, admin district 2, formatted

                                                                                                 354
Type               Description                 Values and Syntax
                                               address, postal code and country
                                               or region. For descriptions see the
                                               Address Fields section below.


Address Fields


Address                          Description

addressLine                      The official street line of an address relative to
                                 the area, as specified by the Locality, or
                                 PostalCode, properties. Typical use of this
                                 element would be to provide a street address or
                                 any official address.
                                 Example: 1 Microsoft Way

locality                         A string specifying the populated place for the
                                 address. This typically refers to a city, but may
                                 refer to a suburb or a neighborhood in certain
                                 countries.
                                 Example: Seattle

neighborhood                     A string specifying the neighborhood for an
                                 address.
                                 Example: Ballard

adminDistrict                    A string specifying the subdivision name in the
                                 country or region for an address. This element
                                 is typically treated as the first order
                                 administrative subdivision, but in some cases it
                                 is the second, third, or fourth order subdivision
                                 in a country, dependency, or region.
                                 Example: WA

adminDistrict2                   A string specifying the subdivision name in the
                                 country or region for an address. This element
                                 is used when there is another level of
                                 subdivision information for a location, such as
                                 the county.
                                 Example: King

formattedAddress                 A string specifying the complete address. This
                                 address may not include the country or region.
                                 Example: 1 Microsoft Way, Redmond, WA
                                                                                355
Address                                            Description
                                                   98052-8300

postalCode                                         A string specifying the post code, postal code,
                                                   or ZIP Code of an address.
                                                   Example: 98178

countryRegion                                      A string specifying the country or region name
                                                   of an address.
                                                   Example: United States

landmark                                           A string specifying the name of the landmark
                                                   when there is a landmark associated with an
                                                   address.
                                                   Example: Eiffel Tower




Pushpin Syntax and Icon Styles
Pushpins identify locations on a map. You can specify an icon style and a label for a pushpin, in
addition to its location.


    You can specify up to 18 pushpins within a Get a Static Map URL that uses HTTP GET
    protocol. However, if you use the HTTP POST method option, you can specify up to 100
    pushpins by inserting them into the request body. See the HTTP POST Syntax section
    below for information about how to format the pushpins in a request body. The Get a
    Static Map topic provides more details and an example.
The following table shows the syntax to use to specify a pushpin location.
pushpin=latitude,longitude;iconStyle;label

You can use the alias pp if you do not want to spell out pushpin.
A latitude and a longitude are required. You can optionally specify an icon style and a label for the
pushpin. A length of a label string is limited to three characters.
The following table shows the options for specifying a pushpin.


Description                                        Syntax

Specify a pushpin location.                        latitude,longitude
                                                   Example: pushpin=47.620548,-122.34874

Specify a pushpin location and an icon style.      latitude,longitude;iconStyle
                                                   Example: pushpin=47.620548,-122.34874;5


                                                                                                 356
Description                                        Syntax

Specify a pushpin location and a label.            latitude,longitude;;label


                                                       The order of the syntax requires that if
                                                       you specify a label without specifying
                                                       an icon style, you must preserve the
                                                       syntax and put two semi-colons
                                                       between the coordinates and the label.
                                                   Example: pushpin=47.620548,-122.34874;;P10

Specify a pushpin location, an icon style, and a   latitude,longitude;iconStyle;label
label. A label can have up to three (3)            Example: pushpin=47.620548,-
characters.                                        122.34874;5;P10


HTTP POST Syntax
If you use the HTTP POST method for specifying pushpins on a static map, you must include the
pushpins in the body of the request.
When specifying multiple pushpins in the request body, you must the ampersand character (&) or
a carriage return (\r\n) as a delimiter. Pushpins that follow a carriage return (appear on a new
line) do not have ampersands.
The following examples show how to specify pushpins in the body of an HTTP POST request. For
more information about this type of request, see Get a Static Map.
Example 1
pp=38.889586530732335,-77.05010175704956;23;LMT\r\n

pp=38.88772364638439,-77.0472639799118;7;KMT\r\n

pp=38.890479451480054,-77.04744637012482;1;VMT\r\n

pp=38.8896854931628,-77.03519403934479;45;WMT



Example 2
pp=38.889586530732335,-77.05010175704956;23;LMT&pp=38.88772364638439,-
77.0472639799118;7;KMT\r\n

pp=38.890479451480054,-77.04744637012482;1;VMT&pp=38.8896854931628,-
77.03519403934479;45;WMT




Icon Styles
The following table shows the available pushpin icon styles.


                                                                                                  357
IconStyle     Icon

0




1 [default]




2




3




4




5




6




                     358
IconStyle   Icon

7




8




9




10




11




12




13




                   359
IconStyle   Icon

14




15




16




17




18




19




20




                   360
IconStyle   Icon

21




22




23




24




25




26




27




                   361
IconStyle   Icon

28




29




30




31




32




33




34




                   362
IconStyle                                             Icon

35




36




Entity Types
Entity type identifies a location. The following table lists the available entity types.


EntityType                                            Description

Address                                               A physical address of a location.

AdminDivision1                                        A first-order, initial political subdivision of a
                                                      [Sovereign], such as a state, a province, a
                                                      department, a region, or a prefecture.

AdminDivision2                                        A second-order political subdivision of a
                                                      [CountryRegion], a division of an
                                                      [AdminDivision1] or a [Dependent].

AdminDivision3                                        A third-order political subdivision of a
                                                      [CountryRegion], a division of an
                                                      [AdminDivision2].

AdministrativeBuilding                                A building that contains governmental offices or
                                                      facilities.

AdministrativeDivision                                An administrative division of a [CountryRegion],
                                                      undifferentiated as to administrative level.

AgriculturalStructure                                 A [Structure] used for agricultural purposes.

Airport                                               A place where aircraft regularly land and take
                                                      off, with runways, navigational aids, and
                                                      facilities for handling passengers and/or cargo.

AirportRunway                                         An improved surface suitable for landing
                                                      airplanes.

                                                                                                          363
EntityType          Description

AmusementPark       A facility that contains rides and other
                    attractions, such as a theme park.

AncientSite         A place where archeological remains, old
                    structures, or cultural artifacts are located.

Aquarium            A place where marine life is displayed to the
                    public.

Archipelago         A logical grouping of [Island]s.

Autorail            A [Railway] that carries automobiles.

Basin               A low-lying area mostly or wholly surrounded
                    by higher ground.

Battlefield         A site of a land battle of historical importance.

Bay                 An area of water partially enclosed by an
                    indentation of shoreline.

Beach               A [Coast] with a surface of sand, pebbles, or
                    small rocks.

BorderPost          A post or station at an international boundary
                    for regulating the movement of people and
                    goods.

Bridge              A structure erected across an obstacle, such as
                    a stream or road, that is used by vehicles and
                    pedestrians.

BusinessCategory    A category that identifies a kind of business.

BusinessCenter      A place where a number of businesses are
                    located.

BusinessName        A name that identifies a business.

BusinessStructure   A [Structure] used for commercial purposes.

BusStation          A place where buses pick up and discharge
                    passengers.

Camp                A site occupied by tents, huts, or other shelters
                    for temporary use.

Canal               An artificially constructed watercourse.

Cave                An underground passageway or chamber, or a


                                                                     364
EntityType         Description
                   cavity on the side of a cliff.

CelestialFeature   A spherical body in space.

Cemetery           A burial place or a burial ground.

Census1            One of the set of the most detailed, lowest-level
                   [CensusDistrict]s.

Census2            One of the set of second-order
                   [CensusDistrict]s composed by aggregating
                   [Census1]s.

CensusDistrict     A district defined by a national census bureau
                   and used for statistical data collection.

Channel            A body of water between two landmasses.

Church             A building for public Christian worship.

CityHall           A building that contains the administrative
                   offices of a municipal government.

Cliff              A high, steep-to-perpendicular slope that
                   overlooks a lower area or a water body.

ClimateRegion      An area of homogenous climactic conditions,
                   as defined by modified Koeppen classes.

Coast              An area of land adjacent to a [WaterFeature].

CommunityCenter    A facility for community recreation and
                   meetings.

Continent          A very large landmass, surrounded by water
                   and larger than an [Island], that forms one of
                   the primary divisions of land on a
                   [CelestialFeature].

ConventionCenter   A large meeting hall for conventions and other
                   meetings, and shows.

CountryRegion      A primary [PoliticalUnit].

Courthouse         A building in which courts of law are held.

Crater             A generally circular, saucer-shaped, or bowl-
                   shaped depression caused by volcanic or
                   meteorite explosive action.

CulturalRegion     An area of land with strong local identity, but no

                                                                 365
EntityType             Description
                       political status.

Current                A large area of ocean where surface water
                       flows in a certain constant general direction.

Dam                    A barrier constructed across a stream to
                       impound water.

Delta                  An area where a [River] divides into many
                       separate water channels as it enters a [Sea] or
                       a [Lake].

Dependent              A [PoliticalUnit] that is politically controlled by a
                       [Sovereign], but separate geographically, and
                       to some degree politically, such as a territory, a
                       colony, or a dependency.

Desert                 A large area with low rainfall and little or no
                       vegetation.

DisputedArea           An area in political dispute that is not
                       considered part of any [CountryRegion].

DrainageBasin          A land region where all surface water drains
                       into one specific [WaterFeature].

Dune                   A wave form, a ridge, or a star-shaped feature
                       composed of sand.

EarthquakeEpicenter    A place where the destructive force of a
                       specific earthquake is centered.

Ecoregion              A region with a homogeneous ecosystem, flora,
                       and/or fauna.

EducationalStructure   A place for providing instruction.

ElevationZone          An area where the surface elevation of all land
                       is within a defined range.

Factory                A building or set of buildings where goods are
                       manufactured, processed, or fabricated.

FerryRoute             A route used by a boat, or by other floating
                       conveyances regularly used to transport people
                       and vehicles across a [WaterFeature].

FerryTerminal          A structure and associated facilities where a
                       ferry boat docks and takes on passengers,


                                                                         366
EntityType                     Description
                               automobiles, and/or cargo.

FishHatchery                   A place for hatching fish eggs or raising fish.

Forest                         A large area of trees.

FormerAdministrativeDivision   An [AdministrativeDivision] that no longer
                               exists.

FormerPoliticalUnit            A [PoliticalUnit] that no longer exists.

FormerSovereign                A [Sovereign] that no longer exists.

Fort                           A defensive structure or earthwork.

Garden                         An enclosure for displaying selected plant life.

GeodeticFeature                An invisible point, line, or area on the surface of
                               a [CelestialFeature] that is used for geographic
                               reference.

GeoEntity                      A single thing that has spatial extent and
                               location.

GeographicPole                 One of the two points of intersection of the
                               surface of a [CelestialFeature] and its axis of
                               rotation.

Geyser                         A [HotSpring] that intermittently shoots water
                               into the air.

Glacier                        A mass of ice, usually at high latitudes or high
                               elevations, with sufficient thickness to flow
                               away from the source area.

GolfCourse                     A recreational field where golf is played.

GovernmentStructure            A [Structure] typically owned and operated by a
                               governmental entity.

Heliport                       A place where helicopters land and take off.

Hemisphere                     A half of the surface of a [Celestial Feature],
                               usually specified as northern, southern,
                               eastern, or western.

HigherEducationFacility        A place where students receive advanced or
                               specialized education, such as a college or a
                               university.

HistoricalSite                 A place of historical importance.

                                                                                 367
EntityType                  Description

Hospital                    A building in which the sick or injured,
                            especially those confined to bed, are medically
                            treated.

HotSpring                   A place where hot water emerges from the
                            ground.

Ice                         A large area covered with frozen water.

IndigenousPeoplesReserve    An area of land set aside for aboriginal, tribal,
                            or native populations.

IndustrialStructure         A [Structure] used for industrial or extractive
                            purposes.

InformationCenter           A place where tourists and citizens can obtain
                            information.

InternationalDateline       The line running between geographic poles
                            designated as the point where a calendar day
                            begins.

InternationalOrganization   An area of land composed of the member
                            [PoliticalUnit]s of an official governmental
                            organization composed of two or more
                            [Sovereign]s.

Island                      An area of land completely surrounded by
                            water and smaller than a [Continent].

Isthmus                     A narrow strip of land connecting two larger
                            landmasses and bordered by water on two
                            sides.

Junction                    A place where two or more roads join.

Lake                        An inland water body, usually fresh water.

LandArea                    A relatively small area of land exhibiting a
                            common characteristic that distinguishes it from
                            the surrounding land.

Landform                    A natural geographic feature on dry land.

LandmarkBuilding            A [Structure] that is a well-known point of
                            reference.

LatitudeLine                An imaginary line of constant latitude that
                            circles a [CelestialFeature], in which every point

                                                                              368
EntityType         Description
                   on the line is equidistant from a geographic
                   pole.

Library            A place where books and other media are
                   stored and loaned out to the public or others.

Lighthouse         A tall structure with a major navigation light.

LinguisticRegion   An area of land where most of the population
                   speaks the same language or speaks
                   languages in the same linguistic family.

LongitudeLine      An imaginary line of constant longitude on a
                   [CelestialFeature] that runs from one
                   geographic pole to the other.

MagneticPole       A point on the surface of a [CelestialFeature]
                   that is the origin for lines of magnetic force.

Marina             A harbor facility for small boats.

Market             A place where goods are bought and sold.

MedicalStructure   A [Structure] in which the sick or injured are
                   medically treated.

MetroStation       A place where urban rapid transit trains pick up
                   and drop off passengers, often underground or
                   elevated.

MilitaryBase       A place used by an armed service for storing
                   arms and supplies, for accommodating and
                   training troops, and as a base from which
                   operations can be initiated.

Mine               A place where mineral ores are extracted from
                   the ground by excavating surface pits and
                   subterranean passages.

Mission            A place characterized by dwellings, school,
                   church, hospital, and other facilities operated
                   by a religious group for the purpose of
                   providing charitable services and to propagate
                   religion.

Monument           A commemorative structure or statue.

Mosque             A building for public Islamic worship.


                                                                     369
EntityType              Description

Mountain                An elevated landform that rises, often steeply,
                        above surrounding land on most sides.

MountainRange           A group of connected [Mountain]s.

Museum                  A building where objects of permanent interest
                        in one or more of the arts and sciences are
                        preserved and exhibited.

NauticalStructure       A [Structure] used for nautical purposes.

NavigationalStructure   A [Structure] used for navigational purposes.

Neighborhood            A section of a [PopulatedPlace], usually
                        homogenous and/or well-known, but often with
                        indistinct boundaries.

Oasis                   An area in a [Desert] that contains water and
                        plant life.

ObservationPoint        A wildlife or scenic observation point.

Ocean                   A vast expanse of salt water, one of the major
                        [Sea]s covering part of the earth.

OfficeBuilding          A building that contains offices.

Park                    An area maintained as a place of scenic
                        beauty, or for recreation.

ParkAndRide             A parking lot reserved for mass transit
                        commuters.

Pass                    A break in a [MountainRange] used for
                        transportation from one side of the mountain
                        range to the other.

Peninsula               An elongated area of land projecting into a
                        body of water and surrounded by water on
                        three sides.

Plain                   An extensive area of comparatively level to
                        gently undulating land, lacking surface
                        irregularities.

Planet                  A [CelestialFeature] that orbits a star.

Plate                   A section of a planetary crust that is in motion
                        relative to other tectonic plates.


                                                                       370
EntityType       Description

Plateau          An elevated plain with steep slopes on one or
                 more sides.

PlayingField     A tract of land used for playing team sports
                 and/or other athletic events.

Pole             A point on the surface of a [CelestialFeature]
                 that marks an important geographical or
                 astronomical location.

PoliceStation    A building in which police are stationed or
                 posted.

PoliticalUnit    An area of land with well-defined borders that is
                 subject to a specific political administration.

PopulatedPlace   A concentrated area of human settlement, such
                 as a city, a town, or a village.

Postcode         A district used by a postal service as an aid in
                 postal distribution and having a unique
                 identifying code.

Postcode1        One of the set of lowest-level and most detailed
                 set of [PostCode]s in a [Sovereign].

Postcode2        One of the set of second-order (one level up
                 from the lowest level) [Postcode]s in a
                 [Sovereign], composed by aggregating
                 [Postcode1]s.

Postcode3        One of the set of third-order [Postcode]s in a
                 [Sovereign], composed by aggregating
                 [Postcode2]s.

Postcode4        One of the set of fourth-order [Postcode]s in a
                 [Sovereign], composed by aggregating
                 [Postcode3]s.

PostOffice       A public building in which mail is received,
                 sorted, and distributed.

PowerStation     A facility for generating electric power.

Prison           A facility for confining persons convicted or
                 accused of crimes.

Promontory       A small, usually pointed [Peninsula] that often


                                                                 371
EntityType              Description
                        marks the terminus of a landmass.

RaceTrack               A track where races are held.

Railway                 A permanent twin steel-rail track on which
                        trains move.

RailwayStation          A place comprised of ticket offices, platforms,
                        and other facilities for loading and unloading
                        train passengers and freight.

RecreationalStructure   A [Structure] used for watching or participating
                        in sports or other athletic activities.

Reef                    A partly submerged feature, usually of coral,
                        that projects upward near the water's surface
                        and can be a navigational hazard.

Region                  A large area of land where a specific
                        characteristic of the land or its people is
                        relatively homogenous.

ReligiousRegion         An area of land where the population holds
                        relatively homogenous religious practices.

ReligiousStructure      A structure where organized, public religious
                        services are held.

ResearchStructure       A [Structure] used for scientific purposes.

Reserve                 A tract of public land set aside for restricted use
                        or reserved for future use.

ResidentialStructure    A house, a hut, an apartment building, or
                        another structure where people reside.

RestArea                A designated area, usually along a major
                        highway, where motorists can stop to relax.

River                   A stream of running water.

Road                    An open way with an improved surface for
                        efficient transportation of vehicles.

RoadBlock               A road.

RoadIntersection        A junction where two or more roads meet or
                        cross at the same grade.

Ruin                    A destroyed or decayed structure that is no


                                                                        372
EntityType               Description
                         longer functional.

Satellite                A [CelestialFeature] that orbits a [Planet].

School                   A place where people, usually children, receive
                         a basic education.

ScientificResearchBase   A scientific facility used as a base from which
                         research is carried out or monitored.

Sea                      A large area of salt water.

SeaplaneLandingArea      A place on a water body where floatplanes land
                         and take off.

ShipWreck                A site of the remains of a wrecked vessel.

ShoppingCenter           A collection of linked retail establishments.

Shrine                   A structure or place that memorializes a person
                         or religious concept.

Site                     A place most notable because of an event that
                         occurred in that location.

SkiArea                  A place developed for recreational Alpine or
                         Nordic skiing.

Sovereign                An independent nation-state, the highest level
                         of political authority in that location.

SpotElevation            A point on a [CelestialFeature]'s surface with a
                         known elevation.

Spring                   A place where water emerges from the ground.

Stadium                  A structure with an enclosure for athletic games
                         with tiers of seats for spectators.

StatisticalDistrict      An area of land defined as a district to be used
                         for statistical collection or service provision.

Structure                A building, a facility, or a group of buildings
                         and/or facilities used for a certain common
                         purpose.

TectonicBoundary         A line that forms the border between two
                         [Plate]s.

TectonicFeature          A [Landform] related to [Plate]s and their
                         movement.

                                                                           373
EntityType                                        Description

Temple                                            An edifice dedicated to religious worship.

TimeZone                                          A large area within which the same time
                                                  standard is used.

TouristStructure                                  A [Structure] typically used by tourists.

Trail                                             A path, a track, or a route used by pedestrians,
                                                  animals, or off-road vehicles.

TransportationStructure                           A [Structure] used for transportation purposes.

Tunnel                                            A subterranean passageway for transportation.

UnderwaterFeature                                 A feature on the floor of a [WaterFeature].

UrbanRegion                                       An area of land with high population density
                                                  and extensive urban development.

Valley                                            A low area surrounded by higher ground on two
                                                  or more sides.

Volcano                                           A [Mountain] formed by volcanic action and
                                                  composed of volcanic rock.

Wall                                              An upright structure that encloses, divides, or
                                                  protects an area.

Waterfall                                         A vertical or very steep section of a [River].

WaterFeature                                      A geographic feature that has water on its
                                                  surface.

Well                                              A cylindrical hole, pit, or tunnel drilled or dug
                                                  down to a depth from which water, oil, or gas
                                                  can be pumped or brought to the surface.

Wetland                                           An area of high soil moisture, partially or
                                                  intermittently covered with shallow water.

Zoo                                               A zoological garden or park where wild animals
                                                  are kept for exhibition.



Supported Culture Codes
The following list shows the culture codes supported by the Bing Maps REST Services APIs.
These culture codes are used to set the language of the address, imagery or route information.
The codes listed in the table are primarily two-letter codes associated with a language. In some
instances, such as the codes used for the Imagery API, the codes also have a 2 letter code

                                                                                                   374
associated with a country or region. For example, the culture code en-GB represents the version
of English spoken in the United Kingdom. The Imagery API requires both a language and
country/region for the culture code. The Locations API and Routes API, in most cases, require
only a language code. You can also add a country/region code, but if the language-country/region
code you specify represents a country/region that is not specified with that language in the table,
that dialect is not be supported. Street names are localized for the the local culture.


     The cultures in the following table are supported as values for the culture parameter for
     the Bing Maps REST Services APIs. However, the level of localized data for each culture
     may vary. For example, there may not be a localized name for the "United States" for
     every culture code.


Culture Code       Language              Locations*          Imagery**           Routes

af                 Afrikaans             X

ar                 Arabic                X

az                 Azeri                 X

be                 Belarusian            X

bg                 Bulgarian             X

bs-Latn-BA         Latin - Bosnian       X

ca                 Catalan               X

cs                 Czech                 X                                       X

cy-GB              Welsh - United        X
                   Kingdom

da                 Danish                X                                       X

de                 German                X                   de-DE only**        X

en                 English               X                   en-US only**        X

en-GB              English - United      X                                       X
                   Kingdom

es                 Spanish               X                   es-ES, es-          X
                                                                1          1
                                                             US ,and es-MX
                                                             only**

et                 Estonian              X

eu                 Basque                X

fa                 Farsi                 X

                                                                                                 375
Culture Code   Language          Locations*   Imagery**          Routes

fi             Finnish           X                               X

fo             Faroese           X
                                                             2
fr             French            X            fr-FR and fr-CA    X
                                              only**

ga-IE          Irish - Ireland   X

gl             Galician          X

gu             Gujarati          X

he             Hebrew            X

hi             Hindi             X

hr             Croatian          X

hu             Hungarian         X                               X

hy             Armenian          X

id             Indonesian        X

id-ID          Indonesian -      X
               Indonesia

is             Icelandic         X

it             Italian           X            it-IT only**       X

ja             Japanese          X                               X

ka             Georgian          X

kk             Kazakh            X

kn             Kannada           X

ko             Korean            X

ky             Kyrgyz            X

lt             Lithuanian        X

lv             Latvian           X

mk             Macedonian        X

mn             Mongolian         X

mr             Marathi           X

ms             Malay             X

                                                                          376
Culture Code   Language        Locations*   Imagery**      Routes

nl             Dutch           X            nl-BE only**   X

no             Norwegian       X                           X

pa             Punjabi         X

pl             Polish          X

pt             Portuguese      X                           includes pt-BR

ro             Romanian        X                           X

ru             Russian         X

sa             Sanskrit        X

sk             Slovak          X

sl             Slovenian       X                           X

sq             Albanian        X

sr             Serbian         X

sv             Swedish         X                           X

sw             Swahili         X

syr            Syriac          X

ta             Tamil           X

te             Telugu          X

th             Thai            X

tr             Turkish         X                           X

tt             Tatar           X

uk             Ukrainian       X

ur             Urdu            X

uz             Uzbek           X

vi             Vietnamese      X

zh-CHS         Chinese         X
               (Simplified)

zh-CHT         Chinese         X
               (Traditional)



                                                                       377
*The Locations API returns street names that are localized to the local culture. For example, if
you request a location in France, the street names are localized in French.
**The Imagery API renders tiles in United States English (en-US) for all locations on the Earth at
all zoom levels. The following languages are rendered for all locations on the Earth at zoom
levels 1-9, and for Europe locations at all zoom levels (1-21): fr-FR, de-DE, it-IT, es-ES, nl-BE..
1
    When you specify es-MX or es-US in the request, the culture is converted to es-ES.
2
    When you specify fr-CA in the request, the culture is converted to fr-FR.


Common Response Description
The response to a Bing Maps REST Services URL request includes the status of the request and
one or more resources that contain location, imagery, or route information. The resource
information that is returned depends on the Bing Maps REST Services URL that is used and the
parameter values that are provided with it. For example, a Locations API URL returns one or
more Location resources that provide location information based on the values in the URL
request.
The following tables describe the common fields that are returned in the response to a Bing Maps
REST Services URL request. For more information about specific resource content, see the API
reference for the Locations, Imagery, and Routes APIs.


Response
The Response container for a request provides the following information.


JSON                            XML                           Type                   Description

statusCode                      StatusCode                    integer                The HTTP
                                                                                     Status code for
                                                                                     the request.

statusDescription               StatusDescription             string                 A description of
                                                                                     the HTTP
                                                                                     status code.

authenticationResultCode        AuthenticationResultCode      One of the following   A status code
                                                              values:                that offers
                                                              ValidCredentials       additional
                                                                                     information
                                                              InvalidCredentials
                                                                                     about
                                                              CredentialsExpired
                                                                                     authentication
                                                              NotAuthorized          success or
                                                              NoCredentials          failure.
                                                              None

traceId                         TraceId                       string                 A unique

                                                                                                   378
JSON                        XML                          Type         Description
                                                                      identifier for the
                                                                      request.

copyright                   Copyright                    string       A copyright
                                                                      notice.

brandLogoUri                BrandLogoUri                 string       A URL that
                                                                      references a
                                                                      brand image to
                                                                      support
                                                                      contractual
                                                                      branding
                                                                      requirements.

resourceSets                ResourceSets                 collection   A collection of
                                                                      ResourceSet
                                                                      objects. A
                                                                      ResourceSet is
                                                                      a container of
                                                                      Resources
                                                                      returned by the
                                                                      request. For
                                                                      more
                                                                      information, see
                                                                      the
                                                                      ResourceSet
                                                                      section below.

errorDetails                ErrorDetails                 string[]     A collection of
                                                                      error
                                                                      descriptions.
                                                                      For example,
                                                                      ErrorDetails
                                                                      can identify
                                                                      parameter
                                                                      values that are
                                                                      not valid or
                                                                      missing.



ResourceSet
The ResourceSet container provides the following information.



                                                                                    379
JSON                      XML                     Type              Description

estimatedTotal            EstimatedTotal          long              An estimate of the total
                                                                    number of resources in
                                                                    the ResourceSet.

resources                 Resources               collection        A collection of one or
                                                                    more resources. The
                                                                    resources that are
                                                                    returned depend on
                                                                    the request.
                                                                    Information about
                                                                    resources is provided
                                                                    in the API reference for
                                                                    each Bing Maps REST
                                                                    Services API.



Examples
The following are examples JSON and XML responses.

JSON Response Example
{

    "authenticationResultCode":"ValidCredentials",

    "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",

    "copyright":"Copyright © 2010 Microsoft and its suppliers. All rights reserved. This
API cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.",

    "resourceSets":[

         {

             "estimatedTotal":1,

             "resources":[

                 {

                     Resource content specific to a REST service

                 }

             ]

         }

    ],



                                                                                        380
     "statusCode":200,

     "statusDescription":null,

     "traceId":"961e9c1e63e64bd4aa7d140ee4e05697"

}


XML Response Example
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">

    <Copyright>Copyright © 2010 Microsoft and its suppliers. All rights reserved. This API
cannot be accessed and the content and any results may not be used, reproduced or
transmitted in any manner without express written permission from Microsoft
Corporation.</Copyright>

    <BrandLogoUri>http://dev.virtualearth.net/Branding/logo_powered_by.png</BrandLogoUri>

    <StatusCode>200</StatusCode>

    <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>

    <TraceId>25c368c85b964f4c978ff932b966a9d4</TraceId>

    <ResourceSets>

     <ResourceSet>

       <EstimatedTotal>1</EstimatedTotal>

       <Resources>

         <Resource>

           <!-- Resource content specific to a REST service -->

         </Resource>

       </Resources>

     </ResourceSet>

    </ResourceSets>

</Response>




Status Codes and Errors
Each response to a request provides an HTTP status code. This article describes these codes.


HTTP Status Codes
The following table lists the most common HTTP status codes. Additional information may be
provided with a specific request.

                                                                                             381
HTTP Status Code                Short Description              Details

200                             OK                             The request is successful.

201                             Created                        A new resource is created.

202                             Accepted                       The request has been accepted
                                                               for processing.

400                             Bad Request                    The request contained an error.

401                             Unauthorized                   Access was denied. You may
                                                               have entered your credentials
                                                               incorrectly, or you might not
                                                               have access to the requested
                                                               resource or operation.

403                             Forbidden                      The request is for something
                                                               forbidden. Authorization will not
                                                               help.

404                             Not Found                      The requested resource was
                                                               not found.

500                             Internal Server Error          Your request could not be
                                                               completed because there was a
                                                               problem with the service.

503                             Service Unavailable            There's a problem with the
                                                               service right now. Please try
                                                               again later.




Developer Resources
Getting Help


Developer Resources
    Connect with other Bing Maps developers on the Bing Maps Forum.
    Read the Bing Maps Blog


Account Issues
If you are having issues creating a Bing Maps Developer Account, getting a Bing Maps Key, or
have an account access question, contact mpnet@microsoft.com.
                                                                                               382
Licensing Questions
If you are interested in finding out more about Bing Maps or have questions about licensing Bing
Maps, you can request information at Contact Us: Bing Maps for Enterprise. From North, Central,
and South America, you can also contact Bing Maps by calling (800) 426-9400, ext. 11315.




                                                                                             383

				
DOCUMENT INFO
Shared By:
Categories:
Tags: bing.pdf
Stats:
views:127
posted:5/13/2012
language:English
pages:383