[Qt-creator] RouteRequest problem

Henry Skoglund henry at tungware.se
Sat Apr 18 20:36:24 CEST 2020


On 2020-04-18 20:30, Ghobad Zarrinchian wrote:
> Dear all,
> I need to implement a simple Qt GeoRouting application in which a 
> route is requested for two given coordinates. However, an error is 
> reported when running application. The error says:
>
> Error transferring 
> http://router.project-osrm.org/route/v1/driving/-73.9562151,40.6758950;-73.9877150,40.6833154?overview=full&steps=true&geometries=polyline6&alternatives=true&bearings=; 
> - server replied: Bad Request
>
>
> Can someone tell me what the problem is? Is something wrong with my code?
>

Hi, if I try without "..&bearings=:" at the end it seems to work just 
fine (answer from the server included below) maybe you don't need bearings?

-------------------------------------------

{"routes":[{"geometry":"cftqlA`u|`lCr at wFzu@xRgNxhAaEzZqEj^yH|m at mEv]{ArKwd at ptDyGnh@a_ at xwCyd@jsDmh@|dEyPhpAcCjLkCpLoc at r`Bez at ruCXjFZtFkz@~vC{AlF~\\lSpHnEvf at zYgw@lpCsn at pyB_\\riAcTzt at cB~FmOaJaVqN}CzA_EpN","legs":[{"summary":"Prospect Place, Butler Street","weight":968.5,"duration":681,"steps":[{"intersections":[{"out":0,"entry":[true],"bearings":[105],"location":[-73.956193,40.675954]}],"driving_side":"right","geometry":"cftqlA`u|`lCr at wF","mode":"driving","maneuver":{"bearing_after":105,"bearing_before":0,"location":[-73.956193,40.675954],"modifier":"right","type":"depart"},"weight":30.6,"duration":6,"name":"Saint Marks Avenue","distance":10.9},{"intersections":[{"out":2,"in":3,"entry":[false,true,true,false],"bearings":[15,105,195,285],"location":[-73.956069,40.675928]}],"driving_side":"right","geometry":"odtqlAhm|`lCzu at xR","mode":"driving","maneuver":{"bearing_after":194,"bearing_before":104,"location":[-73.956069,40.675928],"modifier":"right","type":"turn"},"weight":47.8,"duration":23.2,"name":"Franklin Avenue","distance":101.3},{"intersections":[{"out":3,"in":0,"entry":[false,false,true,true],"bearings":[15,105,195,285],"location":[-73.956386,40.67505]},{"out":3,"in":1,"entry":[true,false,false,true],"bearings":[15,105,195,285],"location":[-73.959758,40.675756]},{"out":3,"in":1,"entry":[false,false,false,true],"bearings":[15,105,195,285],"location":[-73.962865,40.676406]},{"out":2,"in":0,"entry":[false,true,true,true],"bearings":[105,165,285,345],"location":[-73.963529,40.676547]},{"out":3,"in":1,"entry":[true,false,true,true],"bearings":[15,105,195,285],"location":[-73.965974,40.67706]},{"out":3,"in":1,"entry":[true,false,true,true],"bearings":[15,105,195,285],"location":[-73.96886,40.677665]},{"out":3,"in":1,"entry":[true,false,false,true],"bearings":[15,105,195,285],"location":[-73.972027,40.678328]},{"out":2,"in":0,"entry":[false,true,true,true],"bearings":[105,150,300,330],"location":[-73.973542,40.678679]},{"out":3,"in":1,"entry":[true,false,true,true],"bearings":[30,120,210,300],"location":[-73.975321,40.679333]}],"driving_side":"right","geometry":"smrqlAba}`lCgNxhAaEzZqEj^yH|m at mEv]{ArKwd at ptDyGnh@a_ at xwCyd@jsDmh@|dEyPhpAcCjLkCpLoc at r`Bez at ruCXjF","mode":"driving","maneuver":{"bearing_after":284,"bearing_before":194,"location":[-73.956386,40.67505],"modifier":"right","type":"turn"},"weight":489.8,"duration":405.20000000000005,"name":"Prospect Place","distance":1908.4},{"intersections":[{"out":3,"in":1,"entry":[true,false,true,true],"bearings":[30,75,210,255],"location":[-73.977849,40.680267]}],"driving_side":"right","geometry":"us|qlAp~fblCZtFkz@~vC","mode":"driving","maneuver":{"bearing_after":260,"bearing_before":261,"location":[-73.977849,40.680267],"modifier":"straight","type":"new name"},"weight":72,"duration":59.9,"name":"Warren Street","distance":241.2},{"intersections":[{"out":3,"in":1,"entry":[true,false,false,true],"bearings":[30,120,210,300],"location":[-73.980404,40.681203]},{"out":2,"in":1,"entry":[false,false,true,true],"bearings":[30,120,210,300],"location":[-73.980523,40.681249]},{"lanes":[{"valid":false,"indications":["left"]},{"valid":true,"indications":["straight"]},{"valid":true,"indications":["none"]}],"out":2,"in":0,"entry":[false,true,true,false],"bearings":[30,120,210,300],"location":[-73.980954,40.680616]}],"driving_side":"right","geometry":"en~qlAf~kblC{AlF~\\lSpHnEvf at zY","mode":"driving","maneuver":{"bearing_after":296,"bearing_before":296,"location":[-73.980404,40.681203],"modifier":"left","type":"turn"},"weight":120.2,"duration":39.3,"name":"4th Avenue","distance":170},{"intersections":[{"out":3,"in":0,"entry":[false,false,true,true],"bearings":[30,120,210,300],"location":[-73.981384,40.67998]},{"out":3,"in":1,"entry":[true,false,true,true],"bearings":[30,120,210,300],"location":[-73.983711,40.68088]},{"out":3,"in":1,"entry":[false,false,true,true],"bearings":[30,120,210,300],"location":[-73.985672,40.681642]}],"driving_side":"right","geometry":"wa|qlAn{mblCgw at lpCsn@pyB_\\riAcTzt at cB~F","mode":"driving","maneuver":{"bearing_after":296,"bearing_before":206,"location":[-73.981384,40.67998],"modifier":"right","type":"turn"},"weight":133.20000000000002,"duration":108.70000000000002,"name":"Butler Street","distance":613.4},{"intersections":[{"out":0,"in":1,"entry":[true,false,false],"bearings":[30,120,210],"location":[-73.987856,40.682494]}],"driving_side":"right","geometry":"{~`rlA~ozblCmOaJaVqN","mode":"driving","maneuver":{"bearing_after":26,"bearing_before":296,"location":[-73.987856,40.682494],"modifier":"right","type":"end of road"},"weight":68,"duration":31.8,"name":"Bond Street","distance":78.9},{"intersections":[{"out":3,"in":2,"entry":[true,true,false,true],"bearings":[30,120,210,300],"location":[-73.98743,40.683126]}],"driving_side":"right","geometry":"kfbrlAjuyblC}CzA_EpN","mode":"driving","maneuver":{"bearing_after":306,"bearing_before":26,"location":[-73.98743,40.683126],"modifier":"left","type":"turn"},"weight":6.9,"duration":6.9,"name":"Baltic Street","distance":33.2},{"intersections":[{"in":0,"entry":[true],"bearings":[117],"location":[-73.987725,40.683301]}],"driving_side":"right","geometry":"iqbrlAxgzblC","mode":"driving","maneuver":{"bearing_after":0,"bearing_before":297,"location":[-73.987725,40.683301],"type":"arrive"},"weight":0,"duration":0,"name":"Baltic Street","distance":0}],"distance":3157.2}],"weight_name":"routability","weight":968.5,"duration":681,"distance":3157.2},{"geometry":"cftqlA`u|`lCgJtt at kBdOoAzJsL|_AuJxv at _v@kSyg at fbE{T|gBuQvxAuD`ZcT~cB{I|r at w@|Gwf at r|Dqg@|`EuDdZ[vJYpJMtB_ at dC_[ngAgIjYo}@`}CmAfFz\\zRdIzEpf at vY~\\lSpHnEvf at zYgw@lpCsn at pyB_\\riAcTzt at cB~FmOaJaVqN}CzA_EpN","legs":[{"summary":"Bergen Street, Butler Street","weight":1071.6,"duration":741.8,"steps":[{"intersections":[{"out":0,"entry":[true],"bearings":[285],"location":[-73.956193,40.675954]}],"driving_side":"right","geometry":"cftqlA`u|`lCgJtt at kBdOoAzJsL|_AuJxv@","mode":"driving","maneuver":{"bearing_after":285,"bearing_before":0,"location":[-73.956193,40.675954],"modifier":"left","type":"depart"},"weight":114.2,"duration":89.2,"name":"Saint Marks Avenue","distance":283.6},{"intersections":[{"out":0,"in":1,"entry":[true,false,false,false],"bearings":[15,105,195,285],"location":[-73.959433,40.676633]}],"driving_side":"right","geometry":"qpuqlAp_calC_v at kS","mode":"driving","maneuver":{"bearing_after":15,"bearing_before":284,"location":[-73.959433,40.676633],"modifier":"right","type":"turn"},"weight":72.2,"duration":27.7,"name":"Classon Avenue","distance":101.7},{"intersections":[{"out":3,"in":2,"entry":[true,false,false,true],"bearings":[15,105,195,285],"location":[-73.959107,40.677513]},{"out":3,"in":1,"entry":[false,false,true,true],"bearings":[15,105,195,285],"location":[-73.962231,40.678166]},{"out":2,"in":0,"entry":[false,true,true,true],"bearings":[105,165,285,345],"location":[-73.96391,40.678516]},{"out":3,"in":1,"entry":[true,false,true,true],"bearings":[15,105,195,285],"location":[-73.965346,40.678815]},{"out":3,"in":1,"entry":[true,false,true,true],"bearings":[15,105,195,285],"location":[-73.968226,40.679418]},{"out":3,"in":1,"entry":[true,false,false,true],"bearings":[15,105,195,285],"location":[-73.971403,40.680082]},{"out":3,"in":1,"entry":[true,false,true,true],"bearings":[15,105,195,285],"location":[-73.974506,40.680731]},{"out":2,"in":0,"entry":[false,true,true,true],"bearings":[90,150,270,330],"location":[-73.975129,40.680836]},{"out":3,"in":1,"entry":[true,false,true,true],"bearings":[30,120,210,300],"location":[-73.977022,40.681484]}],"driving_side":"right","geometry":"qgwqlAdkbalCyg at fbE{T|gBuQvxAuD`ZcT~cB{I|r at w@|Gwf at r|Dqg@|`EuDdZ[vJYpJMtB_ at dC_[ngAgIjYo}@`}C","mode":"driving","maneuver":{"bearing_after":284,"bearing_before":15,"location":[-73.959107,40.677513],"modifier":"left","type":"turn"},"weight":507.09999999999997,"duration":410.4,"name":"Bergen Street","distance":1818.3},{"intersections":[{"out":3,"in":1,"entry":[true,false,false,true],"bearings":[30,120,210,300],"location":[-73.979551,40.682484]},{"out":2,"in":1,"entry":[false,false,true,true],"bearings":[30,120,210,300],"location":[-73.979667,40.682523]},{"lanes":[{"valid":false,"indications":["left"]},{"valid":true,"indications":["none"]},{"valid":true,"indications":["none"]}],"out":2,"in":0,"entry":[false,true,true,false],"bearings":[30,120,210,300],"location":[-73.980095,40.681882]},{"out":2,"in":0,"entry":[false,false,true,true],"bearings":[30,120,210,300],"location":[-73.980523,40.681249]},{"lanes":[{"valid":false,"indications":["left"]},{"valid":true,"indications":["straight"]},{"valid":true,"indications":["none"]}],"out":2,"in":0,"entry":[false,true,true,false],"bearings":[30,120,210,300],"location":[-73.980954,40.680616]}],"driving_side":"right","geometry":"g~`rlA|hjblCmAfFz\\zRdIzEpf at vY~\\lSpHnEvf at zY","mode":"driving","maneuver":{"bearing_after":293,"bearing_before":296,"location":[-73.979551,40.682484],"modifier":"left","type":"turn"},"weight":170,"duration":67.1,"name":"4th Avenue","distance":328.5},{"intersections":[{"out":3,"in":0,"entry":[false,false,true,true],"bearings":[30,120,210,300],"location":[-73.981384,40.67998]},{"out":3,"in":1,"entry":[true,false,true,true],"bearings":[30,120,210,300],"location":[-73.983711,40.68088]},{"out":3,"in":1,"entry":[false,false,true,true],"bearings":[30,120,210,300],"location":[-73.985672,40.681642]}],"driving_side":"right","geometry":"wa|qlAn{mblCgw at lpCsn@pyB_\\riAcTzt at cB~F","mode":"driving","maneuver":{"bearing_after":296,"bearing_before":206,"location":[-73.981384,40.67998],"modifier":"right","type":"turn"},"weight":133.20000000000002,"duration":108.70000000000002,"name":"Butler Street","distance":613.4},{"intersections":[{"out":0,"in":1,"entry":[true,false,false],"bearings":[30,120,210],"location":[-73.987856,40.682494]}],"driving_side":"right","geometry":"{~`rlA~ozblCmOaJaVqN","mode":"driving","maneuver":{"bearing_after":26,"bearing_before":296,"location":[-73.987856,40.682494],"modifier":"right","type":"end of road"},"weight":68,"duration":31.8,"name":"Bond Street","distance":78.9},{"intersections":[{"out":3,"in":2,"entry":[true,true,false,true],"bearings":[30,120,210,300],"location":[-73.98743,40.683126]}],"driving_side":"right","geometry":"kfbrlAjuyblC}CzA_EpN","mode":"driving","maneuver":{"bearing_after":306,"bearing_before":26,"location":[-73.98743,40.683126],"modifier":"left","type":"turn"},"weight":6.9,"duration":6.9,"name":"Baltic Street","distance":33.2},{"intersections":[{"in":0,"entry":[true],"bearings":[117],"location":[-73.987725,40.683301]}],"driving_side":"right","geometry":"iqbrlAxgzblC","mode":"driving","maneuver":{"bearing_after":0,"bearing_before":297,"location":[-73.987725,40.683301],"type":"arrive"},"weight":0,"duration":0,"name":"Baltic Street","distance":0}],"distance":3257.5}],"weight_name":"routability","weight":1071.6,"duration":741.8,"distance":3257.5}],"waypoints":[{"hint":"Z_eKg3_3ioMgAAAAjwAAAAAAAAArAAAAj_0tQQ2olkIAAAAAvKK1QSAAAACPAAAAAAAAACsAAAB9RwAAn4SX-3KqbAKJhJf7N6psAgAA3xEPK482","distance":6.810633594962583,"name":"Saint Marks Avenue","location":[-73.956193,40.675954]},{"hint":"LXtcgP___38xAAAAyQAAABQAAAB0AwAAo8i8QaaqTEGoiRlBfOUfQzEAAABlAAAAFAAAALoBAAB9RwAAcwmX-yXHbAJ9CZf7M8dsAgEAjxIPK482","distance":1.7696805197984602,"name":"Baltic Street","location":[-73.987725,40.683301]}],"code":"Ok"}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20200418/b5afcacf/attachment-0001.html>


More information about the Qt-creator mailing list