我需要从overpass-api获取有关一条特定公共交通线路的所有数据。让我们说我的城市有148号。
I use something like this example below 但这给了我前进和后退路线的组合方式。我该如何单独购买?
<osm-script output="json">
<union>
<query type="relation">
<has-kv k="ref" v="148"/>
<bbox-query s="54.21466404047702" w="18.270263671875" n="54.503143645746924" e="18.840179443359375"/>
</query>
<recurse type="down" />
</union>
<print mode="skeleton" order="quadtile"/>
</osm-script>
&#13;
答案 0 :(得分:2)
以下是其他路线的示例,其中包含前进和后退路径。
[out:json][timeout:25];
(
//get relation
relation["route"="bus"][ref=157]({{bbox}});
// get ways with particular role
way(r:"forward");
// you may also add ways with empty role if you want
// give role as an empty string
//way(r:"");
// get way nodes.
// We can't use >; operator, because it will recurse to
// all relation members.
node(w);
);
out skel qt;
在overpass-turbo上尝试: http://overpass-turbo.eu/s/a4F