isaacbrodsky / h3-duckdb

Bindings for H3 to DuckDB
Apache License 2.0
173 stars 9 forks source link

h3_cells_to_multi_polygon_wkt error #137

Open samlalwani opened 13 hours ago

samlalwani commented 13 hours ago

On calling ST_GeomFromText over the column generated by h3_cells_to_multi_polygon_wkt , I see the following error : shapely.errors.GEOSException: IllegalArgumentException: Points of LinearRing do not form a closed linestring

isaacbrodsky commented 12 hours ago

Thanks for reporting this. I am not able to immediately reproduce because using ST_GeomFromText within DuckDB is fine with the multipolygons not being closed. That being said, it looks like this function does indeed need to duplicate the first vertex to be compliant with how OGC wants the WKT. Please see #138

samlalwani commented 11 hours ago

I was calling ST_GeomFromText within DuckDB , its strange you did not observe this issue. Will try to create a test dataset.

I moved this operation to geopandas using h3.cells_to_h3shape which works perfectly though I loose the processing/scalabale advantage of dudkdb.