我应该使用什么样的s2区域,以及我应该如何使用从给定的纬度、长度和半径绘制的圆覆盖特定父级别(比如9)的所有s2单元格。下面是一个使用pythons2库获取矩形下所有单元格的示例。在
region_rect = S2LatLngRect(
S2LatLng.FromDegrees(-51.264871, -30.241701),
S2LatLng.FromDegrees(-51.04618, -30.000003))
coverer = S2RegionCoverer()
coverer.set_min_level(8)
coverer.set_max_level(15)
coverer.set_max_cells(500)
covering = coverer.GetCovering(region_rect)
示例源http://blog.christianperone.com/2015/08/googles-s2-geometry-on-the-sphere-cells-and-hilbert-curve/
我在找类似的东西
^{pr2}$我为用c++Using google s2 library - find all s2 cells of a certain level within the circle, given lat/lng and radius in miles/km实现的googles2库找到了这个问题的答案,但我需要在python中使用它。在
谢谢
在link的帮助下,我制定了python解决方案。在
我正在使用pythons2sphere库。在
getCoveringRect方法返回给定父级的所有s2单元格(矩形边界),这些单元格由从给定纬度绘制的圆覆盖,包括圆心和给定半径
相关问题 更多 >
编程相关推荐