简体   繁体   English

查询高速公路和相应节点的Overpass API

[英]Query Overpass API for highways and corresponding nodes

Can someone perhaps be so kind to give me some hints? 有人可能会这么友善地给我一些提示吗? I completely fail to put all the simple overpass examples together to get what I need: 我完全无法将所有简单的立交桥示例放在一起以获得所需的东西:

  • Inside the relation: http://www.openstreetmap.org/relation/2618040 关系内部: http : //www.openstreetmap.org/relation/2618040
  • I want to get all ways where "highway" is "motorway, trunk, primary, motorway_link, ..." 我想知道“高速公路”是“高速公路,后备箱,主要道路,motorway_link ...”的所有方式。
  • All nodes those ways are referring to. 这些方式所指的所有节点。
  • From the ways I want to keep the tags name , highway and oneway 从我想保留标签名称高速公路单向的方式
  • I want the nodes without any additional data. 我希望节点没有任何其他数据。 Like so: <node id="122317" lat="53.5282633" lon="10.0232716"/> 像这样: <node id="122317" lat="53.5282633" lon="10.0232716"/>

I'm not an Overpass API expert but this should work: 我不是Overpass API专家,但这应该可以工作:

[out:json][timeout:25];
area["iso3166-2"="DE-HH"];
way(area)["highway"];
(._;>;);
out;

See the result on overpass turbo (warning: this is a lot of data, your browser could have trouble handling it). 在立交桥turbo上查看结果 (警告:这是很多数据,您的浏览器可能无法处理它)。 You might also have to increase the timeout for the query to succeed. 您可能还必须增加超时才能使查询成功。 Alternatively see the raw data directly from Overpass API. 或者,直接从Overpass API中查看原始数据

I replaced your relation ID 2618040 with a specific tag which should be more stable. 我将您的关系ID 2618040替换为应该更稳定的特定标签。 But of course you can also use the relation ID if you like. 但是当然,您也可以根据需要使用关系ID。 For this you have to add 3600000000 to the relation ID because areas aren't native elements in OSM: 为此,您必须在关系ID中添加3600000000 ,因为区域不是OSM中的本机元素:

[out:json][timeout:25];
way(area:3602618040)[highway];
(._;>;);
out;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2025 STACKOOM.COM