Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing get_tiles for target_number_tiles = 1 + using `fused.types... #717

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MaxLenormand
Copy link
Collaborator

Fixing get_tiles for target_number_tiles = 1 + using fused.types.Bounds as default

Made in Fused Workbench

@MaxLenormand MaxLenormand requested a review from kashuk March 14, 2025 10:08
@MaxLenormand
Copy link
Collaborator Author

Current implementation (before fix):

@fused.udf
def udf(bounds: fused.types.Bounds):
    common = fused.load("https://github.com/fusedio/udfs/tree/c0fd496/public/common").utils
    bbox = common.get_tiles(bounds)
    return bbox

Fails with:

ValueError: Cannot convert data of type <class 'tuple'> to GeoDataFrame. Please pass a GeoDataFrame, GeoSeries, DataFrame, Series, or shapely geometry.

stdout
---

stderr
---
  File "<udf udf>", line 8, in udf
    bbox = common.get_tiles(bounds)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "<module utils>", line 2745, in get_tiles
    gdf = to_gdf((tile.x, tile.y, tile.z))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<module utils>", line 1300, in to_gdf
    raise ValueError(
ValueError: Cannot convert data of type <class 'tuple'> to GeoDataFrame. Please pass a GeoDataFrame, GeoSeries, DataFrame, Series, or shapely geometry.

@MaxLenormand
Copy link
Collaborator Author

Fix:
CleanShot 2025-03-14 at 11 11 18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant