Skip to content

Commit df3ad6e

Browse files
committed
Warn instead of Fail when margins are too large.
1 parent 50a6061 commit df3ad6e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/segger/data/tiling.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,15 @@ def _query_tiles(
101101
mitre_limit=margin / 2,
102102
)
103103
missing = buffered.is_empty.sum()
104+
# handling tiles too small for buffer
104105
if missing != 0:
105-
raise ValueError(
106+
import warnings
107+
warnings.warn(
106108
f"Margin ({margin}) is too large, causing {missing} "
107-
f"tile(s) to disappear. Consider using a smaller margin."
109+
f"tile(s) to disappear. These tiles will be removed from the query."
108110
)
111+
# Filter out the empty tiles
112+
buffered = buffered[~buffered.is_empty]
109113
tiles = buffered
110114

111115
# Spatial query

0 commit comments

Comments
 (0)