问题描述
对于一个地理空间数据分析项目,我们目前正在使用立交桥"的多边形查询(沿着道路的缓冲区来定义道路)来提取沿一条道路的道路的道路类型和限速数据.问题在于,在单独的轨迹的情况下,我们最终可能会遇到不连续的多边形,这通常会导致计算时间显着增加.在这种情况下,我们想知道Overpass的多边形查询实际上是如何工作的.算法是只查询该多边形或这些多边形内的数据,还是在边界框内查询,然后过滤掉多边形内的数据?
For a project on geospatial data analytics, we are currently extracting road type and speed limit data of certain roads along a track by using Overpass' polygon query (where we define the roads by a buffer zone around them). The problem is that in the case of separate tracks, we can end up with disconnected polygons which often lead to a significant increase in computation time. In this situation, we were wondering how Overpass' polygon query actually works. Does the algorithm actually query only the data inside this polygon/these polygons, or does it query inside a bounding box, after which it filters out the data inside the polygons?
推荐答案
该算法检查节点是否在已定义的多边形内,或者是否有方法穿过该多边形.并非像您提到的那样基于边界框.
The algorithm checks if nodes are inside the defined polygon, or if a way crosses the polygon. It's not based on bounding boxes as you mentioned.
根据您的描述,尚不清楚为什么断开的多边形会引起问题.使用基于lz4的后端以及(poly: )
过滤器中合理数量的经/纬对对,您应该获得不错的性能(提供的对越多,计算的成本就越高).
From your description it's not quite clear why disconnected polygons pose an issue. You should get decent performance with a lz4-based backend and a reasonable number of lat/lon pairs in your (poly: )
filter (the more pairs you provide, the more expensive the computation gets).
BTW:解决此问题的最佳方法是我在此博客文章中描述的内容: https://www.openstreetmap.org/user/mmd/diary/42055 -很遗憾,此功能尚未在官方分支机构中提供.如果您看到它的某些用途,请在此处投票: https://github.com/drolbr/Overpass-API/issues/418
BTW: The best approach to tackle this issue would be something I described in this blog post: https://www.openstreetmap.org/user/mmd/diary/42055 - unfortunately, this feature is not yet available in the official branch. If you see some use for it, please upvote here: https://github.com/drolbr/Overpass-API/issues/418
这篇关于与边界框相比,使用天桥多边形查询是否具有计算优势?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!