overpass-api方式查询包含坐标 [英] overpass-api ways query include coordinates

查看:358
本文介绍了overpass-api方式查询包含坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试查询特定区域的酒店.不幸的是,我需要查询节点和方式,因为有些旅馆只存储为方式,有些则存储为节点.

I'm trying to query Hotels in a specific area. Unfortunately I need to query nodes and ways, because some Hotels are only stored as way and some as nodes.

http://overpass.osm.rambler.ru/cgi/interpreter?data=%28way[tourism~hotel]%28around:5000,50.10707,8.76040%29%29;out;

方式查询的结果不包含任何坐标,仅包含大量的节点引用:

The result of a way-query doesn't contain any coordinates, only lots of node-refs:

<nd ref="1438833423"/>

是否还有一种方法可以在输出中包含节点的坐标,或者是否必须为每个节点启动很多其他查询?

Is there a way also to include the coordinates of the nodes in the output or do have to start lots of additional queries for each node?

汤姆

推荐答案

是的,有多种方法还可以通过Overpass API获取非节点要素的几何.最简单的方法可能是使用center输出模式(将out;替换为out center;): http://overpass-turbo .eu/s/4O4 .其他选项是在递归步骤中获取节点引用: http://overpass-turbo.eu/s/4O5或使用完整几何图形输出模式.

Yes, there are several ways to also get geometries for non-node features via the Overpass API. The easiest is probably to use the center output mode (replace out; with out center;): http://overpass-turbo.eu/s/4O4. Other options would be to fetch the node references in a recursion step: http://overpass-turbo.eu/s/4O5 or using the full geometry output mode.

PS:请不要忘记,酒店也可以映射为OSM中的(多多边形)关系,而不仅仅是节点或方式.

PS: Don't forget that a hotel can also be mapped as a (multipolygon) relation in OSM, not just as a node or way.

这篇关于overpass-api方式查询包含坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆