Image pixels from adjacent (but overlapping) AOIs do not align when the data is downloaded, and I would like to know how I can ensure two requests for image pixels share the same alignment?
I am currently using the Python SDK, but to recreate the issue I have used the request builder, and here is the generated code for 2 adjacent AOIs, for S2 data on the same date.
AOI 1:
# This is script may only work with sentinelhub.__version__ >= '3.4.0'from sentinelhub import SentinelHubRequest, DataCollection, MimeType, CRS, BBox, SHConfig, Geometry# Credentialsconfig = SHConfig()config.sh_client_id = '<your client id here>'config.sh_client_secret = '<your client secret here>'evalscript = """//VERSION=3function setup() { return { input: ["B02", "B03", "B04"], output: { bands: 3 } };}function evaluatePixel(sample) { return [2.5 * sample.B04, 2.5 * sample.B03, 2.5 * sample.B02];}"""bbox = BBox(bbox=[30.55303014474393, -29.444193007640393, 30.554029904282658, -29.44325944105369], crs=CRS.WGS84)request = SentinelHubRequest( evalscript=evalscript, input_data=[ SentinelHubRequest.input_data( data_collection=DataCollection.SENTINEL2_L2A, time_interval=('2022-07-02', '2022-07-02'), ), ], responses=[ SentinelHubRequest.output_response('default', MimeType.TIFF), ], bbox=bbox, resolution=(0.00017699, 0.00017699), config=config)response = request.get_data()
AOI 2:
# This is script may only work with sentinelhub.__version__ >= '3.4.0'from sentinelhub import SentinelHubRequest, DataCollection, MimeType, CRS, BBox, SHConfig, Geometry# Credentialsconfig = SHConfig()config.sh_client_id = '<your client id here>'config.sh_client_secret = '<your client secret here>'evalscript = """//VERSION=3function setup() { return { input: ["B02", "B03", "B04"], output: { bands: 3 } };}function evaluatePixel(sample) { return [2.5 * sample.B04, 2.5 * sample.B03, 2.5 * sample.B02];}"""bbox = BBox(bbox=[30.55374081718668, -29.443881819731814, 30.554732546528953, -29.442930767626954], crs=CRS.WGS84)request = SentinelHubRequest( evalscript=evalscript, input_data=[ SentinelHubRequest.input_data( data_collection=DataCollection.SENTINEL2_L2A, time_interval=('2022-07-02', '2022-07-02'), ), ], responses=[ SentinelHubRequest.output_response('default', MimeType.TIFF), ], bbox=bbox, resolution=(0.00017699, 0.00017699), config=config)response = request.get_data()
e27fea03-e3e7-4f17-bacd-113202777076.tiff (466 Bytes)
09585002-b6cb-4a23-9634-c4a6af560851.tiff (462 Bytes)