2

I have a polygon the size of an office block in WGS84 coordinate system.

When I run h3.polyfill at resolution 15 it should return a large number of h3 res15 addresses whose centroids are contained in the polygon.

Instead it returns an empty set - why?

I am using h3-3.7.4 with python 3.9.6 on Windows 11.

import h3

geojson = {"type":"Polygon",
           "coordinates":[[
               [144.950974,-37.820148],
               [144.95162,-37.819951],
               [144.951856,-37.820324],
               [144.951248,-37.820497],
               [144.950974,-37.820148]
           ]]}

h3_res15_ids = h3.polyfill(geojson, 15)
print(h3_res15_ids)

Output:

set()

I thought maybe the trailing point which equals the first point might be the problem, but removing it does not change the output.

The polygon is: enter image description here

0

1 Answer 1

1

You need to use h3.polyfill_geojson(geojson, 15) or h3.polyfill(geojson, 15, geo_json_conformant=True)

1
  • Awesome thanks. Wish the documentation was a bit clearer...! May 18, 2022 at 4:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.