The GetRoute service returns routing information for a set of two distinct points or multiple points. It takes a starting location and an ending location with optional intermediate points as input, and returns the route that is either the fastest or the shortest.

Note: The response from the REST service will be in JSON format and the geometry returned will be in GeoJSON format. When a request contains invalid query parameters in the GET URL or an invalid payload for POST, a cumulative error response will be returned in a JSON array. The value node in the response JSON is deprecated. For error checking, only the errors node should be utilized.


The following format is used for HTTP GET requests. HTTP GET is used for simple routes where no additional JSON payload is required. Intermediate points can also be added to the HTTP GET request.

HTTP GET /rest/Spatial/erm/databases/dbsource.json?q=route&query_parameters

Where dbsource is the name of the database that contains the data to use for the route. Use the database name specified in the Enterprise Routing Module Routing Database Resource tool.


The following format is used for HTTP POST requests:

HTTP POST:  /rest/Spatial/erm/databases/dbsource.json?q=route&query_parameters
POST BODY: Content-Type:application/json {Route Data}

Route Data is the POST json body (Content-Type: application/json) for the additional route information to be used in the calculation containing intermediate points, transient updates, or priority for road types. For information and examples on these options, see GetRoute HTTP POST Options.

Query Parameters

This operation takes the following query parameters.

Parameter Type Required Description
startPoint String yes The start location of the route in the format: x,y,coordSys. For example: -74.2,40.8,epsg:4326
endPoint String yes The end location of the route in the format: x,y,coordSys. For example: -74.2,40.8,epsg:4326
intermediatePoints String no A list of intermediate points to include along the route. To include in the HTTP GET request, use the format: Long,Lat,Long,Lat,…,coordsys. For example: -74.2,40.8,-73,42,epsg:4326. To include a set of intermediate points in a HTTP POST request, add the MultiPoint JSON payload indicating the points that the route will include. If intermediate points are specified both in the URL and in the json payload, the json payload is given preference, and the intermediate points in URL are ignored.
oip Boolean no A processing parameter that indicates if the intermediate points should be optimized. The default is false. By default the intermediate points will be used in the calculation in the order specified. If set to true, the specified points will be re-ordered in an optimal manner during route computation.
returnIntermediatePoints Boolean no

Whether to return the intermediate points with the route response. The default is false.

For any value other that true or false, it will default to false. This option will return the intermediate points in order as specified in the POST body. If the value of option oip is set to true, then this option will return intermediate points in optimized order.

destinationSrs String no The coordinate system to return the route and resulting geometries. The default is the coordinate system of the data used.
optimizeBy String no The type of optimizing to use for the route. Valid values are time or distance. The default is time.
returnDistance Boolean no The route directions include the distance traveled. The default is true.
distanceUnit String no The units to return distance. The default is m (meter). Available values are: m(meter), km(kilometer), yd(yard), ft(foot), mi(mile).
returnTime Boolean no The route directions include the time it takes to follow a direction. The default is true.
timeUnit String no The units to return time. The default is min (minute). Available values are: min(minute), msec (millisecond), s(second), h(hour).
language String no

The language the travel directions should be returned, only if route directions are returned (if directionsStyle is defined as Normal or Terse). The default being English (en).

Directions can be returned in the following languages:

Return directions in Albanian.
Return directions in Chinese.
Return directions in Chinese (Taiwan).
Return directions in Croatian.
Return directions in Czech.
Return directions in Danish.
Return directions in Dutch.
Return directions in English. Default
Return directions in American English.
Return directions in Estonian.
Return directions in Finnish.
Return directions in French.
Return directions in German.
Return directions in Hungarian.
Return directions in Italian.
Return directions in Japanese.
Return directions in Latvian.
Return directions in Lithuanian.
Return directions in Norwegian.
Return directions in Portuguese.
Return directions in Romanian.
Return directions in Slovak.
Return directions in Slovenian.
Return directions in Spanish.
Return directions in Swedish.
Return directions in Russian.
Return directions in Turkish.
returnDirectionGeometry Boolean no Include the geometry associated with each route instruction in route response. The default is false.
directionsStyle String no

The type of route directions to return. Default value is None. Specify this parameter if you required route directions to be returned. The options when specifying route directions are:

No directions returned. Default, if not specified.
Directions are returned in a full format, appropriate for web-based applications.
Directions are returned in a short format, appropriate for mobile applications.
segmentGeometryStyle String no

The format of the geometry that represents a segment of the route. Default value is None. Specify this parameter if you required segment geometries to be returned. The options when specifying route directions are:

No geometric representation of a segment will be returned. Default, if not specified.
Each segment of the route will be returned with just its endpoints in a LineString.
Each segment will be returned with all its shape points as a LineString. The LineString can be used as an overlay on a map.
primaryNameOnly Boolean no Whether to return all names for a given street in the directions or to return just the primary name for a street. Only used when route directions are returned. The default being false.
majorRoads Boolean no Whether to include all roads in the calculation or just major roads. If you choose to include only major roads, performance will improve but accuracy may decrease. The default is false.
historicTrafficTimeBucket String no

Specifies whether the routing calculation uses the historic traffic speeds. These speeds are based on different time-of-day buckets. The data must have historic traffic speeds included in order to use this feature. The data for each country/region has the same bucket definitions, where the speeds for these bucket values may vary. The options are:

The default value. Historic traffic data is not used in the calculation. Instead an averaged speed value is used.
Calculate routes with the peak AM speeds. The AMPeak time bucket is from 07:00 to 10:00hr time of day.
Calculate routes with the peak PM speeds. The PMPeak time bucket is from 16:00 to 19:00hr time of day.
Calculate routes with the off peak (daytime) speeds. The OffPeak time bucket is from 10:00 to 16:00hr time of day.
Calculate routes with the nighttime speeds. The Night time bucket is from 22:00 to 04:00hr time of day.
avoid String No Specifies a comma-separated list of road types to be avoided during route calculation. This is a String parameter. When a road type is provided as the value of the parameter, the route excludes that type of roads in route calculation. For example, if tollRoad is provided as the parameter value, the calculated route contains a route without any toll roads.


Simple Route with start and end points.,40.79,epsg:4326&endPoint=-73.98,40.74,epsg:4326			


	"distance": 7779,
	"distanceUnit": "m",
	"time": 16.75,
	"timeUnit": "min"

Route with intermediate points.


				"distance": 1921,
				"distanceUnit": "m",
				"intermediatePoints": {
				"type": "MultiPoint",
				"coordinates": [
				[-73.971802, 40.79463],
				[-73.973562, 40.792193],
				[-73.976266, 40.788717]
				"time": 4.2,
				"timeUnit": "min"

Route with directions enabled.,40.79,epsg:4326&endPoint=-73.98,40.74,


"time": 10.58,
"timeUnit": "min",
"distance": 9035,
"distanceUnit": "m",
"language": "en",
"directionsStyle": "Normal",
"routeDirections": [
"time": 0.03,
"timeUnit": "min",
"distance": 25,
"distanceUnit": "m",
"instruction": "",
"type": "LineString",
"time": 0.7,
"timeUnit": "min",
"distance": 394,
"distanceUnit": "m",
"instruction": "Turn right on W 91st St and travel West 394.0 m
(0.7 min).",
"type": "LineString",