Closed
Description
Please briefly describe your problem and what output you expect:
When composite = NULL
filenames are duplicated. I would expect unique filenames.
I think what's happening here is duplication rather than overwriting any data...
I'll take a closer look asap. 👍
aoi <- sf::st_point(c(-74.912131, 44.080410))
aoi <- sf::st_set_crs(sf::st_sfc(aoi), 4326)
aoi <- sf::st_buffer(sf::st_transform(aoi, 3857), 100)
out <- rsi::get_sentinel2_imagery(
aoi,
"2022-06-01",
"2022-06-30",
output_filename = tempfile(fileext = ".tif"),
mask_function = rsi::sentinel2_mask_function,
composite_function = NULL
)
print(out)
#> [1] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-29T154821.024000Z.tif"
#> [2] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-29T154821.024000Z.tif"
#> [3] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-24T154819.024000Z.tif"
#> [4] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-24T154819.024000Z.tif"
#> [5] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-19T154821.024000Z.tif"
#> [6] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-19T154821.024000Z.tif"
#> [7] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-14T154819.024000Z.tif"
#> [8] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-14T154819.024000Z.tif"
#> [9] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-09T154821.024000Z.tif"
#> [10] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-09T154821.024000Z.tif"
#> [11] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-04T154809.024000Z.tif"
#> [12] "/tmp/RtmpjBc47p/fileb4cb845f6d1c1_2022-06-04T154809.024000Z.tif"
duplicated(out)
#> [1] FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE
Created on 2025-01-21 with reprex v2.1.1