英文:
Finding a particular house number near to major roads
问题
抱歉,我只能提供中文翻译,不能返回原文代码。以下是您要翻译的内容:
我正在尝试构建一个Overpass查询,以返回特定门牌号的所有3层楼房,这些房屋靠近主要道路。我理解这涉及一个'around'过滤器,但我无法弄清如何包括它。目前我在Overpass Turbo中有以下代码:
[out:xml][timeout:25];
(
node["addr:housenumber"="26"]["building:levels"="3"]({{bbox}});
way["addr:housenumber"="26"]["building:levels"="3"]({{bbox}});
relation["addr:housenumber"="26"]["building:levels"="3"]({{bbox}});
);
out meta;
>;
out meta qt;
希望对您有所帮助。
英文:
I'm trying to construct an Overpass query to return all 3-storey houses of a particular house number that are near to major roads. I understand that this involves an 'around' filter, probably, but I can't figure out how to include it. What I have at the minute (for Overpass Turbo) is:
[out:xml][timeout:25];
(
node["addr:housenumber"="26"]["building:levels"="3"]({{bbox}});
way["addr:housenumber"="26"]["building:levels"="3"]({{bbox}});
relation["addr:housenumber"="26"]["building:levels"="3"]({{bbox}});
);
out meta;
>;
out meta qt;
答案1
得分: 0
这是受到 overpass wiki (https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Relative_to_other_elements_(around)) 启发的。
创建一个包含主要道路的集合,然后在该集合上执行一个 'around' 过滤器,这里是 50 米:(很难找到有结果的城市...)。如果您想搜索主要和次要道路,可以执行并集操作或使用正则表达式键搜索。
area[name="伦敦"];
way(area)[highway=primary]->.major_roads;
( node(around.major_roads:50)["addr:housenumber"="26"]["building:levels"="3"];
way(around.major_roads:50)["addr:housenumber"="26"]["building:levels"="3"];
area(around.major_roads:50)["addr:housenumber"="26"]["building:levels"="3"];
);
out meta;
>;
out meta qt;
英文:
This is inspired by the overpass wiki (https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Relative_to_other_elements_(around))
Create a set with your major roads, then do an 'around' filter on that set, here 50m: (It was hard to find a city with results...). You could do a union, or use a regex key search if you want to search primary and secondary roads.
area[name="London"];
way(area)[highway=primary]->.major_roads;
( node(around.major_roads:50)["addr:housenumber"="26"]["building:levels"="3"];
way(around.major_roads:50)["addr:housenumber"="26"]["building:levels"="3"];
area(around.major_roads:50)["addr:housenumber"="26"]["building:levels"="3"];
);
out meta;
>;
out meta qt;
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论