[英]Query All Roads with Overpass API and export as polygon
I have a query for Overpass API. 我有一个Overpass API的查询。
mybbox = '8.9281,48.4379,9.1794,48.5827'
overpass_url = "http://overpass-api.de/api/interpreter"
overpass_query = """
[out:json];
// gather results
(
// query part for: "highway=*"
node["highway"]("""+mybbox+""");
way["highway"]("""+mybbox+""");
relation["highway"]("""+mybbox+""");
);
// print results
out center;
>;
out skel qt;
"""
I save result to a .json file. 我将结果保存为.json文件。 And the type is way.
而类型是方式。 But I want to define a road width and export road data as polygon.
但我想定义道路宽度并将道路数据导出为多边形。 For example if highway == motorway the road must be a polygon type and its width must be 4 meters.
例如,如果高速公路==高速公路,道路必须是多边形类型,其宽度必须为4米。 Is it possible?
可能吗?
As the others say, it is not possible to get the road width via Overpass API; 正如其他人所说,通过Overpass API无法获得道路宽度; you have to calculate it yourself.
你必须自己计算。 The API only serves to look up various objects of interest and to download them.
API仅用于查找感兴趣的各种对象并下载它们。 You may filter the results using a tag, eg
[width]
or similar: there are alternatives like est_width
or width_street
. 您可以使用标记过滤结果,例如
[width]
或类似标记:还有est_width
或width_street
等替代width_street
。 To find out how frequently each tag is used and which variant fits your needs, see this page with stats on usage (use the search box on right). 要了解每个标记的使用频率以及哪种变体符合您的需求,请参阅此页面以了解使用情况(使用右侧的搜索框)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.