我希望OSRM能够给我一个距离矩阵(就像ArcGIS的网络分析师一样)。
我注意到在documentation中,这是通过调用功能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
我想知道是否有另一种方法可以将请求发送到localhost服务器?理想情况下,我想要与NA相同的功能,我可以给它一个50,000到50,000个位置的矩阵,并在一天内通过它们进行搅拌(截止时间为20分钟) - 这样的事情是可能的吗?
答案 0 :(得分:3)
许多库在执行HTTP请求时限制了URL的长度。 OSRM本身对URL长度没有限制。您需要更新--max-table-locations
参数。
对于相当大的请求,我建议使用我们的node-bindings或C ++库like in this example。
编辑:更新了示例链接。