lib/h3/regions.rb in h3-3.6.1 vs lib/h3/regions.rb in h3-3.6.2
- old
+ new
@@ -139,10 +139,11 @@
def h3_set_to_linked_geo(h3_indexes)
h3_set = H3Indexes.with_contents(h3_indexes)
linked_geo_polygon = LinkedGeoPolygon.new
Bindings::Private.h3_set_to_linked_geo(h3_set, h3_indexes.size, linked_geo_polygon)
+ # The algorithm in h3 currently only handles 1 polygon
extract_linked_geo_polygon(linked_geo_polygon).first
ensure
Bindings::Private.destroy_linked_polygon(linked_geo_polygon)
end
@@ -152,9 +153,11 @@
return if linked_geo_polygon.null?
geo_polygons = [linked_geo_polygon]
until linked_geo_polygon[:next].null?
+ # Until the h3 algorithm is updated to handle multiple polygons,
+ # this block will never run.
geo_polygons << linked_geo_polygon[:next]
linked_geo_polygon = linked_geo_polygon[:next]
end
geo_polygons.map(&method(:extract_geo_polygon))