Skip to content

Commit 0492296

Browse files
committed
1 parent c1b8676 commit 0492296

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

openeogeotrellis/geopysparkdatacube.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,14 @@ def chunk_polygon(
584584

585585
if isinstance(reducer, dict):
586586
reducer = GeoPySparkBackendImplementation.accept_process_graph(reducer)
587-
chunks: List[Polygon] = chunks.geoms
587+
588+
if isinstance(chunks, Polygon):
589+
chunks = [chunks]
590+
elif isinstance(chunks, MultiPolygon):
591+
chunks: List[Polygon] = chunks.geoms
592+
else:
593+
raise ValueError(f"Invalid type for `chunks`: {type(chunks)}")
594+
588595
jvm = get_jvm()
589596

590597
result_collection = None

0 commit comments

Comments
 (0)