Issue converting H3 cell boundary WKT to geometry with GeoAccessor.set_geometry()

142
3
yesterday
Labels (2)
AmrMortada
Emerging Contributor

H3 polygons work at resolution 8 but become empty at resolution 9+

Environment

  • ArcGIS Pro 3.6
  • ArcGIS API for Python 2.4.2
  • DuckDB 1.5.4
  • DuckDB Spatial Extension
  • DuckDB H3 Extension
  • Python Notebook in ArcGIS Pro

Description

I found what appears to be a bug in GeoAccessor.set_geometry() when converting H3 cell boundary WKT geometries.

Using the same workflow, H3 polygons at resolutions 0–8 are converted correctly and displayed on the map. However, polygons at resolutions 9–15 are converted to empty geometries.

The feature class is created successfully, but no geometry is displayed on the map.

Output

Resolution 8 (Works)

{'rings': [[[31.134037, 29.98722], [31.139995, 29.98765], [31.143417, 29.983361], [31.140882, 29.978643], [31.134924, 29.978213], [31.131502, 29.982502], [31.134037, 29.98722]]], 'spatialReference': {'wkid': 4326, 'latestWkid': 4326}}
<class 'arcgis.geometry._types.Polygon'>

Resolution 10 (Fails)

{'rings': [], 'spatialReference': {'wkid': 4326, 'latestWkid': 4326}}
<class 'arcgis.geometry._types.Polygon'>

The same geometries are successfully parsed using arcpy.FromWKT() and are reported as valid by DuckDB ST_IsValid(), suggesting the issue occurs during the GeoAccessor.set_geometry() conversion process.

I've attached two minimal reproducible examples. The only change is the H3 resolution (8 vs 10), yet one works and the other returns an empty polygon geometry.

0 Kudos
3 Replies
KenGalliher1
Esri Contributor

@AmrMortada I can reproduce this version 2.4.2 of the Python API but not with 2.4.3. Can you please try upgrading your environment to use 2.4.3?

conda install esri::arcgis==2.4.3

or 

pip install arcgis==2.4.3

0 Kudos
AmrMortada
Emerging Contributor

@KenGalliher1 Thanks for checking!

I upgraded to ArcGIS API for Python 2.4.3 and tested the same two scripts again, but I'm still seeing the same behavior.

  • Resolution 8: Polygon is created correctly and displayed on the map.
  • Resolution 10: GeoAccessor.set_geometry() returns a Polygon with rings: [], resulting in an empty geometry.

I've also attached two screenshots after upgrading to 2.4.3:

  • One showing the successful output for resolution 8.
  • One showing the empty geometry for resolution 10.
KenGalliher1
Esri Contributor

@AmrMortada Thanks for trying that. I'll continue to look into it. In the meantime, if possible, can you log an issue with Tech Support to get this into our system?

0 Kudos