OpenStreetMapx.jl使用子网路由
我正在使用OpenStreetMapx.jl
库来计算我的OSM网络点之间的路由。
有什么方法可以获得将结果限制为预定义子网络的路径的方法?
例如,我想计算两个点之间的路线,但仅使用次级道路。
是否可以?
I am using OpenstreetmapX.jl
library to calculate routes between to points of my OSM network.
Is there any way to obtain such routes limiting the results to paths of a predefined sub network?
For instance, I would like to calculate the route between two points but only using secondary roadways.
Is it possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您很可能想创建一个单独的
mapData
来处理此类数据。有一个不错的工具 osmfilter ,在将数据导入到Julia之前,可以过滤特定的路由类型。这样,您可以拥有地图数据的单独表示形式。
但是,如果要直接在
mapdata
对象上操作,则可以将距离权重设置为Inf
,并且它将迫使路由算法避免使用此类边缘或返回INF
路线长度。假设您拥有来自教程的地图:
比过滤二级途径要多:
现在所选路由在
MX
和M2
之间会有所不同:Most likely you would like to create a separate
MapData
object for processing such data. There is a nice tool osmfilter that allows to filter out specific route types before importing data to Julia.In this way you can have separate representations of your map data.
However, if you want to operate directly on the
MapData
object you could set the distance weights toInf
and which would force the routing algorithm to avoid such edges or returnInf
route length.Suppose you have the map from the tutorials:
Than you could do to filter out secondary routes:
Now the selected route will differ between
mx
andm2
: