diff --git a/MANIFEST.in b/MANIFEST.in
index 009b5940..a7bc07d2 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -11,6 +11,7 @@ include deepforest/data/2019_YELL_2_528000_4978000_image_crop2.xml
include deepforest/data/2019_YELL_2_528000_4978000_image_crop2.png
include deepforest/data/AWPE*
include deepforest/data/example.csv
+include deepforest/data/test_tiled.tif
include LICENSE
include dev_requirements.txt
diff --git a/deepforest/data/test_tiled.tif b/deepforest/data/test_tiled.tif
new file mode 100644
index 00000000..33ad487c
Binary files /dev/null and b/deepforest/data/test_tiled.tif differ
diff --git a/deepforest/dataset.py b/deepforest/dataset.py
index a7cbf511..4d662e9d 100644
--- a/deepforest/dataset.py
+++ b/deepforest/dataset.py
@@ -195,6 +195,8 @@ class RasterDataset:
raster_path (str): Path to raster file
patch_size (int): Size of windows to predict on
patch_overlap (float): Overlap between windows as fraction (0-1)
+ Returns:
+ A dataset of raster windows
"""
def __init__(self, raster_path, patch_size, patch_overlap):
self.raster_path = raster_path
@@ -206,6 +208,16 @@ def __init__(self, raster_path, patch_size, patch_overlap):
width = src.shape[0]
height = src.shape[1]
+ # Check is tiled
+ if not src.is_tiled:
+ raise ValueError(
+ "Out-of-memory dataset is selected, but raster is not tiled, "
+ "leading to entire raster being read into memory and defeating "
+ "the purpose of an out-of-memory dataset. "
+ "\nPlease run: "
+ "\ngdal_translate -of GTiff -co TILED=YES