【发布时间】:2017-11-22 19:22:26
【问题描述】:
什么 S2Region 以及我应该如何使用从给定的纬度、经度和半径绘制的圆覆盖某个父级别(比如说 9)的所有 s2 单元格。下面是一个使用 python s2 库获取矩形下所有单元格的示例。
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/
我正在寻找类似的东西
region_circle = S2latLangCircle(lat,lang,radius)
我在 c++ Using google s2 library - find all s2 cells of a certain level within the circle, given lat/lng and radius in miles/km 中为 google s2 库找到了这个问题的答案,但我在 python 中需要这个。
谢谢
【问题讨论】:
标签: python geolocation s2