0

我想在 5 个坐标之间进行路由,但 osrm 路由服务不起作用。

我对服务器的请求; 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

来自服务器的响应;

{
"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.位置:28.0705,41.1813 2.位置:22.5441,40.0051 3.位置:28.3865,39.1073 4.位置:22.6612,40.0330 5.位置:27.3865,40.0151

如果我们想在这些点之间进行路由,是否必须如下所示 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不能直接到最短距离吗?

4

1 回答 1

2

那里没有什么奇怪的。这是一条路线,因此它会考虑您必须以精确的顺​​序前往您的位置。所以它不会改变顺序。

它写在 api 中:“路线服务以提供的顺序查找坐标之间的最快路线。”

如果您想订购它,我不确定 OSRM 是不是最好的工具,但有“旅行服务”可以完成这项工作。

祝你今天过得愉快。

于 2018-01-16T10:26:00.580 回答