{"_id":"5625feead0f87e190014c505","editedParams2":true,"parentDoc":null,"project":"55e06494a44fae0d002146aa","__v":0,"editedParams":true,"user":"55c9b7b4e4927a0d0004a727","version":{"_id":"55e06495a44fae0d002146ad","project":"55e06494a44fae0d002146aa","__v":54,"createdAt":"2015-08-28T13:39:33.907Z","releaseDate":"2015-08-28T13:39:33.907Z","categories":["55e06496a44fae0d002146ae","55e06997a44fae0d002146c2","55e06a6958c5460d0076aa0c","55e06ae66bad670d0081f25c","55e06cc1a44fae0d002146cb","55e06ddda44fae0d002146cd","55e95f261fd7e82300ef359f","55e95fe47fc27b2d00d32cfa","55e96eef358d923700be984d","55e96ef6358d923700be984e","55e96efda7ca823900ad547e","55e96f04a7ca823900ad547f","55e970cc358d923700be9853","55e973f4358d923700be9858","55e973f9a7ca823900ad548c","55e977bf358d923700be985d","55e9780f8b72bb3700b1d5bd","55e97815a7ca823900ad5493","55e9781c358d923700be985f","55e97821461e2a390050f23b","55f963c23bb4bb0d0022d18c","5624c67406e8040d005ed6b2","5624dcf25a86b423009462e8","5625f229d0f87e190014c4ed","5627819fe2ce610d004e3ec8","562781b23a4c6b0d00c4556b","5627837166c62617009d17e2","5627851efcbbc621004ebff1","5627860044c87f0d00fe6491","562e3c6d54a5be0d00070c3e","564c955aae6cb82100dc137a","5652e22abbe7110d00dba748","5652f25523d4262d00b21c58","5652fdad51e4e81900bf2452","5652fdcbb60abb1700bafadc","5654494f65bec717007e0293","565da11a77f0090d005818ff","565f063f413e06170093de18","565f06fb413e06170093de21","56dd6773efaca42900e5f58e","56dd68630c3bb41700b0b037","56dd7d24d5419f170075dfb3","56dd9448c117291700015b60","56dd9454c117291700015b61","577a6f8b9748b80e00ef3f45","577a6f969748b80e00ef3f46","577bba7f6e5f301900fada99","57a9cc8e5b1ace0e00de743f","58aab134c50c33250046b8f8","58aab146aecc3e2500573d4c","58aab1628f862f250076f92e","58aab1938f862f250076f92f","58aab3e5aecc3e2500573d56","58aab3f2aecc3e2500573d57"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"55e977bf358d923700be985d","project":"55e06494a44fae0d002146aa","__v":4,"pages":["5625f40751bf1c0d001f666e","5625f418f3adc80d004860a1","5625fc94eb610e0d0078dc90","5625feead0f87e190014c505"],"version":"55e06495a44fae0d002146ad","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-09-04T10:51:43.154Z","from_sync":false,"order":15,"slug":"endpoint-4","title":"endpoint"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-20T08:44:26.785Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"// Data returned for example query above truncated to one result\n{  \n   \"paths\":[  \n      {  \n         \"crs\":{  \n            \"properties\":{  \n               \"name\":\"BNG\"\n            },\n            \"type\":\"name\"\n         },\n         \"distance\":744.162,\n         \"time\":535794,\n         \"points_encoded\":true,\n         \"weight\":744.162379,\n         \"instructions\":[  \n            {  \n               \"sign\":0,\n               \"text\":\"Continue onto Path\",\n               \"time\":87056,\n               \"distance\":120.912,\n               \"interval\":[  \n                  0,\n                  9\n               ]\n            },\n            {  \n               \"annotation_text\":\"Scree\",\n               \"sign\":0,\n               \"text\":\"Continue onto Path\",\n               \"time\":424339,\n               \"distance\":589.362,\n               \"interval\":[  \n                  9,\n                  35\n               ],\n               \"annotation_importance\":0\n            },\n            {  \n               \"sign\":-1,\n               \"text\":\"Turn slight left onto Path\",\n               \"time\":24399,\n               \"distance\":33.888,\n               \"interval\":[  \n                  35,\n                  38\n               ]\n            },\n            {  \n               \"sign\":4,\n               \"text\":\"Finish!\",\n               \"time\":0,\n               \"distance\":0,\n               \"interval\":[  \n                  38,\n                  38\n               ]\n            }\n         ],\n         \"bbox\":[  \n            507200.286044,\n            321093.44162,\n            507559.335452,\n            321603.151279\n         ],\n         \"points\":\":::at:::@????????????????????????????????????????????????????????????????????????????\"\n      }\n   ],\n   \"info\":{  \n      \"took\":2\n   }\n}","name":"OK - JSON"},{"status":200,"language":"xml","code":"{}","name":"OK - XML"},{"code":"// Example: Missing mandatory parameter\n{\n  \"error\": {\n    \"message\": \"No point parameter provided.\",\n    \"statuscode\": \"400\"\n  },\n  \"hints\": [{\"message\": \"No point parameter provided.\"}]\n}\n\n\n// Example: Parameter entry of wrong type\n{\n  \"error\": {\n    \"message\": \"Point x is not a valid point. Point must be a comma separated coordinate in BNG projection.\",\n    \"statuscode\": \"400\"\n  },\n  \"hints\": [{\"message\": \"Point x is not a valid point. Point must be a comma separated coordinate in BNG projection.\"}]\n}\n\n\n// Example: Wrong parameter name\n{\n  \"error\": {\n    \"message\": \"Parameter x is not a valid parameter for resource route. Valid parameters for requested resource are point, vehicle, locale, instructions, weighting, algorithm, points_encoded, debug, pretty, calc_points, type, avoidances, private, srs, output_srs.\",\n    \"statuscode\": \"400\"\n  },\n  \"hints\": [{\"message\": \"Parameter x is not a valid parameter for resource route. Valid parameters for requested resource are point, vehicle, locale, instructions, weighting, algorithm, points_encoded, debug, pretty, calc_points, type, avoidances, private, srs, output_srs.\"}]\n}","status":400,"language":"json"},{"status":401,"language":"json","code":"{\n    \"fault\": {\n        \"faultstring\": \"Invalid ApiKey\",\n        \"detail\": {\n            \"errorcode\": \"oauth.v2.InvalidApiKey\"\n        }\n    }\n}"},{"status":404,"language":"json","code":"{  \n   \"error\":{  \n      \"statuscode\":\"404\",\n      \"message\":\"Resource x does not exist. Valid resources are route, nearest.\"\n   }\n}"},{"language":"json","code":"{  \n   \"fault\":{  \n      \"faultstring\":\"Received 405 Response without Allow Header\",\n      \"detail\":{  \n         \"errorcode\":\"protocol.http.Response405WithoutAllowHeader\"\n      }\n   }\n}","status":405},{"status":500,"language":"json","code":"{\n    \"error\": {\n        \"statuscode\": 500,\n        \"message\": \"The provided request resulted in an internal server error.\"\n    }\n}"}]},"settings":"","examples":{"codes":[{"language":"javascript","code":"var req = new XMLHttpRequest();\nreq.open(\"GET\", \"https://api.ordnancesurvey.co.uk/nonvehicle_routing_api/route?point=321604,507240&point=321123,507554&vehicle=foot&apikey=[[app:key]]\",true);\nreq.onreadystatechange = function () {\n    console.log(req.responseText);\n}\nreq.send();","name":""},{"name":"JQuery","language":"javascript","code":"var url = 'https://api.ordnancesurvey.co.uk/nonvehicle_routing_api/route?point=321604,507240&point=321123,507554&vehicle=foot&apikey=[[app:key]]';\n\n$.getJSON(url, function(data){\n    console.log(data);\n})"},{"code":"<html lang=\"en\" ng-app=\"angularAPI\">\n<head>\n  <meta charset=\"utf-8\">\n  <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js\"></script>\n</head>\n\n<script type=\"text/javascript\">\n\tvar osAPI = angular.module('angularAPI', []);\n\n\tosAPI.controller('apiService', ['$scope', '$http', function($scope, $http) {\n\t\tvar key = \"[[app:key]]\";\n\t\tvar query = 'https://api.ordnancesurvey.co.uk/nonvehicle_routing_api/route?point=321604,507240&point=321123,507554&vehicle=foot';\n\t\t$http.get(query+'&apikey='+key).success(function(data) {\n\t\t\t$scope.output = data;\n\t\t});\n\t}]);\n</script>\n\n<body ng-controller=\"apiService\">\n\t<ul>\n\t\t<li ng-repeat= \"value in output\">\n\t\t\t<p>{{value}}</p>\n\t\t</li>\n\t</ul>\n</body>\n</html>","language":"html","name":"AngularJS"}]},"method":"get","auth":"required","params":[{"_id":"5625fa6bf3adc80d004860b4","ref":"","in":"query","required":true,"desc":"Specify multiple points for which the route will be calculated. The order is important with the first point being the beginning of the route, with further points being added sequentially to the route. Specify at least two points. If the coordinates are not in BNG, then the SRS parameter will have to be corrected for this.","default":"","type":"string","name":"point"},{"_id":"5625fa6bf3adc80d004860b3","ref":"","in":"query","required":true,"desc":"The vehicle for which the route should be calculated. Default: foot","default":"foot, mtb","type":"string","name":"vehicle"},{"_id":"5625fa6bf3adc80d004860b2","ref":"","in":"query","required":false,"desc":"If instructions should be calculated and returned. Default: true","default":"true, false","type":"boolean","name":"instructions"},{"_id":"5625fa6bf3adc80d004860b1","ref":"","in":"query","required":false,"desc":"The type of route calculation that is required. Default: fastest","default":"fastest, shortest","type":"string","name":"weighting"},{"_id":"5625fa6bf3adc80d004860b0","ref":"","in":"query","required":false,"desc":"The language for resulting directions. Note the list is crowd sourced. Default: en","default":"","type":"string","name":"locale"},{"_id":"5625fa6bf3adc80d004860af","ref":"","in":"query","required":false,"desc":"The algorithm used to calculate the route. Default: dijkstrabi","default":"dijkstrabi, dijkstra, astar, astarbi","type":"string","name":"algorithm"},{"_id":"5625fa6bf3adc80d004860ae","ref":"","in":"query","required":false,"desc":"If false , a GeoJson array in point is returned. If true, the resulting route will be encoded leading to big bandwidth reduction. A special handling for the decoding of this string on the client-side will be required. Default: true","default":"true, false","type":"string","name":"points_encoded"},{"_id":"5625fa6bf3adc80d004860ad","ref":"","in":"query","required":false,"desc":"If true, the output will be formatted. Default: false","default":"true, false","type":"string","name":"debug"},{"_id":"5625fa6bf3adc80d004860ac","ref":"","in":"query","required":false,"desc":"If true, output will include carriage returns and spacing. Default: false","default":"true, false","type":"string","name":"pretty"},{"_id":"5625fa6bf3adc80d004860ab","ref":"","in":"query","required":false,"desc":"If the points for the route should be calculated. Default: true","default":"true, false","type":"string","name":"calc_points"},{"_id":"5625fa6bf3adc80d004860aa","ref":"","in":"query","required":false,"desc":"Specifies the resulting format of the route. For json, the content type will be application/json. For gpx, the content type will be application/xml. Default: json","default":"json, gpx","type":"string","name":"type"},{"_id":"5625fa6bf3adc80d004860a9","ref":"","in":"query","required":false,"desc":"Specify the list of hazards, separated by a comma, that need to be avoided while calculated the route.","default":"aroad, boulders, cliff, inlandwater, marsh, quarryorpit, scree, rock, mud, sand, shingle, spoil, tidalwater","type":"string","name":"avoidances"},{"_id":"5625fa6bf3adc80d004860a8","ref":"","in":"query","required":false,"desc":"Specify the input coordinate system for the point parameter. It will also specify the output coordinate system unless the output_srs parameter is set. Only JSON format will be transformed on output as gpx is specified to be in WGS84. Default: bng","default":"bng, EPSG:27700, WGS:84, EPSG:4326, EPSG:3857, EPSG:4258","type":"string","name":"srs"},{"_id":"5625fa6bf3adc80d004860a7","ref":"","in":"query","required":false,"desc":"Specify the output srs for your point list. Only JSON format will be transformed on output as gpx is specified to be in WGS84. Default: {srs value}","default":"bng, EPSG:27700, WGS:84, EPSG:4326, EPSG:3857, EPSG:4258","type":"string","name":"output_srs"}],"url":"/nonvehicle_routing_api/route?"},"isReference":true,"order":4,"body":"","excerpt":"OS Routes Routing (Non-vehicular)","slug":"os-routes-nonv-route","type":"endpoint","title":"Routing (Non-vehicular)"}

getRouting (Non-vehicular)

OS Routes Routing (Non-vehicular)

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

point:
required
string
Specify multiple points for which the route will be calculated. The order is important with the first point being the beginning of the route, with further points being added sequentially to the route. Specify at least two points. If the coordinates are not in BNG, then the SRS parameter will have to be corrected for this.
vehicle:
required
stringfoot, mtb
The vehicle for which the route should be calculated. Default: foot
instructions:
booleantrue, false
If instructions should be calculated and returned. Default: true
weighting:
stringfastest, shortest
The type of route calculation that is required. Default: fastest
locale:
string
The language for resulting directions. Note the list is crowd sourced. Default: en
algorithm:
stringdijkstrabi, dijkstra, astar, astarbi
The algorithm used to calculate the route. Default: dijkstrabi
points_encoded:
stringtrue, false
If false , a GeoJson array in point is returned. If true, the resulting route will be encoded leading to big bandwidth reduction. A special handling for the decoding of this string on the client-side will be required. Default: true
debug:
stringtrue, false
If true, the output will be formatted. Default: false
pretty:
stringtrue, false
If true, output will include carriage returns and spacing. Default: false
calc_points:
stringtrue, false
If the points for the route should be calculated. Default: true
type:
stringjson, gpx
Specifies the resulting format of the route. For json, the content type will be application/json. For gpx, the content type will be application/xml. Default: json
avoidances:
stringaroad, boulders, cliff, inlandwater, marsh, quarryorpit, scree, rock, mud, sand, shingle, spoil, tidalwater
Specify the list of hazards, separated by a comma, that need to be avoided while calculated the route.
srs:
stringbng, EPSG:27700, WGS:84, EPSG:4326, EPSG:3857, EPSG:4258
Specify the input coordinate system for the point parameter. It will also specify the output coordinate system unless the output_srs parameter is set. Only JSON format will be transformed on output as gpx is specified to be in WGS84. Default: bng
output_srs:
stringbng, EPSG:27700, WGS:84, EPSG:4326, EPSG:3857, EPSG:4258
Specify the output srs for your point list. Only JSON format will be transformed on output as gpx is specified to be in WGS84. Default: {srs value}

Examples


Result Format


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}