routesosrm

Osrm Routing Not Working


I want to make routing between 5 coordinates but osrm route service not working.

my request to the server; https://router.project-osrm.org/route/v1/driving/28.0705,41.1813;22.5441,40.0051;28.3865,39.1073;22.6612,40.0330;27.3865,40.0151

response from server;

{
"routes": [
    {
        "geometry": "ybjzFcdijD}}BuqAhhOcmRfb[ham@mlFnfj@nsKf`q@uzBpnPxvEx|b@plK`p`@sdA~kuB_tKt{Ruf@vvOvcEzdS}u@vfYpgLr~o@_{l@~ez@enDjdYzZl~{@f`Jlu[ad@bhQjiNxtU~qDzan@pyOdiQk}@bkLnbQz}k@o`@bc_@zxVj}l@qhD~bn@|tBhcTkuIjen@xhGljKfa@pcTzfFuRlsVllr@~p^ilDpmQjpOhqp@q~IriBlzErhCby@mwB_sKoht@f{M{uQypOof]x_EuuLeoQs_Jer`@ajFvVk]}yS}pGw~LvyI_{l@_uBgbT|gDuen@wwVsxl@n`@eb_@ubQe_l@p|@qnLsxOmfQuqDq_n@gjNqxUlb@woQo}Iq`[_\\kk|@~mDedYr~l@qh|@wkLc`n@tv@acYycE_cS`f@oxOrtKm{RzdAwiuB{lKwr`@qvEg}b@rzBymPwuKusq@jrFgdi@kbK_pLocPmzi@|aM{sg@e}I_kYhiI_yQyjHuh~@fbAi`QdcG{vFaBsu[h{FzB~mCgsIt~FzfBtz[mle@fzJqXrqR~pWrx_@vgMfiIvl_@xsNfpDxjHpsPhmPad~@liJo{Ef`Wc`r@l}JmxAh`Kmwc@gaDc{]hmSqfe@jnf@`lHlzGvnOfyYdkNtbKofM~cPrmSldNle_Ah~s@df_A_fFtuUakVpxZ{jFxld@ck@zkYjvIw~@bcWpki@yvWllXxvWmlXccWqki@kvIv~@bk@{kYzjFyld@`kVqxZ~eFuuUi~s@ef_AmdNme_Ag`PgvSqmKh_M{qY{{McxGenOamf@orHarSjke@jaDl|]eaKlyc@u|JnvA}_W|_r@kdKjqFipOpb}@}kHaiPsoNwiDcmIur_@kx_@}gMuxR{rWw|JzVypFpzPafT~tSwzFigBapCpuIm{FiIhEnz[edG|wFmaAfjQrjHba~@{hIvuQn}I~fYkvLrgp@dz[rwn@ioFt{i@nsKf`q@uzBpnPxvEx|b@plK`p`@sdA~kuB_tKt{Ruf@vvOvcEzdS}u@vfYzjLp|m@i~l@`h|@enDjdY`\\pk|@`_Jhh[ad@bhQjiNxtU~qDzan@pyOdiQk}@bkLnbQz}k@o`@bc_@zxVj}l@qhD~bn@|tBhcTqyIt{l@~lGbtLfa@pcT`fF_T|xOlok@toLpoHr{Wq~F|tQbpOvri@i~E`hK}cLihKzbL{oi@j}Eg{QipOqvWt}F{lMwcJ_yNq|i@m_GsYkGofR}pGw~LvyI_{l@_uBgbTvhDcan@ewVcyl@b_@gf_@ubQe_l@v{@mqLywOqcQksD{en@elNa~U`f@}cQa~Iwe[i]mez@n}Dmb\\|ll@key@ytP{m~A`f@oxOrsK_tR|]gui@~rEd`AdlWohUjyOovXlqXzj_@~}OltHj{EqbKubDyoe@jtKmiNdcRkwr@hhWgPpfIaqHzaX~uGwbFibXgvGbcB",
        "legs": [
            {
                "summary": "",
                "weight": 59053.3,
                "duration": 29868.5,
                "steps": [],
                "distance": 633021.8
            },
            {
                "summary": "",
                "weight": 98982.7,
                "duration": 60860.9,
                "steps": [],
                "distance": 1270431
            },
            {
                "summary": "",
                "weight": 85723.3,
                "duration": 54659.9,
                "steps": [],
                "distance": 1255026.5
            },
            {
                "summary": "",
                "weight": 80038.7,
                "duration": 39865,
                "steps": [],
                "distance": 668853.2
            }
        ],
        "weight_name": "routability",
        "weight": 323798,
        "duration": 185254.3,
        "distance": 3827332.5
    }
],
"waypoints": [
    {
        "hint": "AFmhh4uHV4iAAgAAPgAAAIcBAAAAAAAAQAEAAB8AAADDAAAAAAAAAKPfAAAvS6wBZl50AmRSrAF0YHQCAgA_FTrv2WQ=",
        "name": "",
        "location": [
            28.068655,
            41.180774
        ]
    },
    {
        "hint": "F4gUhJHWs4QcAAAAQQAAALV8AABiNAAADQAAACEAAABdPgAAOBoAAKPfAAAH-FcB_m9iAuT-VwHsbWICzABfATrv2WQ=",
        "name": "",
        "location": [
            22.542343,
            40.00563
        ]
    },
    {
        "hint": "fIxchNifEYd3AAAAAAAAACFKAAAAAAAAOwAAAAAAAAAbJQAAAAAAAKPfAAB7E7EB-1hUAsQksQHkulQCiwCPEjrv2WQ=",
        "name": "",
        "location": [
            28.382075,
            39.082235
        ]
    },
    {
        "hint": "S4UOhLRX8YmHBAAAAAAAAMEAAAAAAAAAQwIAAAAAAABgAAAAAAAAAKPfAAA9OFkBdkNiAlDIWQHo2mICAwDfATrv2WQ=",
        "name": "",
        "location": [
            22.624317,
            39.99423
        ]
    },
    {
        "hint": "bsy0hnvMtIZ0AAAAPgAAAOsIAACDKwAAOgAAAB8AAAB0BAAAxBUAAKPfAAB8u6EB1JhiAoTioQH8lGICEgB_ADrv2WQ=",
        "name": "",
        "location": [
            27.376508,
            40.016084
        ]
    }
],
"code": "Ok"

}


1.location : 28.0705,41.1813 2.location : 22.5441,40.0051 3.location : 28.3865,39.1073 4.location : 22.6612,40.0330 5.location : 27.3865,40.0151

if we want to route between these points, does not it have to come out as follows 1.location : 28.0705,41.1813 3.location : 28.3865,39.1073 5.location : 27.3865,40.0151 4.location : 22.6612,40.0330 2.location : 22.5441,40.0051

Osrm can not direct to the shortest distance ?


Solution

  • There is nothing weird there. It's a route, so it will considere you have to go to your location with a precise order. So it won't change the order.

    It is written in the api : " Route service Finds the fastest route between coordinates in the supplied order. "

    If you want to order it, i'm not sure OSRM is the best tool for this but there is the "Trip service" that might do the job.

    Have a nice day.