@@ -79,15 +79,16 @@ def fetch_embeddings_lazy(
7979 year : int = 2024 ,
8080 progress_callback : Optional [callable ] = None ,
8181 ) -> Generator [Tuple [float , float , np .ndarray , object , object ], None , None ]:
82- """Fetch all embedding tiles within a bounding box with CRS information.
82+ """Lazily fetches all embedding tiles within a bounding box with CRS information.
83+ Use as a generator to process tiles one at a time in a memory-efficient manner.
8384
8485 Args:
8586 bbox: Bounding box as (min_lon, min_lat, max_lon, max_lat)
8687 year: Year of embeddings to download
8788 progress_callback: Optional callback function(current, total) for progress tracking
8889
8990 Returns:
90- List of (tile_lon, tile_lat, embedding_array, crs, transform) tuples where:
91+ Generator of (tile_lon, tile_lat, embedding_array, crs, transform) tuples where:
9192 - tile_lon: Tile center longitude
9293 - tile_lat: Tile center latitude
9394 - embedding_array: shape (H, W, 128) with dequantized values
@@ -152,7 +153,8 @@ def fetch_embeddings(
152153 year : int = 2024 ,
153154 progress_callback : Optional [callable ] = None ,
154155 ) -> List [Tuple [float , float , np .ndarray , object , object ]]:
155- """Fetch all embedding tiles within a bounding box with CRS information.
156+ """Eagerly fetch all embedding tiles within a bounding box with CRS information.
157+ For large areas, consider using fetch_embeddings_lazy() instead.
156158
157159 Args:
158160 bbox: Bounding box as (min_lon, min_lat, max_lon, max_lat)
0 commit comments