Re: [OSRM-talk] (no subject)
Hey Romain, Leaflet-Routing-Machine is a good reference for seeing how to query the OSRM route with javascript from a browser: https://github.com/perliedman/leaflet-routing-machine/blob/master/src/L.Routing.OSRM.js They use corslite [1] to do the json querry. [1] https://github.com/perliedman/leaflet-routing-machine/blob/master/src/L.Routing.OSRM.js#L55 Good luck, Patrick On Thu, Feb 12, 2015 at 10:46 AM, Romain NKONGO romain.rn...@gmail.com wrote: Hello to all the OSRM community. I'm a french student who works on a university project, along with my supervisor and uses the open source project OSRM to achieve it. At some point, I have to run some tests (like thousands of tests) to extract some values from the JSON outputs (e.g. the total time). Now our problem is we tried several ways to do this, by sending HTTP GET requests to the running server and treat the returned response as JSON. But we tried with Javascript, jQuery and AngularJS, with functions like $resource.get, jQuery.getJSON $http.get or $http.jsonp and we never managed to get the returned response in a way that we could use it for further treatment in our script. Actually, we were able to send the requests to the server but the response is returned in the fom of an URL link which contains the JSON output in its body, not in the form of a variable in our Javascript that we could manipulate. As a matter of fact, we have two issues for this : - some of the functions we used (which are based on jsonp) added a callback parameter to the sent URL, so the request became invalid with 'Query malformed at the position' errors - I've seen in the OSRM documentation that the JSON output is encoded with the Google polyline algorithm so it could be an invalid JSON for Javascript (we also observed errors like SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data We essentially want to use the viaroute service, so our URL is something like that : htttp://localhost:5000/viaroute?loc=a,bloc=c,d with a,b, c and d random float numbers. Has anyone ever tried to run some customized tests on OSRM, with any Web language, and if so can he give me some tricks of how he succeeded to get the JSON ouptut where he wanted? To be clearer of how I proceeded in AngularJS, here the code of my app.js : var app = angular.module('clientOSRM', ['ngResource']); app.controller('appController', ['$scope','$http', 'appServices', function ($scope,$http, appServices) { //Initialisation de notre input, sa valeur sera stockée en instantané dans cette variable (ng-model) $scope.valueInput1 = 47.3654647,0.6822917; $scope.valueInput2 = 47.3905003,0.6920979; var getItineraryParams = function () { return { start: $scope.valueInput1, end: $scope.valueInput2 //start: 47.3654647,0.6822917, //end: 47.3905003,0.6920979 //start: a,b, //end: c,d } }; //Une fonction accessible que dans ce controleur (mot clé var) var getItinerary = function () { appServices.osrm.get(getItineraryParams(), function (itinerary) { alert(Succes : +typeof itinerary); console.log(itinerary); }, function (error) { alert(erreur : +typeof error+; status : +error.status); console.log(error); } ); /*$http.jsonp( http://localhost:5000/viaroute?loc=47.3654647,0.6822917loc=47.3905003,0.6920979alt=falsegeometry=falseoutput=json ) .success(function(data, status, headers, config) { console.log(data); }). error(function(data, status, headers, config) { console.log(data); });*/ }; //Une fonction accessible depuis la vue //Fonction appelée à l'envoi du formulaire (balise ng-submit dans form) $scope.submit = function () { //On peut récupérer la valeur de notre input ! //console.log($scope.valueInput1); getItinerary(); }; }]); app.run(function ($rootScope) { $rootScope.safeApply = function (fn) { var phase = $rootScope.$$phase; if (phase === '$apply' || phase === '$digest') { if (fn (typeof(fn) === 'function')) { fn(); } } else { this.$apply(fn); } }; }); and also the appServices.js code : app.factory('appServices', function ($resource) { return { osrm: $resource(, {}, { 'get': { method: 'GET', params: {start: '@start', end: '@end'}, isArray:true, url: http://localhost:5000/viaroute?loc=:startloc=:endalt=falsegeometry=false } }) }; }); In the getItinerary function in app.js, the error function (the 3rd parameter) is always triggered even with a HTTP status code '200 OK' of the request.
Re: [OSRM-talk] (no subject)
Hey Patrick, Thanks for the help. Sorry but I'm a little bit new with Javascript environment. I see that the first link you sent me is contained in a full-working project. In order to use the functionalities of the .js file, do I have to include the whole project in some way, or can I re-use the single file on my side without any extra-dependencies? Also, is the leaflet routing machine is useful to run many tests on the OSRM server with random locations values each time? Romain. 2015-02-12 11:34 GMT+01:00 Patrick Niklaus patrick.nikl...@student.kit.edu : Hey Romain, Leaflet-Routing-Machine is a good reference for seeing how to query the OSRM route with javascript from a browser: https://github.com/perliedman/leaflet-routing-machine/blob/master/src/L.Routing.OSRM.js They use corslite [1] to do the json querry. [1] https://github.com/perliedman/leaflet-routing-machine/blob/master/src/L.Routing.OSRM.js#L55 Good luck, Patrick On Thu, Feb 12, 2015 at 10:46 AM, Romain NKONGO romain.rn...@gmail.com wrote: Hello to all the OSRM community. I'm a french student who works on a university project, along with my supervisor and uses the open source project OSRM to achieve it. At some point, I have to run some tests (like thousands of tests) to extract some values from the JSON outputs (e.g. the total time). Now our problem is we tried several ways to do this, by sending HTTP GET requests to the running server and treat the returned response as JSON. But we tried with Javascript, jQuery and AngularJS, with functions like $resource.get, jQuery.getJSON $http.get or $http.jsonp and we never managed to get the returned response in a way that we could use it for further treatment in our script. Actually, we were able to send the requests to the server but the response is returned in the fom of an URL link which contains the JSON output in its body, not in the form of a variable in our Javascript that we could manipulate. As a matter of fact, we have two issues for this : - some of the functions we used (which are based on jsonp) added a callback parameter to the sent URL, so the request became invalid with 'Query malformed at the position' errors - I've seen in the OSRM documentation that the JSON output is encoded with the Google polyline algorithm so it could be an invalid JSON for Javascript (we also observed errors like SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data We essentially want to use the viaroute service, so our URL is something like that : htttp://localhost:5000/viaroute?loc=a,bloc=c,d with a,b, c and d random float numbers. Has anyone ever tried to run some customized tests on OSRM, with any Web language, and if so can he give me some tricks of how he succeeded to get the JSON ouptut where he wanted? To be clearer of how I proceeded in AngularJS, here the code of my app.js : var app = angular.module('clientOSRM', ['ngResource']); app.controller('appController', ['$scope','$http', 'appServices', function ($scope,$http, appServices) { //Initialisation de notre input, sa valeur sera stockée en instantané dans cette variable (ng-model) $scope.valueInput1 = 47.3654647,0.6822917; $scope.valueInput2 = 47.3905003,0.6920979; var getItineraryParams = function () { return { start: $scope.valueInput1, end: $scope.valueInput2 //start: 47.3654647,0.6822917, //end: 47.3905003,0.6920979 //start: a,b, //end: c,d } }; //Une fonction accessible que dans ce controleur (mot clé var) var getItinerary = function () { appServices.osrm.get(getItineraryParams(), function (itinerary) { alert(Succes : +typeof itinerary); console.log(itinerary); }, function (error) { alert(erreur : +typeof error+; status : +error.status); console.log(error); } ); /*$http.jsonp( http://localhost:5000/viaroute?loc=47.3654647,0.6822917loc=47.3905003,0.6920979alt=falsegeometry=falseoutput=json ) .success(function(data, status, headers, config) { console.log(data); }). error(function(data, status, headers, config) { console.log(data); });*/ }; //Une fonction accessible depuis la vue //Fonction appelée à l'envoi du formulaire (balise ng-submit dans form) $scope.submit = function () { //On peut récupérer la valeur de notre input ! //console.log($scope.valueInput1); getItinerary(); }; }]); app.run(function ($rootScope) { $rootScope.safeApply = function (fn) { var phase = $rootScope.$$phase; if (phase === '$apply' || phase === '$digest') { if (fn (typeof(fn) === 'function')) { fn(); } } else { this.$apply(fn); } };
Re: [OSRM-talk] (no subject)
Hi, If you want raw json data, then use a normal query like $http.get. Second, you can pass compression=false to bypass the polyline encoding. Cheers, Guillaume ___ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk
[OSRM-talk] (no subject)
Hello to all the OSRM community. I'm a french student who works on a university project, along with my supervisor and uses the open source project OSRM to achieve it. At some point, I have to run some tests (like thousands of tests) to extract some values from the JSON outputs (e.g. the total time). Now our problem is we tried several ways to do this, by sending HTTP GET requests to the running server and treat the returned response as JSON. But we tried with Javascript, jQuery and AngularJS, with functions like $resource.get, jQuery.getJSON $http.get or $http.jsonp and we never managed to get the returned response in a way that we could use it for further treatment in our script. Actually, we were able to send the requests to the server but the response is returned in the fom of an URL link which contains the JSON output in its body, not in the form of a variable in our Javascript that we could manipulate. As a matter of fact, we have two issues for this : - some of the functions we used (which are based on jsonp) added a callback parameter to the sent URL, so the request became invalid with 'Query malformed at the position' errors - I've seen in the OSRM documentation that the JSON output is encoded with the Google polyline algorithm so it could be an invalid JSON for Javascript (we also observed errors like SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data We essentially want to use the viaroute service, so our URL is something like that : htttp://localhost:5000/viaroute?loc=a,bloc=c,d with a,b, c and d random float numbers. Has anyone ever tried to run some customized tests on OSRM, with any Web language, and if so can he give me some tricks of how he succeeded to get the JSON ouptut where he wanted? To be clearer of how I proceeded in AngularJS, here the code of my app.js : var app = angular.module('clientOSRM', ['ngResource']); app.controller('appController', ['$scope','$http', 'appServices', function ($scope,$http, appServices) { //Initialisation de notre input, sa valeur sera stockée en instantané dans cette variable (ng-model) $scope.valueInput1 = 47.3654647,0.6822917; $scope.valueInput2 = 47.3905003,0.6920979; var getItineraryParams = function () { return { start: $scope.valueInput1, end: $scope.valueInput2 //start: 47.3654647,0.6822917, //end: 47.3905003,0.6920979 //start: a,b, //end: c,d } }; //Une fonction accessible que dans ce controleur (mot clé var) var getItinerary = function () { appServices.osrm.get(getItineraryParams(), function (itinerary) { alert(Succes : +typeof itinerary); console.log(itinerary); }, function (error) { alert(erreur : +typeof error+; status : +error.status); console.log(error); } ); /*$http.jsonp( http://localhost:5000/viaroute?loc=47.3654647,0.6822917loc=47.3905003,0.6920979alt=falsegeometry=falseoutput=json ) .success(function(data, status, headers, config) { console.log(data); }). error(function(data, status, headers, config) { console.log(data); });*/ }; //Une fonction accessible depuis la vue //Fonction appelée à l'envoi du formulaire (balise ng-submit dans form) $scope.submit = function () { //On peut récupérer la valeur de notre input ! //console.log($scope.valueInput1); getItinerary(); }; }]); app.run(function ($rootScope) { $rootScope.safeApply = function (fn) { var phase = $rootScope.$$phase; if (phase === '$apply' || phase === '$digest') { if (fn (typeof(fn) === 'function')) { fn(); } } else { this.$apply(fn); } }; }); and also the appServices.js code : app.factory('appServices', function ($resource) { return { osrm: $resource(, {}, { 'get': { method: 'GET', params: {start: '@start', end: '@end'}, isArray:true, url: http://localhost:5000/viaroute?loc=:startloc=:endalt=falsegeometry=false; } }) }; }); In the getItinerary function in app.js, the error function (the 3rd parameter) is always triggered even with a HTTP status code '200 OK' of the request. Any ideas where it could go wrong? Thanks in advance. ___ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk
[OSRM-talk] Build OSRM in Netbeans failed
Hello together, I cloned the project from gitHub and tried to run it in Netbeans 8.0.2, but by building it failed. I use Ubuntu 14.04 and installed all dependencies before, as written in the wiki of OSRM. It is also possible to build by following the instructions with cmake, make etc. In Netbeans I created a new c++ application and include the cloned file into the project. In the next step I set all Linkers, references to libary and Directories. Below the error messages of Netbeans: rm -f build/Debug/GNU-Linux-x86/_ext/1483342605/unlock_all_mutexes.o.d g++ -c -g -I../../osrm3/osrm-backend/Include -I../../osrm3/osrm-backend/third_party -I../../osrm3/osrm-backend/Util -I../../osrm3/osrm-backend/Library -I../../osrm3/osrm-backend/plugins -I../../../gdal-1.9.0 -I/usr/include/lua5.1 -I/usr/lib/x86_64-linux-gnu -I/usr/include/boost/uuid -std=c++11 -MMD -MP -MF build/Debug/GNU-Linux-x86/_ext/1483342605/unlock_all_mutexes.o.d -o build/Debug/GNU-Linux-x86/_ext/1483342605/unlock_all_mutexes.o ../../osrm3/osrm-backend/tools/unlock_all_mutexes.cpp mkdir -p dist/Debug/GNU-Linux-x86 g++ -o dist/Debug/GNU-Linux-x86/osrm2 build/Debug/GNU-Linux-x86/_ext/1760923315/OSRM_impl.o build/Debug/GNU-Linux-x86/_ext/2080049265/Connection.o build/Debug/GNU-Linux-x86/_ext/859202438/Reply.o build/Debug/GNU-Linux-x86/_ext/2080049265/RequestHandler.o build/Debug/GNU-Linux-x86/_ext/2080049265/RequestParser.o build/Debug/GNU-Linux-x86/_ext/1327599876/DouglasPeuckerTest.o build/Debug/GNU-Linux-x86/_ext/1325840625/algorithm_tests.o build/Debug/GNU-Linux-x86/_ext/677683691/BinaryHeapTest.o build/Debug/GNU-Linux-x86/_ext/677683691/RangeTableTest.o build/Debug/GNU-Linux-x86/_ext/677683691/StaticGraphTest.o build/Debug/GNU-Linux-x86/_ext/677683691/StaticRTreeTest.o build/Debug/GNU-Linux-x86/_ext/1325840625/datastructure_tests.o build/Debug/GNU-Linux-x86/_ext/324025520/bearing.o build/Debug/GNU-Linux-x86/_ext/324025520/compute_angle.o build/Debug/GNU-Linux-x86/_ext/324025520/osrm_exception.o build/Debug/GNU-Linux-x86/_ext/324025520/simple_logger.o build/Debug/GNU-Linux-x86/_ext/339775474/douglas_peucker.o build/Debug/GNU-Linux-x86/_ext/339775474/polyline_compressor.o build/Debug/GNU-Linux-x86/_ext/339775474/polyline_formatter.o build/Debug/GNU-Linux-x86/_ext/1177015588/static_rtree.o build/Debug/GNU-Linux-x86/_ext/1731209085/edge_based_graph_factory.o build/Debug/GNU-Linux-x86/_ext/1731209085/geometry_compressor.o build/Debug/GNU-Linux-x86/_ext/1731209085/processing_chain.o build/Debug/GNU-Linux-x86/_ext/1591688135/Coordinate.o build/Debug/GNU-Linux-x86/_ext/1591688135/external_memory_node.o build/Debug/GNU-Linux-x86/_ext/1591688135/hilbert_value.o build/Debug/GNU-Linux-x86/_ext/1591688135/import_edge.o build/Debug/GNU-Linux-x86/_ext/1591688135/phantom_node.o build/Debug/GNU-Linux-x86/_ext/1591688135/restriction_map.o build/Debug/GNU-Linux-x86/_ext/1591688135/route_parameters.o build/Debug/GNU-Linux-x86/_ext/1591688135/search_engine_data.o build/Debug/GNU-Linux-x86/_ext/994232513/datastore.o build/Debug/GNU-Linux-x86/_ext/1728993642/description_factory.o build/Debug/GNU-Linux-x86/_ext/994232513/extract.o build/Debug/GNU-Linux-x86/_ext/1195187798/extraction_containers.o build/Debug/GNU-Linux-x86/_ext/1195187798/extractor.o build/Debug/GNU-Linux-x86/_ext/1195187798/extractor_callbacks.o build/Debug/GNU-Linux-x86/_ext/1195187798/extractor_options.o build/Debug/GNU-Linux-x86/_ext/1195187798/restriction_parser.o build/Debug/GNU-Linux-x86/_ext/1195187798/scripting_environment.o build/Debug/GNU-Linux-x86/_ext/994232513/prepare.o build/Debug/GNU-Linux-x86/_ext/994232513/routed.o build/Debug/GNU-Linux-x86/_ext/1483342605/check-hsgr.o build/Debug/GNU-Linux-x86/_ext/1483342605/components.o build/Debug/GNU-Linux-x86/_ext/1483342605/io-benchmark.o build/Debug/GNU-Linux-x86/_ext/1483342605/simpleclient.o build/Debug/GNU-Linux-x86/_ext/1483342605/springclean.o build/Debug/GNU-Linux-x86/_ext/1483342605/unlock_all_mutexes.o -L../../../gdal-1.9.0 -L/usr/include/lua5.1 -L/usr/lib/x86_64-linux-gnu -L../../osrm3/osrm-backend/Include -L../../osrm3/osrm-backend/Library -L../../osrm3/osrm-backend/third_party -L../../osrm3/osrm-backend/Util -L../../osrm3/osrm-backend/plugins -L/usr/lib -lpthread -lz -lbz2 -lrt -llua5.1-c++ -llua5.1 -lluajit-5.1 -lluabind -lprotobuf-lite -lprotobuf -lstxxl -ltbb -losmpbf -lboost_filesystem -lboost_graph -lboost_atomic -lboost_chrono -lboost_context -lboost_date_time -lboost_filesystem -lboost_graph -lboost_graph_parallel -lboost_iostreams -lboost_locale -lboost_log -lboost_log_setup -lboost_math_c99 -lboost_math_c99f -lboost_math_c99l -lboost_math_tr1 -lboost_math_tr1f -lboost_math_tr1l -lboost_mpi -lboost_mpi_python-py27 -lboost_mpi_python-py34 -lboost_mpi_python -lboost_prg_exec_monitor -lboost_program_options -lboost_python-py27 -lboost_python-py34 -lboost_python -lboost_random -lboost_regex -lboost_serialization -lboost_signals -lboost_system -lboost_thread -lboost_timer -lboost_unit_test_framework -lboost_wave
Re: [OSRM-talk] (no subject)
Thanks to all for your suggestions. To Guillaume : I searched about the $http.get function and I wrote this function to test if all goes well (I think I've tried it before) : var getItinerary2=function(){ $http.get( http://localhost:5000/viaroute?loc=47.3654647,0.6822917loc=47.3905003,0.6920979compression=false .success(function(data, status, headers, config) { console.log(data); }). error(function(data, status, headers, config) { console.log(error); }); }; Then I call it when I press Submit but the error function is triggered (the browser console prints error). Am I doing something wrong? To Patrick : I will take a look at the JS file to find what could be helpful. But, to be clear, what I'm trying to do is send a query to the OSRM server and get back the response in the backend, in my script, not directly in frontend, as I want to extract some information from the output. To Emil : I saw the Cucumber Suite in the OSRM project but those are precomputed tests, with known responses to the requests. In my case, I will run tests on a large map (OSM file size : 122 Mo) with random locations pairs inside the area. 2015-02-12 13:47 GMT+01:00 Emil Tin e...@tin.dk: The OSRM project includes a set of cucumber tests that does a lot of testing of binaries, including preparing data and querying the server. It’s ruby based but maybe it can help you. Look in the folder features/. The various support files that queries osrm are in features/support/ See https://github.com/Project-OSRM/osrm-backend/wiki/Cucumber-Test-Suite for more. Emil On 12 Feb 2015, at 10:46 , Romain NKONGO romain.rn...@gmail.com wrote: Hello to all the OSRM community. I'm a french student who works on a university project, along with my supervisor and uses the open source project OSRM to achieve it. At some point, I have to run some tests (like thousands of tests) to extract some values from the JSON outputs (e.g. the total time). Now our problem is we tried several ways to do this, by sending HTTP GET requests to the running server and treat the returned response as JSON. But we tried with Javascript, jQuery and AngularJS, with functions like $resource.get, jQuery.getJSON $http.get or $http.jsonp and we never managed to get the returned response in a way that we could use it for further treatment in our script. Actually, we were able to send the requests to the server but the response is returned in the fom of an URL link which contains the JSON output in its body, not in the form of a variable in our Javascript that we could manipulate. As a matter of fact, we have two issues for this : - some of the functions we used (which are based on jsonp) added a callback parameter to the sent URL, so the request became invalid with 'Query malformed at the position' errors - I've seen in the OSRM documentation that the JSON output is encoded with the Google polyline algorithm so it could be an invalid JSON for Javascript (we also observed errors like SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data We essentially want to use the viaroute service, so our URL is something like that : htttp://localhost:5000/viaroute?loc=a,bloc=c,d with a,b, c and d random float numbers. Has anyone ever tried to run some customized tests on OSRM, with any Web language, and if so can he give me some tricks of how he succeeded to get the JSON ouptut where he wanted? To be clearer of how I proceeded in AngularJS, here the code of my app.js : var app = angular.module('clientOSRM', ['ngResource']); app.controller('appController', ['$scope','$http', 'appServices', function ($scope,$http, appServices) { //Initialisation de notre input, sa valeur sera stockée en instantané dans cette variable (ng-model) $scope.valueInput1 = 47.3654647,0.6822917; $scope.valueInput2 = 47.3905003,0.6920979; var getItineraryParams = function () { return { start: $scope.valueInput1, end: $scope.valueInput2 //start: 47.3654647,0.6822917, //end: 47.3905003,0.6920979 //start: a,b, //end: c,d } }; //Une fonction accessible que dans ce controleur (mot clé var) var getItinerary = function () { appServices.osrm.get(getItineraryParams(), function (itinerary) { alert(Succes : +typeof itinerary); console.log(itinerary); }, function (error) { alert(erreur : +typeof error+; status : +error.status); console.log(error); } ); /*$http.jsonp( http://localhost:5000/viaroute?loc=47.3654647,0.6822917loc=47.3905003,0.6920979alt=falsegeometry=falseoutput=json ) .success(function(data, status, headers, config) { console.log(data); }). error(function(data, status, headers, config) {
Re: [OSRM-talk] (no subject)
Ok, so after reading the Leaflet file, it seems to be an appropriate way to send a HTTP request to the server and get the response back as variables I could process in my script. Now I wonder how I could take this interesting piece of code and adapt it to my AngularJS implementation. 2015-02-12 15:00 GMT+01:00 Romain NKONGO romain.rn...@gmail.com: Thanks to all for your suggestions. To Guillaume : I searched about the $http.get function and I wrote this function to test if all goes well (I think I've tried it before) : var getItinerary2=function(){ $http.get( http://localhost:5000/viaroute?loc=47.3654647,0.6822917loc=47.3905003,0.6920979compression=false .success(function(data, status, headers, config) { console.log(data); }). error(function(data, status, headers, config) { console.log(error); }); }; Then I call it when I press Submit but the error function is triggered (the browser console prints error). Am I doing something wrong? To Patrick : I will take a look at the JS file to find what could be helpful. But, to be clear, what I'm trying to do is send a query to the OSRM server and get back the response in the backend, in my script, not directly in frontend, as I want to extract some information from the output. To Emil : I saw the Cucumber Suite in the OSRM project but those are precomputed tests, with known responses to the requests. In my case, I will run tests on a large map (OSM file size : 122 Mo) with random locations pairs inside the area. 2015-02-12 13:47 GMT+01:00 Emil Tin e...@tin.dk: The OSRM project includes a set of cucumber tests that does a lot of testing of binaries, including preparing data and querying the server. It’s ruby based but maybe it can help you. Look in the folder features/. The various support files that queries osrm are in features/support/ See https://github.com/Project-OSRM/osrm-backend/wiki/Cucumber-Test-Suite for more. Emil On 12 Feb 2015, at 10:46 , Romain NKONGO romain.rn...@gmail.com wrote: Hello to all the OSRM community. I'm a french student who works on a university project, along with my supervisor and uses the open source project OSRM to achieve it. At some point, I have to run some tests (like thousands of tests) to extract some values from the JSON outputs (e.g. the total time). Now our problem is we tried several ways to do this, by sending HTTP GET requests to the running server and treat the returned response as JSON. But we tried with Javascript, jQuery and AngularJS, with functions like $resource.get, jQuery.getJSON $http.get or $http.jsonp and we never managed to get the returned response in a way that we could use it for further treatment in our script. Actually, we were able to send the requests to the server but the response is returned in the fom of an URL link which contains the JSON output in its body, not in the form of a variable in our Javascript that we could manipulate. As a matter of fact, we have two issues for this : - some of the functions we used (which are based on jsonp) added a callback parameter to the sent URL, so the request became invalid with 'Query malformed at the position' errors - I've seen in the OSRM documentation that the JSON output is encoded with the Google polyline algorithm so it could be an invalid JSON for Javascript (we also observed errors like SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data We essentially want to use the viaroute service, so our URL is something like that : htttp://localhost:5000/viaroute?loc=a,bloc=c,d with a,b, c and d random float numbers. Has anyone ever tried to run some customized tests on OSRM, with any Web language, and if so can he give me some tricks of how he succeeded to get the JSON ouptut where he wanted? To be clearer of how I proceeded in AngularJS, here the code of my app.js : var app = angular.module('clientOSRM', ['ngResource']); app.controller('appController', ['$scope','$http', 'appServices', function ($scope,$http, appServices) { //Initialisation de notre input, sa valeur sera stockée en instantané dans cette variable (ng-model) $scope.valueInput1 = 47.3654647,0.6822917; $scope.valueInput2 = 47.3905003,0.6920979; var getItineraryParams = function () { return { start: $scope.valueInput1, end: $scope.valueInput2 //start: 47.3654647,0.6822917, //end: 47.3905003,0.6920979 //start: a,b, //end: c,d } }; //Une fonction accessible que dans ce controleur (mot clé var) var getItinerary = function () { appServices.osrm.get(getItineraryParams(), function (itinerary) { alert(Succes : +typeof itinerary); console.log(itinerary); }, function (error) { alert(erreur : +typeof error+;