Skip to content

Commit 21f749e

Browse files
_job_splitting: add warning when the resulting tile grid will be larger than 500x500 tiles #883
1 parent 687779f commit 21f749e

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

openeo/extra/job_management/_job_splitting.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ def _split_bounding_box(to_cover: BBoxDict, tile_size: float) -> List[Polygon]:
160160
n_cols = math.ceil(round((east - west) / tile_size, 10))
161161
n_rows = math.ceil(round((north - south) / tile_size, 10))
162162

163+
if n_cols > 500 or n_rows > 500:
164+
_log.warning(
165+
"Attempting to split AOI into %d columns and %d rows of tiles. "
166+
"This may take a while and consume a lot of memory. Consider increasing the tile size.",
167+
n_cols,
168+
n_rows,
169+
)
170+
163171
tiles = []
164172
for col in range(n_cols):
165173
for row in range(n_rows):
@@ -279,7 +287,7 @@ def split_area(
279287
:param tile_grid: a :class:`_TileGridInterface` instance or a
280288
:class:`~geopandas.GeoDataFrame` (with CRS set) that defines the tiling
281289
strategy. Mutually exclusive with *projection* / *tile_size*.
282-
:return: :class:`~geopandas.GeoDataFrame` with one row per tile and CRS set.
290+
:return: :class:`~geopandas.GeoDataFrame` with one row per tile and CRS equal to the tile grid CRS.
283291
:raises JobSplittingFailure: on invalid or contradictory arguments.
284292
"""
285293
if tile_grid is not None:

0 commit comments

Comments
 (0)