Method: H3::Indexing#to_boundary
- Defined in:
- lib/h3/indexing.rb
#to_boundary(h3_index) ⇒ Array<Array<Integer>>
Derive the geographical boundary as coordinates for a given H3 index.
This will be a set of 6 coordinate pairs matching the vertexes of the hexagon represented by the given H3 index.
If the H3 index is a pentagon, there will be only 5 coordinate pairs returned.
73 74 75 76 77 78 79 |
# File 'lib/h3/indexing.rb', line 73 def to_boundary(h3_index) geo_boundary = GeoBoundary.new Bindings::Private.h3_to_geo_boundary(h3_index, geo_boundary) geo_boundary[:verts].take(geo_boundary[:num_verts]).map do |d| [rads_to_degs(d[:lat]), rads_to_degs(d[:lon])] end end |