File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 66
77import numpy as np
88import rasterio
9+ from affine import Affine
910from loguru import logger
1011from osgeo import gdal
1112from osgeo import osr
13+ from rasterio import warp
14+ from rasterio .crs import CRS
15+ from rasterio .enums import Resampling
1216from rasterio .merge import merge as riomerge
1317from satextractor .models import ExtractionTask
1418from satextractor .models import Tile
@@ -80,6 +84,7 @@ def get_tile_pixel_coords(tiles: List[Tile], raster_file: str) -> List[Tuple[int
8084
8185 return list (zip (rows , cols ))
8286
87+
8388def download_and_extract_tiles_window_COG (
8489 fs : Any ,
8590 task : ExtractionTask ,
@@ -119,6 +124,7 @@ def download_and_extract_tiles_window_COG(
119124 out_shape = out_shp ,
120125 fill_value = 0 ,
121126 boundless = True ,
127+ resampling = Resampling .bilinear ,
122128 )
123129
124130 out_f = f"{ task .task_id } _{ ii } .tif"
@@ -142,7 +148,6 @@ def download_and_extract_tiles_window_COG(
142148 return outfiles
143149
144150
145-
146151def download_and_extract_tiles_window (
147152 download_f : Callable ,
148153 task : ExtractionTask ,
@@ -223,7 +228,7 @@ def task_mosaic_patches(
223228 Returns:
224229 List[np.ndarray]: The tile patches as numpy arrays
225230 """
226-
231+
227232 if task .constellation == "sentinel-2" :
228233 out_files = download_and_extract_tiles_window (download_f , task , resolution )
229234 else :
You can’t perform that action at this time.
0 commit comments