diff --git a/openeogeotrellis/integrations/tiffset.py b/openeogeotrellis/integrations/tiffset.py index c9a7c27e..0f50e43d 100644 --- a/openeogeotrellis/integrations/tiffset.py +++ b/openeogeotrellis/integrations/tiffset.py @@ -6,9 +6,9 @@ def embed_gdal_metadata(gdal_metadata_xml: str, geotiff_path: Union[Path, str]): # TODO: use gdal instead to avoid warnings or are they harmless? - with tempfile.NamedTemporaryFile(prefix="GDALMetadata", suffix=".xml.tmp", mode="wt", encoding="ascii") as tmp: + with tempfile.NamedTemporaryFile(prefix="GDALMetadata_", suffix=".xml.tmp", mode="wt", encoding="ascii") as tmp: # use temporary file to work around segfault in container - tmp.write(gdal_metadata_xml) + tmp.write(f"{gdal_metadata_xml}\n") tmp.flush() subprocess.check_call(["tiffset", "-sf", "42112", tmp.name, str(geotiff_path)]) diff --git a/tests/datacube_fixtures.py b/tests/datacube_fixtures.py index 69f8cba7..3b5e75ee 100644 --- a/tests/datacube_fixtures.py +++ b/tests/datacube_fixtures.py @@ -7,19 +7,20 @@ from openeogeotrellis.service_registry import InMemoryServiceRegistry -matrix_of_one = np.zeros((1, 4, 4)) +TILE_SIZE = 16 + +matrix_of_one = np.zeros((1, TILE_SIZE, TILE_SIZE)) matrix_of_one.fill(1) -matrix_of_two = np.zeros((1, 4, 4)) +matrix_of_two = np.zeros((1, TILE_SIZE, TILE_SIZE)) matrix_of_two.fill(2) -matrix_of_nodata = np.zeros((1, 4, 4)) +matrix_of_nodata = np.zeros((1, TILE_SIZE, TILE_SIZE)) matrix_of_nodata.fill(-1) -extent = {'xmin': 0.0, 'ymin': 0.0, 'xmax': 4.0, 'ymax': 4.0} -extent_webmerc = {'xmin': 0.0, 'ymin': 0.0, 'xmax': 445277.96317309426, 'ymax': 445640.1096560266} -layout = {'layoutCols': 1, 'layoutRows': 1, 'tileCols': 4, 'tileRows': 4} - +extent = {"xmin": 0.0, "ymin": 0.0, "xmax": 4.0, "ymax": 4.0} +extent_webmerc = {"xmin": 0.0, "ymin": 0.0, "xmax": 445277.96317309426, "ymax": 445640.1096560266} +layout = {"layoutCols": 1, "layoutRows": 1, "tileCols": TILE_SIZE, "tileRows": TILE_SIZE} openeo_metadata = { diff --git a/tests/test_load_collection.py b/tests/test_load_collection.py index 6c90f492..fcbdaebc 100644 --- a/tests/test_load_collection.py +++ b/tests/test_load_collection.py @@ -416,7 +416,7 @@ def test_load_disk_collection_pyramid( cube = cube.rename_labels("bands", ["band1", "bands"]) assert len(cube.metadata.spatial_dimensions) == 2 - assert len(cube.pyramid.levels) == 2 + assert len(cube.pyramid.levels) == 4 def test_load_disk_collection_batch(imagecollection_with_two_bands_and_three_dates,backend_implementation,tmp_path):