1

我希望 OSRM 给我一个距离矩阵(就像 ArcGIS 的网络分析师一样)。

我注意到在文档中这是通过调用able API 获得的。这适用于少数位置(就像示例一样)但是,当我为 100 万距离的矩阵提供 1000 个位置的列表时,它会削减我的 HTTP 请求,例如,即使是这个示例:

http://127.0.0.1:5001/table?loc=53.27528,-2.1271&loc=57.06322,-2.13991&loc=57.1913,-2.12272&loc=57.13205,-2.13559&loc=57.12008,-2.12476&loc=57.14234,-2.09557&loc=57.15555,-2.16155&loc=57.20477,-2.17626&loc=57.18151,-2.10008&loc=57.14901,-2.1&loc=57.15304,-2.13709&loc=57.14375,-2.1141&loc=57.14303,-2.11291&loc=57.14232,-2.11251&loc=57.13497,-2.12728&loc=57.14072,-2.12075&loc=57.12336,-2.13657&loc=57.12726,-2.11935&loc=57.14355,-2.10829&loc=57.13866,-2.09983&loc=57.13787,-2.08856&loc=57.13696,-2.0871&loc=57.10416,-2.08579&loc=57.06132,-2.12678&loc=57.06059,-2.12547

被截断为:

// http://127.0.0.1:5001/table?loc=53.27528,-2.1271&loc=57.06322,-2.13991&loc=57.1913,-2.12272&loc=57.13205,-2.13559&loc=57.12008,-2.12476&loc=57.14234,-2.09557&loc=57.15555,-2.16155&loc=57.20477,-2.17626&loc=57.18151,-2.10008&loc=57.14901,-2.1&loc=57.15304,-2.13709&loc=57.14375,-2.1141&loc=57.14303,-2.11291&loc=57.14232,-2.11251&loc=57.13497,-2.12728&loc=57.14072,-2.12075&loc=57.12336,-2.13657&loc=57.12726,-2.11935&loc=57.14355,-2.10829&loc=57.13866,-2.09983&loc=57.13787,-2.08856&loc=57.13696,-2.0871&loc=57.10416,-2

我想知道是否有另一种方法可以将请求发送到本地主机服务器?理想情况下,我想要与 NA 相同的功能,我可以给它一个由 50,000 x 50,000 个位置组成的矩阵,并且它会在一天内通过它们(截止时间为 20 分钟)——这样的事情可能吗?

4

1 回答 1

3

很多库在进行 HTTP 请求时会限制 URL 的长度。OSRM 本身对 URL 长度没有限制。--max-table-locations不过,您需要更新一个参数。

这就是说,对于相当大的请求,我建议使用我们的节点绑定或 C++ 库,如本例所示

编辑:更新了示例链接。

于 2016-02-23T17:55:41.083 回答