-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The following error thrown for some samples:
ValueError: Margin (20.0) is too large, causing 2 tile(s) to disappear. Consider using a smaller margin.
Implemented fix that just gives a warning and removes the missing tiles.
in _query_tiles in tiling.py
if margin < 0:
raise ValueError(
f"The margin must be non-negative, but got {margin}."
)
# Buffer tiles
tiles = self.tiles
if margin > 0:
buffered = tiles.buffer(
-margin,
cap_style='square',
join_style='mitre',
mitre_limit=margin / 2,
)
missing = buffered.is_empty.sum()
# handling tiles too small for buffer
if missing != 0:
import warnings
warnings.warn(
f"Margin ({margin}) is too large, causing {missing} "
f"tile(s) to disappear. These tiles will be removed from the query."
)
# Filter out the empty tiles
buffered = buffered[~buffered.is_empty]
tiles = buffered
The samples now complete. Could consider throwing an error if too many tiles are missing.
Metadata
Metadata
Assignees
Labels
No labels