1

I'm trying to take a h3 hex id and convert it to a polygon to use in a geodataframe (and eventually export as a shapefile). All of the methods in h3 documented online don't seem to work for me, and cannot figure out what method to use.

I'm using h3 3.7.6

import h3
h3.cells_to_multi_polygon('86264c28fffffff', geo_json=False)

gives me AttributeError: module 'h3' has no attribute 'cells_to_multi_polygon' (reference: https://h3geo.org/docs/api/regions/)

import h3
h3.h3_to_geo_boundary('86264c28fffffff', geo_json=False)

gives me AttributeError: module 'h3' has no attribute 'h3_to_geo_boundary' (reference: How to generate shapefiles for H3 hexagons in a particular area)

import h3
h3.cells_to_polygons('86264c28fffffff')

gives me AttributeError: module 'h3' has no attribute 'cells_to_polygons' (reference: https://uber.github.io/h3-py/api_reference.html#h3.cells_to_polygons)

those are the three methods that I've seen used in other posts (see references), none of these exist in the most recent version of h3 and I cannot figure out the correct one to use

Geoff Perrin
  • 444
  • 1
  • 6
  • 14

1 Answers1

0

Which version of h3 do you have? Maybe it is lower version of h3.

Try to install h3 latest version (4.0+).

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 13 '23 at 20:55