Upsampling via python's SentinelHubRequest

Hi everyone,

I’m trying to generate a request using SentinelHubRequest from the python package using the ‘upsampling’ option. However, I’m having trouble in finding documentation on how to do it.

If my request looks like that:

request = SentinelHubRequest(
        evalscript=evalscript,
        input_data=[
            SentinelHubRequest.input_data(
                data_source=DataSource.SENTINEL2_L2A,
                time_interval=('2020-04-01', '2020-04-30'),
                mosaicking_order='leastCC'
            )
        ],
        responses=[
            SentinelHubRequest.output_response('default', MimeType.PNG)
        ],
        bbox=bbox,
        size=bbox_size,
        config=config
    )

how should I include the upsampling information? I would expect something like adding an option upsampling='bilinear', or something similar.

Thanks!

Hi @ademiquel,

As per API reference it is possible. The way to achieve it with SentinelHubRequest is to pass other_args to SentinelHubRequest.input_data, like so:

request = SentinelHubRequest(
        evalscript=evalscript,
        input_data=[
            SentinelHubRequest.input_data(
                data_source=DataSource.SENTINEL2_L2A,
                time_interval=('2020-04-01', '2020-04-30'),
                mosaicking_order='leastCC',
                other_args={'processing': {'upsampling': 'BICUBIC', 'downsampling':'BILINEAR'}} 
            )
        ],
        responses=[
            SentinelHubRequest.output_response('default', MimeType.PNG)
        ],
        bbox=bbox,
        size=bbox_size,
        config=config
    )

Available methods are: “BILINEAR”, “BICUBIC”, “LANCZOS”, “BOX” and “NEAREST”.

1 Like

Ah perfect, that worked. I had tried the other_args option before, but without the processing key.

Thanks a lot @batic !!

1 Like